/* ==========================================================================
   ui.css -- visual modernization layer for the legacy ASP application
   --------------------------------------------------------------------------
   Loaded from compat_head.asp, i.e. BEFORE the page's own jd.css.
   Every rule therefore uses the "html body ..." prefix so it outranks the
   legacy class rules in jd.css regardless of source order.

   Design constraints (do not break these):
   1. Layout geometry is untouched. Fixed widths (1000 / 770 / 98% / 80%),
      table structure and cell heights stay exactly as they are. Only type,
      colour, surface, borders and control chrome change.
   2. Structural attribute colours are respected. Zebra / hover stripes are
      applied with td:not([bgcolor]) so cells that carry meaning through
      bgcolor (status legend, highlighted rows) keep their own colour.
   3. Printing must stay clean -- see the @media print block at the end.
   4. ASCII only. The pages around this file are GB2312/GB18030.
   ========================================================================== */

/* -------------------------------------------------------------------------
   1. Base surface and typography
   Kills the pale-yellow "fffdd5" page background that 49 <body> tags still
   carry, and switches the application to a neutral canvas + system UI stack.
   ------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: #eef2f7;
}

html body {
  background: #eef2f7;
  background-color: #eef2f7;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html body td,
html body th,
html body div,
html body span,
html body p,
html body li,
html body font {
  font-family: inherit;
}

html body h1, html body h2, html body h3, html body h4 {
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0;
}

html body h1 { font-size: 20px; }
html body h2 { font-size: 17px; }
html body h3 { font-size: 15px; }

html body hr {
  height: 1px;
  border: 0;
  background: #e2e8f0;
  color: #e2e8f0;
  margin: 12px auto;
}

html body small { font-size: 12px; color: #64748b; }

/* -------------------------------------------------------------------------
   2. Legacy text classes (jd.css td1..td13 + baobiao*)
   jd.css declares several colours without a leading "#" (0F5FBE, a0a0a0,
   cc0000 ...) so the browser drops them and most cells render plain black.
   Restating every class with a valid value, a unified 13px size and a
   comfortable line-height, keeping the original semantic hues:
     blue  = label / link / header     red   = money, warning, expiry
     green = success / paid            grey  = secondary / empty
   ------------------------------------------------------------------------- */
html body td.td1 {
  font-size: 13px;
  line-height: 1.6;
  color: #ffffff;
  font-weight: 600;
  text-align: center;
}

