/* ===========================================================================
   InvestVerdict — one colour means "you type here"
   ---------------------------------------------------------------------------
   Across seven screens this suite asks a person to type in perhaps forty
   places: assumptions on the forecast, market price and share count on the
   ratios screen, discount rates on the DCF, the linked rows on Notes to
   Accounts, and any figure on the statements themselves. Until now each of
   those looked like whatever its own screen happened to style it as, and
   several looked like nothing at all — xl.css deliberately makes a cell input
   invisible until it is hovered, which is right for a statement where every
   cell is already full and you occasionally correct one, and wrong everywhere
   a box is EMPTY and filling it is the task.

   The result was a suite where you could not tell, at a glance, which cells
   were waiting for you. So one convention now runs through all of it:

     A WARM CREAM FILL WITH A GOLD-BROWN EDGE MEANS: YOU CAN TYPE HERE.
     A DASHED GOLD EDGE MEANS: THIS IS EMPTY AND SOMETHING IS EXPECTED.
     GOLD, THICKER, MEANS: YOU ARE TYPING IN IT NOW.

   Nothing else on these screens uses that fill, so it never has to compete.
   Statement figures stay on white, computed rows stay green, forecast columns
   stay in their own tint — the cream is reserved, and reserved things are the
   ones people learn.

   Loaded AFTER xl.css on every screen, so the equal-specificity rules here win
   on source order without an !important war.
   =========================================================================== */

:root{
  --iv-edit:        #fffdf4;   /* fill: this accepts typing            */
  --iv-edit-line:   #d8c48f;   /* edge at rest                          */
  --iv-edit-hover:  #fff8e0;
  --iv-edit-focus:  #c9982a;   /* edge while you are in it              */
  --iv-edit-ring:   rgba(201,152,42,.22);
  --iv-need:        #b8860b;   /* empty, and something is expected      */
}

/* ── every box a person may type into ──────────────────────────────────── */
input[type="text"], input[type="number"], input[type="search"],
input:not([type]), textarea, select,
table.xl td input, table.xl td select,
.asm-in, .asm-sel {
  background: var(--iv-edit);
  border: 1px solid var(--iv-edit-line);
  border-radius: 6px;
  color: #1d1d1d;
  font: inherit;
}
input[type="text"]:hover, input[type="number"]:hover, input[type="search"]:hover,
input:not([type]):hover, textarea:hover, select:hover,
table.xl td input:hover, table.xl td select:hover,
.asm-in:hover, .asm-sel:hover {
  background: var(--iv-edit-hover);
  border-color: var(--iv-edit-focus);
}
input[type="text"]:focus, input[type="number"]:focus, input[type="search"]:focus,
input:not([type]):focus, textarea:focus, select:focus,
table.xl td input:focus, table.xl td select:focus,
.asm-in:focus, .asm-sel:focus {
  outline: none;
  background: #fff;
  border-color: var(--iv-edit-focus);
  box-shadow: 0 0 0 3px var(--iv-edit-ring);
}

/* Colour pickers, checkboxes and radios are controls, not fields — the fill
   would only make them muddy. */
input[type="color"], input[type="checkbox"], input[type="radio"],
input[type="file"], input[type="range"] {
  background: none; border: 0; box-shadow: none;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--iv-edit-focus); }

/* ── empty, and something is expected ──────────────────────────────────── */
input:placeholder-shown:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
textarea:placeholder-shown {
  border-style: dashed;
  border-color: var(--iv-need);
}
input::placeholder, textarea::placeholder { color: #a89b78; opacity: 1; }

/* A field the screen is actively waiting on. Screens already add .needs /
   .need-val to say so; this gives that state one look everywhere. */
.needs, .need-val, [data-needs="1"] {
  border-color: var(--iv-need) !important;
  box-shadow: 0 0 0 3px rgba(184,134,11,.16) !important;
}

/* ── a statement cell you may type over ────────────────────────────────────
   The analysis sheet is select-then-edit, like Excel, so a cell carries no
   permanent input. It still has to look touchable: a hover tint and a real
   cursor, and a clear ring once selected. Without this the sheet reads as a
   printout. */
table.xl td.num, table.xl td.val { cursor: cell; }
table.xl td.num:hover, table.xl td.val:hover {
  background: var(--iv-edit) !important;
  box-shadow: inset 0 0 0 1px var(--iv-edit-line);
}
table.xl td.sel, table.xl td.selected, table.xl td[aria-selected="true"] {
  background: #fff !important;
  box-shadow: inset 0 0 0 2px var(--iv-edit-focus);
}
/* A blank cell in a statement is a hole, and a hole is where typing is most
   likely to be needed. */
table.xl td.blank:not(.lbl) {
  background: repeating-linear-gradient(135deg,
    var(--iv-edit) 0 6px, #fff9e6 6px 12px) !important;
}

/* ── the key, so the colour is taught once rather than guessed ─────────── */
.iv-editkey{
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 12px; color: #6d675a; margin: 12px 0 0;
}
.iv-editkey b{ color: #20272f; font-weight: 600; }
.iv-editkey .sw{
  display: inline-block; width: 15px; height: 15px; border-radius: 4px;
  background: var(--iv-edit); border: 1px solid var(--iv-edit-line);
  vertical-align: -3px; margin-right: 5px;
}
.iv-editkey .sw.need{ border-style: dashed; border-color: var(--iv-need); }

@media (prefers-color-scheme: dark){
  /* These screens are printed on cream by design — a statement is a document.
     The tokens are restated rather than inverted so the cream stays cream on a
     dark desktop, and nothing here borrows the host's ground. */
  :root{
    --iv-edit:#fffdf4; --iv-edit-line:#d8c48f; --iv-edit-hover:#fff8e0;
    --iv-edit-focus:#c9982a; --iv-edit-ring:rgba(201,152,42,.22); --iv-need:#b8860b;
  }
}
