/* ===========================================================================
   DCPR CALCULATOR — interface styling.

   Design language is taken from krishnaprojects.com so the tool and the site read as
   one practice: the same beige ground, brass accent, dark-brown ink and chakra mark.

   This is a TOOL, not a document, so it is built to be operated rather than read:
   summary before detail, state encoded in shape and colour as well as number, and
   verdicts legible at a glance across a table.

   SEMANTIC COLOUR IS SEPARATE FROM THE BRAND ACCENT. Brass is identity; green/amber/red
   mean GO / CAUTION / NO-GO and are never used decoratively. A verdict must never be
   mistakable for styling.

   NOTE: this file contains no calculation constants. Every number shown comes from the
   API; the front-end formats but never computes. Guard-enforced.
   =========================================================================== */

/* Palette and faces read off the LIVE krishnaprojects.com with getComputedStyle, not
   matched by eye:
     body      Inter            rgb(247,243,234) ground, rgb(62,58,51) text
     display   Playfair Display 600, rgb(59,46,34)
     brass     #8C6D3E          (from the site's own chakra fill)
   The tool and the site therefore share one identity rather than resembling each other. */
:root {
  --paper:      #F7F3EA;
  --paper-2:    #FCFAF5;
  --band:       #E4D3AC;
  --band-soft:  #EFE3C6;
  --ink:        #3B2E22;
  --ink-2:      #4A453D;
  --ink-3:      #6B5B48;
  --line:       #DCCEB0;
  --line-soft:  #EAE0CB;
  --brass:      #8C6D3E;
  --brass-dk:   #6F5630;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body:    Inter, ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* semantic — verdicts only */
  --go:         #2F6B45;
  --go-bg:      #E6F0E8;
  --caution:    #9A6B12;
  --caution-bg: #FBF0DA;
  --nogo:       #9B3226;
  --nogo-bg:    #F8E7E4;
  --blocked:    #4A4A4A;
  --blocked-bg: #ECEAE6;

  --r: 4px;
  --shadow: 0 1px 2px rgba(59,46,34,.06), 0 4px 16px rgba(59,46,34,.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink-2);
  font: 400 15px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; line-height: 1.2; color: var(--ink); }

/* Playfair is the DISPLAY face only -- the wordmark and verdict words. Using it for
   labels or table text would hurt legibility in a tool that is scanned, not read. */
.wordmark, .verdict .word, .fig .n { font-family: var(--font-display); }

a { color: var(--brass-dk); }