html body td.td2 { font-size: 13px; line-height: 1.65; color: #9a3412; }
html body td.td3 { font-size: 13px; line-height: 1.65; color: #b42318; }
html body td.td4 { font-size: 13px; line-height: 1.65; color: #2563eb; }
html body td.td5 { font-size: 13px; line-height: 1.65; color: #1f2937; text-align: center; }

/* td6 is used for ordinary data cells in the grids, not only for muted text,
   so it must stay readable -- the legacy a0a0a0 was invalid and rendered
   black, turning it grey would wash out real data. */
html body td.td6 { font-size: 13px; line-height: 1.65; color: #334155; }

html body td.td7 { font-size: 13px; line-height: 1.65; color: #64748b; text-align: center; }
html body td.td8 { font-size: 13px; line-height: 1.65; color: #2563eb; }
html body td.td9 { font-size: 13px; line-height: 1.65; color: #dc2626; }
html body td.td10 { font-size: 13px; line-height: 1.65; color: #059669; text-align: center; }
html body td.td11 { font-size: 13px; line-height: 1.65; color: #2563eb; text-align: center; }
html body td.td13 { font-size: 13px; line-height: 1.65; color: #ea580c; font-weight: 600; text-align: center; }

html body td.baobiao  { font-size: 16px; line-height: 1.5; color: #b42318; text-align: center; font-weight: 600; }
html body td.baobiao1 { font-size: 13px; color: #1f2937; text-align: center; font-weight: 600; }
html body td.baobiao2 { font-size: 13px; color: #1f2937; text-align: center; }
html body td.baobiao3 { font-size: 13px; color: #94a3b8; }
html body td.baobiao4 { font-size: 13px; color: #1f2937; }
html body td.baobiao5 { font-size: 13px; color: #1f2937; }
html body td.baobiao6 { font-size: 13px; color: #2563eb; height: auto; text-align: center; }

html body td.gonggao  { font-size: 13px; line-height: 1.7; color: #2563eb; letter-spacing: 0; }

/* -------------------------------------------------------------------------
   3. Links
   ------------------------------------------------------------------------- */
html body a {
  color: #2563eb;
  text-decoration: none;
}

html body a:hover {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

html body a.normal,
html body a.normal3,
html body a.normal4 {
  font-size: 13px;
  color: #2563eb;
  letter-spacing: 0;
  line-height: 1.65;
}

html body a.normal:hover,
html body a.normal3:hover,
html body a.normal4:hover {
  color: #1d4ed8;
}

/* the announcement link sits on the artwork column of the login page */
html body a.gonggao {
  font-size: 13px;
  color: #f8fafc;
  letter-spacing: 0;
  line-height: 1.7;
}

html body a.gonggao:hover { color: #ffffff; }

/* module links on the dark navigation band */
html body a.toplink {
  display: inline-block;
  font-size: 13px;
  line-height: 20px;
  color: #e2e8f0;
  letter-spacing: 0;
}

html body a.toplink:hover {
  color: #ffffff;
  text-decoration: none;
}

/* -------------------------------------------------------------------------
   4. Data grids
   Legacy grids are <table border="1" bordercolorlight="#ffffff"
   bordercolordark="#000000"> -- 3D bevelled edges. A flat 1px hairline grid,
   a tinted header row, zebra stripes and a hover highlight is what makes
   these tables read as "modern" rather than 2003.
   ------------------------------------------------------------------------- */
html body table[border="1"] {
  border-collapse: collapse;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

html body table[border="1"] > tbody > tr > td,
html body table[border="1"] > tbody > tr > th,
html body table[border="1"] > tr > td,
html body table[border="1"] > tr > th {
  border: 1px solid #edf1f7;
  padding: 5px 7px;
  vertical-align: middle;
}

/* header row: the first row of a legacy grid is the column caption.
   Only the surface and the weight change -- the text colour is left to the
   cell class, because some first rows are report titles (td.baobiao, red)
   and others are white-on-dark bands (td.td1 + bgcolor), which must keep
   their own colours. Cells carrying a bgcolor are skipped for the same
   reason. No white-space:nowrap: these grids have fixed column widths and
   15+ columns, forcing nowrap would overflow the popup windows. */
html body table[border="1"] > tbody > tr:first-child > td:not([bgcolor]),
html body table[border="1"] > tr:first-child > td:not([bgcolor]) {
  background-color: #f5f8fc;
  font-weight: 600;
}

/* zebra + hover -- skipped for cells that carry their own bgcolor meaning */
html body table[border="1"] > tbody > tr:nth-child(even) > td:not([bgcolor]) {
  background-color: #fafbfd;
}

html body table[border="1"] > tbody > tr:hover > td:not([bgcolor]) {
  background-color: #eff5ff;
}

/* numeric-heavy columns look better with tabular figures */
html body table[border="1"] td {
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
   5. Form controls
   The legacy markup pins borders inline (border-color:000000 -- invalid hex,
   so browsers fall back to the default 3D inset). !important is required to
   win over those inline declarations, and it is deliberately limited to the
   chrome (border / radius / ring / background) so sizing stays intact.
   ------------------------------------------------------------------------- */
html body input[type="text"],
html body input[type="password"],
html body input[type="file"],
html body input[type="number"],
html body input[type="email"],
html body input:not([type]),
html body textarea {
  border: 1px solid #cfd8e3 !important;
  border-radius: 6px !important;
  background-color: #ffffff !important;
  color: #1f2937 !important;
  padding: 3px 8px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html body textarea {
  padding: 6px 8px !important;
  resize: vertical;
}

html body select {
  border: 1px solid #cfd8e3 !important;
  border-radius: 6px !important;
  background-color: #ffffff !important;
  color: #1f2937 !important;
  padding: 3px 6px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  height: auto;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html body input[type="text"]:focus,
html body input[type="password"]:focus,
html body input[type="file"]:focus,
html body input[type="number"]:focus,
html body input:not([type]):focus,
html body textarea:focus,
html body select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14) !important;
  outline: none !important;
}

html body input[type="checkbox"],
html body input[type="radio"] {
  accent-color: #2563eb;
  vertical-align: -2px;
  margin: 0 3px 0 0;
  cursor: pointer;
}

html body input[readonly],
html body input[disabled],
html body select[disabled],
html body textarea[readonly] {
  background-color: #f1f5f9 !important;
  color: #64748b !important;
  cursor: default;
}

/* -------------------------------------------------------------------------
   6. Buttons
   Text buttons get a real button look; image buttons (queding.gif, guanbi.gif
   ...) are left untouched apart from a hover hint.
   ------------------------------------------------------------------------- */
html body input[type="submit"],
html body input[type="button"],
html body input[type="reset"],
html body button {
  background-color: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
  border-radius: 6px;
  padding: 4px 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

html body input[type="submit"]:hover,
html body input[type="button"]:hover,
html body input[type="reset"]:hover,
html body button:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

html body input[type="submit"]:active,
html body input[type="button"]:active,
html body button:active {
  background-color: #1e40af;
  border-color: #1e40af;
}

html body input[type="submit"]:focus-visible,
html body input[type="button"]:focus-visible,
html body button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

html body input[type="image"] {
  border: 0;
  vertical-align: middle;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

html body input[type="image"]:hover,
html body a:hover > img {
  opacity: 0.88;
}

html body img {
  border: 0;
  vertical-align: middle;
}

/* -------------------------------------------------------------------------
   7. Legacy chrome
   The blue navigation band is a 1x35 px gradient slice (images/bg1.jpg) and
   the section divider is a 1x1 px dot (images/light_gray_dot.gif). Swapping
   both for flat CSS removes the "sliced image" look without touching markup.
   ------------------------------------------------------------------------- */
html body td[style*="bg1.jpg"],
html body div[style*="bg1.jpg"] {
  background-image: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  background-repeat: no-repeat !important;
  background-color: #0f172a !important;
}

html body td[style*="light_gray_dot.gif"],
html body td[background*="light_gray_dot.gif"],
html body div[style*="light_gray_dot.gif"] {
  background-image: none !important;
  background-color: #e2e8f0 !important;
}

/* -------------------------------------------------------------------------
   8. In-page modal (index.asp: .black_overlay + .white_content)
   The overlay colour was declared as "000000" -- invalid without the "#",
   so the mask has always been transparent. Restore it as a soft slate
   scrim and turn the 2px orange box into a card.
   ------------------------------------------------------------------------- */
html body .black_overlay {
  background-color: #0f172a !important;
  opacity: 0.42 !important;
  filter: none !important;
}

html body .white_content {
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.45) !important;
  background-color: #ffffff !important;
  font-size: 13px !important;
  color: #1f2937 !important;
}

/* hovering data tip (jd.js tooltip layer) */
html body .tipss {
  border: 1px solid #dbe3ec !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px -14px rgba(15, 23, 42, 0.35) !important;
  background-color: #ffffff !important;
  color: #334155 !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
  padding: 6px 8px !important;
}

/* -------------------------------------------------------------------------
   9. Legacy date picker (dateSelector / rili.asp)
   ------------------------------------------------------------------------- */
html body .date-picker-wp {
  border: 1px solid #dfe6ef !important;
  border-top: 3px solid #2563eb !important;
  border-radius: 0 0 10px 10px !important;
  box-shadow: 0 12px 32px -16px rgba(15, 23, 42, 0.4) !important;
  background: #ffffff !important;
}

html body .date-picker-wp td {
  border-color: #e6ecf3 !important;
  background: #ffffff !important;
  font-size: 12px !important;
  color: #334155 !important;
}

html body .date-picker-wp td a { color: #2563eb !important; }

html body .ds_font td,
html body .ds_font span {
  font-family: inherit !important;
  font-size: 12px !important;
  color: #334155 !important;
}

html body #rili {
  border: 1px solid #dfe6ef !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

html body #rili table { background: transparent; }

html body .ds_border,
html body .ds_border2 {
  background-color: #e8f0fe !important;
  border-radius: 4px;
}

/* -------------------------------------------------------------------------
   10. Small touches
   ------------------------------------------------------------------------- */
html body ::selection {
  background: rgba(37, 99, 235, 0.18);
  color: #0f172a;
}

html body ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html body ::-webkit-scrollbar-track {
  background: #f1f5f9;
}

html body ::-webkit-scrollbar-thumb {
  background: #c7d2e0;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}

html body ::-webkit-scrollbar-thumb:hover {
  background: #a9b7c9;
}

/* -------------------------------------------------------------------------
   11. Application chrome
   Shared header (top.asp) and the login shell (default.asp).
   These classes replace the inline 15pt grey / 10pt blue styling that gave
   the header the "printed form" look.
   ------------------------------------------------------------------------- */
html body .ui-welcome {
  font-size: 13px;
  line-height: 1.65;
  color: #475569;
}

html body .ui-welcome b {
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
}

html body .ui-meta {
  font-size: 13px;
  line-height: 1.65;
  color: #64748b;
}

html body .ui-app-title {
  font-family: inherit;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.5px;
}

html body .ui-app-title .ui-city { color: #dc2626; }

html body .ui-app-sub {
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  color: #64748b;
  letter-spacing: 0;
}

/* login shell (default.asp): the 770px table becomes a card. Only surface +
   radius + shadow are applied -- the internal rows, the logo image and the
   announcement artwork keep their geometry. */
html body .ui-login {
  background-color: #ffffff;
  border: 1px solid #e6ecf3;
  border-radius: 16px;
  box-shadow: 0 18px 44px -26px rgba(15, 23, 42, 0.35);
}

html body .ui-login td { background-color: transparent; }

/* the CITY label on the login shell */
html body .ui-form-label {
  font-size: 12px;
  font-weight: 700;
  color: #b42318;
  letter-spacing: 0.5px;
}

/* -------------------------------------------------------------------------
   12. FIT TO WINDOW
   The application is laid out for a 1000px canvas (770px on the login
   shell), so on a 1440/1920 screen it renders as a small island in the
   middle of the page. Scaling the BODY with zoom enlarges everything
   proportionally -- text, tables, images, spacing -- without re-flowing a
   single cell, which is what "equal-ratio enlargement" means here.

   The steps are deliberately capped: content is 1000px wide, so the zoom
   must stay below (viewport - 60) / 1000 at every step, otherwise the
   widest report starts to scroll horizontally.

   Every step is inside @media screen, so printing and the print preview
   page (print.asp opens in a 1px window) are never scaled.

   Tuning: the numbers below are the only knobs.
   ------------------------------------------------------------------------- */
/* FIT-BEGIN */
@media screen and (min-width: 1150px) { html body { zoom: 1.08; } }
@media screen and (min-width: 1280px) { html body { zoom: 1.18; } }
@media screen and (min-width: 1440px) { html body { zoom: 1.28; } }
@media screen and (min-width: 1600px) { html body { zoom: 1.38; } }
@media screen and (min-width: 1920px) { html body { zoom: 1.50; } }
/* FIT-END */

/* -------------------------------------------------------------------------
   13. Print
   Everything above is screen chrome. On paper keep it plain: white paper,
   full-strength text, hairline borders, no stripe or hover artefacts.
   ------------------------------------------------------------------------- */
@media print {
  html,
  html body {
    background: #ffffff !important;
    font-size: 12px;
  }

  /* the mobile scroller (added by compat.js) must never clip a report on
     paper -- on screen it scrolls, on paper it has to show everything */
  html body .ui-scroll {
    overflow: visible !important;
    max-width: none !important;
    width: auto !important;
  }

  html body table[border="1"] {
    background: #ffffff !important;
  }

  /* drop the screen-only tint; cells with their own bgcolor keep it, so
     status colours still reach the paper */
  html body table[border="1"] > tbody > tr > td:not([bgcolor]),
  html body table[border="1"] > tr > td:not([bgcolor]) {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
  }

  html body table[border="1"] > tbody > tr:first-child > td:not([bgcolor]) {
    background: #f1f5f9 !important;
  }

  html body input,
  html body select,
  html body textarea {
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
  }

  html body input[type="submit"],
  html body input[type="button"],
  html body button {
    background: #ffffff !important;
    color: #1f2937 !important;
    border-color: #cbd5e1 !important;
  }

  html body .black_overlay,
  html body .white_content {
    display: none !important;
  }
}

/* =========================================================================
   14. MOBILE  --  screen width <= 899 px
   -------------------------------------------------------------------------
   The application is a 1000 px fixed-width table layout. An HTML
   width="1000" attribute cannot be outgrown by its own cells, so media
   queries alone cannot re-flow these pages. The block below does three
   things, and nothing else:

     a. FRAME    the outer 2-column shell gets the class .ui-shell from
                 compat.js and collapses to a single column; the 770 px
                 header tables and the 200 px menu box go fluid. Result:
                 the page never scrolls sideways as a whole.
     b. GRIDS    a data grid keeps its natural width instead of being
                 crushed into 40 px columns; compat.js wraps the ones that
                 no longer fit into a .ui-scroll box, so a 15-column report
                 stays readable and scrolls inside its own frame.
     c. CONTROLS 15 px text, taller tap targets, and a 16 px field size on
                 focus (iOS zooms the whole page when a focused field is
                 smaller than that).

   Printing and desktop rendering are untouched: everything is inside
   @media screen and (max-width: 899 px).
   ========================================================================= */
@media screen and (max-width: 899px) {

  /* ------------------------------ 14.1 canvas + type ------------------- */
  html body {
    background: #f2f5f9;
    font-size: 15px;
  }

  /* the legacy cell classes are pinned at 13 px -- too small on a phone */
  html body td.td1,
  html body td.td2,
  html body td.td3,
  html body td.td4,
  html body td.td5,
  html body td.td6,
  html body td.td7,
  html body td.td8,
  html body td.td9,
  html body td.td10,
  html body td.td11,
  html body td.td13,
  html body td.baobiao1,
  html body td.baobiao2,
  html body td.baobiao3,
  html body td.baobiao4,
  html body td.baobiao5,
  html body td.baobiao6,
  html body td.gonggao,
  html body a.normal,
  html body a.normal3,
  html body a.normal4 {
    font-size: 15px;
    line-height: 1.6;
  }

  html body td.baobiao { font-size: 17px; }
  html body h1 { font-size: 19px; }
  html body h2 { font-size: 17px; }
  html body h3 { font-size: 16px; }

  /* ------------------------------ 14.2 frame --------------------------- */
  /* compat.js rebuilds the two pure-layout tables (the 100% page wrapper
     and the 1000 px menu+content shell) as these plain blocks -- see the
     note at the top of this section for why a table cannot be used. */
  html body .ui-frame {
    width: 100% !important;
  }

  html body .ui-cell {
    width: auto !important;
  }

  /* the legacy content boxes are width:100% PLUS a padding, so they stick
     out of the screen by exactly that padding */
  html body .ui-cell > div,
  html body div[style*="width:100%"] {
    box-sizing: border-box;
  }

  /* the module menu is an inline 200 px box; let it use the full width */
  html body .ui-cell > div[style*="width:200"] {
    width: auto !important;
    margin-bottom: 8px;
  }

  /* shared header (top.asp) was laid out for 770 px */
  html body table[width="770"] {
    width: 100% !important;
  }

  /* its 180 / 100 / 100 px columns would leave ~10 px for the greeting */
  html body table[width="770"] > tbody > tr > td,
  html body table[width="770"] > tr > td {
    width: auto !important;
  }

  /* the greeting row: 180 / 100 / 100 px columns would leave about 10 px
     for the greeting. Let the four cells flow like text and wrap instead. */
  html body table[width="770"]:not(.ui-login) > tbody > tr:first-child,
  html body table[width="770"]:not(.ui-login) > tr:first-child {
    display: block;
  }

  html body table[width="770"]:not(.ui-login) > tbody > tr:first-child > td,
  html body table[width="770"]:not(.ui-login) > tr:first-child > td {
    display: inline-block;
    width: auto !important;
    padding-right: 10px;
    vertical-align: middle;
  }

  /* the dark navigation band is indented by 200 px to clear the logo */
  html body td[style*="padding-left:200"],
  html body div[style*="padding-left:200"] {
    padding-left: 8px !important;
  }

  html body td[style*="padding-left:200"] table,
  html body div[style*="padding-left:200"] table {
    width: 100% !important;
  }

  /* ------------------------------ 14.3 data grids ---------------------- */
  /* auto width + nowrap cells = the grid keeps the shape it has on a
     desktop monitor instead of collapsing into vertical letter columns.
     Cells carrying a colspan are left wrapping: they are titles, hints or
     full-width notes, and forcing them onto one line would stretch the
     whole report to several screens. */
  html body table[border="1"] {
    width: auto !important;
    min-width: 100% !important;
  }

  html body table[border="1"] > tbody > tr > td:not([colspan]),
  html body table[border="1"] > tr > td:not([colspan]),
  html body table[border="1"] > tbody > tr > th,
  html body table[border="1"] > tr > th {
    white-space: nowrap;
  }

  html body table[border="1"] > tbody > tr > td,
  html body table[border="1"] > tr > td {
    padding: 7px 9px;
  }

  /* merged cells (report title, total row) are centred across the full
     table width -- i.e. half of them sit off-screen on a phone. Start them
     at the left edge so the title and the totals stay readable. */
  html body table[border="1"] > tbody > tr > td[colspan],
  html body table[border="1"] > tr > td[colspan] {
    text-align: left;
  }

  /* the horizontal scroller compat.js puts around an oversized table */
  html body .ui-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  html body .ui-scroll > table {
    margin: 0 !important;
  }

  /* ------------------------------ 14.4 form tables --------------------- */
  /* A table that is nothing but form controls (no nested layout, 2-8
     columns, more than one row) reads badly at 390 px: the 90 px label
     column wraps "car no." into two lines while the input keeps its pixel
     size. Stacking label above field is what every mobile form does, and it
     needs no width guessing. compat.js adds the class. */
  html body table.ui-form > tbody > tr > td,
  html body table.ui-form > tr > td {
    display: block;
    width: auto !important;
    text-align: left !important;
    padding: 3px 2px !important;
    border: 0 !important;
  }

  html body table.ui-form td:empty {
    display: none !important;
  }

  html body table.ui-form input[type="text"],
  html body table.ui-form input[type="password"],
  html body table.ui-form input[type="number"],
  html body table.ui-form input:not([type]),
  html body table.ui-form select,
  html body table.ui-form textarea {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* ------------------------------ 14.5 controls ------------------------ */
  html body input[type="text"],
  html body input[type="password"],
  html body input[type="file"],
  html body input[type="number"],
  html body input[type="email"],
  html body input:not([type]),
  html body textarea,
  html body select {
    box-sizing: border-box;
    min-height: 34px;
    font-size: 15px !important;
  }

  html body textarea {
    min-height: 72px;
  }

  html body input[type="submit"],
  html body input[type="button"],
  html body input[type="reset"],
  html body button {
    min-height: 36px;
    padding: 6px 18px;
    font-size: 15px;
  }

  /* iOS Safari zooms the page when a field with font-size < 16 px gets
     focus. Raising the size only while focused is enough to stop it and
     does not change the resting layout. */
  html body input:focus,
  html body select:focus,
  html body textarea:focus {
    font-size: 16px !important;
  }

  html body input[type="checkbox"],
  html body input[type="radio"] {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
  }

  /* double-tap zoom is a nuisance on a data-entry screen; it fires by
     accident when an operator taps two rows in quick succession */
  html body a,
  html body input,
  html body select,
  html body button,
  html body label {
    touch-action: manipulation;
  }

  html body a {
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.14);
  }

  /* ------------------------------ 14.6 login shell --------------------- */
  html body .ui-login {
    width: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html body .ui-login > tbody > tr > td,
  html body .ui-login > tr > td {
    display: block;
    width: auto !important;
    height: auto !important;
    padding-left: 0 !important;
  }

  /* the artwork / announcement column becomes a centred banner above the
     form; its artwork is a fixed 195 px graphic, so it is not stretched */
  html body .ui-login > tbody > tr > td[rowspan],
  html body .ui-login > tr > td[rowspan] {
    text-align: center;
    padding: 6px 0 2px !important;
  }

  html body .ui-login > tbody > tr > td[rowspan] img,
  html body .ui-login > tr > td[rowspan] img {
    max-width: 100%;
    height: auto;
  }

  /* the project + password box injected by showname.asp */
  html body #show {
    padding: 4px 2px 0;
  }

  /* the OK / Close buttons are 60x20 gifs; grow the tap area, not the
     artwork */
  html body .ui-login a {
    display: inline-block;
    padding: 4px 2px;
  }

  html body #show table {
    width: 100% !important;
  }

  html body #show table td {
    display: block !important;
    width: auto !important;
    height: auto !important;
    padding: 0 0 10px 0 !important;
  }

  html body #show select,
  html body #show input[type="password"],
  html body #show input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    min-height: 44px;
    margin-top: 4px;
    font-size: 16px !important;
  }

  /* ------------------------------ 14.7 overlays ------------------------ */
  /* index.asp carries position: absolute overlays sized in a 1024 px
     canvas; pin them to the viewport instead */
  html body .black_overlay {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  html body .white_content {
    position: fixed !important;
    left: 6px !important;
    right: 6px !important;
    top: 6px !important;
    width: auto !important;
    height: auto !important;
    max-height: 92vh !important;
    overflow: auto !important;
    border-radius: 12px !important;
  }

  html body .tipss {
    width: auto !important;
    max-width: 92vw !important;
  }

  html body #rili,
  html body .date-picker-wp {
    max-width: 96vw !important;
  }

  /* ------------------------------ 14.8 images -------------------------- */
  html body img {
    max-width: 100%;
  }

  html body hr {
    margin: 10px 0;
  }
}