/* ---------------------------------------------------------------- masthead */
.top {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.top-in {
  max-width: min(2100px, 96vw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.mark { width: 30px; height: 30px; flex: none; color: var(--brass); }
.wordmark { font-size: 1.16rem; font-weight: 600; letter-spacing: -.005em; color: var(--ink); }
.wordmark span {
  display: block; font-family: var(--font-body); font-size: .58rem; font-weight: 500;
  letter-spacing: .17em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px;
}
.spacer { flex: 1 1 auto; }

/* mode switch — the primary navigation */
.modes { display: flex; gap: 2px; background: var(--band-soft); padding: 3px; border-radius: var(--r); }
.modes button {
  font: inherit; font-size: .84rem; font-weight: 500;
  border: 0; background: transparent; color: var(--ink-2);
  padding: 7px 15px; border-radius: 3px; cursor: pointer; white-space: nowrap;
}
.modes button:hover { color: var(--ink); }
.modes button[aria-selected="true"] {
  background: var(--paper-2); color: var(--ink); box-shadow: var(--shadow); font-weight: 600;
}

/* ---------------------------------------------------------------- layout */
/* Wide by design: this is a data tool on desktop monitors, not a reading column. The cap
   keeps line-length sane on ultrawide; 96vw uses the screen on everything smaller. */
main { max-width: min(2100px, 96vw); margin: 0 auto; padding: 22px 20px 80px; }

.banner {
  border: 1px solid var(--brass); background: #FBF3E2; color: var(--ink);
  padding: 9px 13px; border-radius: var(--r); font-size: .8rem;
  letter-spacing: .05em; text-transform: uppercase; font-weight: 600;
  margin-bottom: 18px;
}

.split { display: grid; grid-template-columns: minmax(0,340px) minmax(0,1fr); gap: 22px; align-items: start; }
@media (max-width: 940px) { .split { grid-template-columns: 1fr; } }

.card {
  background: var(--paper-2); border: 1px solid var(--line-soft);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.card > h2 {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.card-body { padding: 16px; }

/* ---------------------------------------------------------------- forms */
.field { margin-bottom: 13px; }
.field > label {
  display: block; font-size: .74rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 5px;
}
.hint { font-size: .74rem; color: var(--ink-2); margin-top: 4px; line-height: 1.45; }

input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; font: inherit; font-size: .93rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 10px;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brass); outline-offset: -1px; border-color: var(--brass);
}
input[aria-invalid="true"] { border-color: var(--nogo); background: #FFF8F7; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }

fieldset { border: 0; margin: 0 0 13px; }
fieldset > legend {
  font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 7px;
}
.checks { display: grid; gap: 6px; }
.check {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: .87rem; color: var(--ink); cursor: pointer;
  padding: 6px 8px; border-radius: 3px; border: 1px solid transparent;
}
.check:hover { background: #fff; border-color: var(--line-soft); }
.check input { margin-top: 2px; accent-color: var(--brass); flex: none; }

button.go {
  width: 100%; font: inherit; font-weight: 600; font-size: .88rem;
  letter-spacing: .04em; color: #fff; background: var(--brass);
  border: 0; border-radius: var(--r); padding: 11px 16px; cursor: pointer;
}
button.go:hover { background: var(--brass-dk); }
button.go:disabled { background: #C9BCA2; cursor: not-allowed; }
/* secondary action (e.g. Generate reports): brass outline, not filled */
button.go.secondary { color: var(--brass-dk); background: transparent;
  border: 1px solid var(--brass); }
button.go.secondary:hover { background: var(--paper-2); color: var(--brass-dk); }
button.go.secondary:disabled { color: #B7A98C; border-color: var(--line); background: transparent; }

button.ghost {
  font: inherit; font-size: .82rem; font-weight: 500; color: var(--ink-2);
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--r); padding: 8px 13px; cursor: pointer;
}
button.ghost:hover { border-color: var(--brass); color: var(--brass-dk); }

/* ---------------------------------------------------------------- verdict */
.verdict {
  border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px;
  border: 1px solid; display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap;
}
.verdict .word { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.verdict .sub { font-size: .88rem; opacity: .9; }
.v-go      { background: var(--go-bg);      border-color: #BFD6C6; color: var(--go); }
.v-caution { background: var(--caution-bg); border-color: #E6D3A6; color: var(--caution); }
.v-nogo    { background: var(--nogo-bg);    border-color: #E4C0BA; color: var(--nogo); }
.v-blocked { background: var(--blocked-bg); border-color: #D2CEC7; color: var(--blocked); }

/* ---------------------------------------------------------------- numbers */
.figs { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 1px;
        background: var(--line-soft); border: 1px solid var(--line-soft);
        border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.fig { background: var(--paper-2); padding: 13px 15px; }
.fig b {
  display: block; font-size: .68rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 5px;
}
.fig .n { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fig .u { font-size: .78rem; color: var(--ink-2); margin-left: 3px; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  text-align: left; font-size: .68rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-2);
  border-bottom: 2px solid var(--line); padding: 0 10px 8px 0;
}
td { border-bottom: 1px solid var(--line-soft); padding: 9px 10px 9px 0; vertical-align: top; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover td { background: #fff; }
/* the reference row in a comparison table (e.g. "their inputs" vs the benchmark) */
tbody tr.strong-row td { background: var(--paper-2); }
/* section-header rows in the Archonet-style reports */
tbody tr.sec td { background: var(--paper-2); border-bottom: 1px solid var(--line);
  padding-top: 12px; font-size: .82rem; }
.tw { overflow-x: auto; }

.pill {
  display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; padding: 3px 7px; border-radius: 2px; white-space: nowrap;
}
.p-locked { background: #E8EFE9; color: var(--go); }
.p-est    { background: var(--blocked-bg); color: var(--blocked); }
.p-go      { background: var(--go-bg); color: var(--go); }
.p-caution { background: var(--caution-bg); color: var(--caution); }
.p-nogo    { background: var(--nogo-bg); color: var(--nogo); }

/* ---------------------------------------------------------------- notes */
.note {
  border-left: 3px solid var(--brass); background: #FBF3E2;
  padding: 11px 13px; border-radius: 0 var(--r) var(--r) 0;
  font-size: .85rem; margin-bottom: 12px; line-height: 1.5;
}
.note.bad   { border-left-color: var(--nogo);  background: var(--nogo-bg); }
.note.warn  { border-left-color: var(--caution); background: var(--caution-bg); }
.note b { display: block; margin-bottom: 4px; font-size: .72rem; letter-spacing: .09em;
          text-transform: uppercase; }
.note ul { margin: 6px 0 0 18px; }
.note li { margin-bottom: 3px; }

.stamp {
  font-size: .74rem; color: var(--ink-2); line-height: 1.5;
  border-top: 1px solid var(--line-soft); padding-top: 11px; margin-top: 16px;
}

.empty {
  text-align: center; color: var(--ink-2); padding: 56px 20px; font-size: .9rem;
}
.empty .mark { width: 44px; height: 44px; margin: 0 auto 14px; opacity: .35; }

.busy { display: inline-block; width: 13px; height: 13px; border: 2px solid #fff;
        border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite;
        vertical-align: -2px; margin-right: 7px; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy { animation: none; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* paste-and-extract */
.paste { border: 1px solid var(--line); border-radius: var(--r); background: #FDFBF7;
         margin-bottom: 16px; }
.paste > summary { cursor: pointer; padding: 10px 13px; font-size: .78rem; font-weight: 600;
                   letter-spacing: .07em; text-transform: uppercase; color: var(--brass-dk); }
.paste > summary::marker { color: var(--brass); }
.paste-body { padding: 0 13px 13px; }
.paste-body button.ghost { margin-top: 8px; }

/* a machine-filled input is visibly different from one typed by hand -- the reviewer
   should always know which is which before screening */
input.filled { background: #FBF3E2; border-color: var(--brass); }

.req { font-size: .64rem; letter-spacing: .09em; text-transform: uppercase;
       color: var(--nogo); margin-left: 5px; }
.aw { color: var(--ink-3); font-size: .8rem; }
td.quote { color: var(--ink-3); font-size: .82rem; font-style: italic; max-width: 320px; }

/* ---------------------------------------------------------------- report pop-up
   The detailed scheme report opens over the page, full width, like Archonet's dedicated
   report view — so all its columns show at once instead of scrolling inside a side column. */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(59,46,34,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 3vw; overflow-y: auto;
}
.modal {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 12px 44px rgba(59,46,34,.28); width: min(1440px, 94vw); margin: auto;
}
.modal-head {
  position: sticky; top: 0; z-index: 1; background: var(--paper-2);
  border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
}
.modal-head h2 { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -.01em;
  text-transform: none; color: var(--ink); }
.modal-close {
  font-size: 1.5rem; line-height: 1; background: transparent; border: 0; cursor: pointer;
  color: var(--ink-2); padding: 2px 9px; border-radius: 3px; flex: none;
}
.modal-close:hover { background: var(--band-soft); color: var(--ink); }
.modal-body { padding: 18px; }
.modal-body > .card, .modal-body > .figs, .modal-body > .note { margin-bottom: 14px; }
.modal-body > :last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: no-preference) {
  .modal { animation: modal-in .16s ease-out; }
  @keyframes modal-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* login — narrow and centred; nothing else on screen to distract from it */
.login { max-width: 380px; margin: 8vh auto 0; }
.login .card > h2 { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -.01em;
                    text-transform: none; color: var(--ink); padding: 16px 18px 12px; }
