/* The SILA template (bg_data_model_SILA/frontend/firepharm-sila/DESIGN.md): one dark masthead with the hexagon relief
   and a copper rule, then paper and hairlines. Forest acts, copper marks place. Light only, like SILA. */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/plex-cyrillic-400.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/plex-cyrillic-600.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/plex-latin-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/plex-latin-600.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --forest-950: #1c2620; --forest-900: #344134; --forest-800: #2f4a3a; --forest-700: #2c5a43; --forest-600: #357052;
  --forest-200: #c5d6cb; --forest-100: #e2ebe5; --forest-50: #f0f5f1;
  --copper-700: #8c4a22; --copper-600: #a3582a; --copper-500: #bf7443; --copper-300: #e0b08c; --copper-100: #f6e8dc;
  --ground: #f2f4f2; --surface: #fdfefd; --ink: #16201a; --ink-2: #37443d; --muted: #5b6961; --faint: #6b776f;
  --rule: #d5ddd8; --rule-soft: #e7ece9;
  --slate: #2f4b68; --slate-bg: #e3eaf2; --danger: #9b2c22; --danger-bg: #fbeceb; --warn: #7d5310; --warn-bg: #fbf1dc;
  --popover: 0 8px 24px -8px rgba(28, 38, 32, .25);
  --dialog: 0 24px 48px -16px rgba(28, 38, 32, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 15px/1.45 'IBM Plex Sans', system-ui, sans-serif; font-feature-settings: 'locl';
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--copper-300); }
:focus-visible { outline: 2px solid var(--copper-600); outline-offset: 2px; }
.hidden { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
h1, h2 { text-wrap: balance; }

/* masthead: the one dark band */
.masthead {
  background-color: var(--forest-900); color: #fff; border-bottom: 1px solid rgba(191, 116, 67, .7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16.2v32.3L28 64.7 0 48.5V16.2zM28 64.7v32.3' fill='none' stroke='%23ffffff' stroke-opacity='0.045' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 56px 97px; background-position: right -8px top -30px;
}
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { border-radius: 9px; flex: none; }
.wordmark { font-size: 19px; font-weight: 600; letter-spacing: .06em; line-height: 1.1; }
.wordmark .copper { color: var(--copper-300); }
.tagline { font-size: 13px; color: var(--forest-200); }
.lang {
  font: 600 12.5px/1 inherit; font-family: inherit; letter-spacing: .06em; color: #fff; background: transparent;
  border: 1px solid rgba(197, 214, 203, .5); border-radius: 6px; height: 30px; padding: 0 10px; cursor: pointer;
}
.lang:hover { background: rgba(255, 255, 255, .08); }

/* the campaign's own band, in its visual guide's colours (teal #1e8089, yellow #fcba3e) and its yellow characters;
   no campaign or UMC logo (PLAN §1) */
.campaign { background: #1e8089; color: #fff; }
.campaign-row { display: flex; align-items: flex-end; gap: 16px; padding-top: 14px; }
.campaign-text { flex: 1; min-width: 0; padding-bottom: 14px; }
.msw-tag { font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.msw-tag span { font-weight: 400; color: #fcba3e; margin-left: 6px; }
.msw-slogan { margin: 4px 0 2px; font-size: 19px; line-height: 1.3; }
.msw-slogan em { font-style: italic; }
.msw-how { margin: 0 0 4px; font-size: 14px; color: rgba(255, 255, 255, .88); max-width: 62ch; }
.campaign a { color: #fcba3e; font-weight: 600; font-size: 14px; }
.msw-char { flex: none; height: 120px; width: auto; display: block; }
@media (max-width: 639px) { .msw-char { height: 84px; } .msw-round { display: none; } .msw-slogan { font-size: 17px; } }
a { color: var(--forest-700); text-underline-offset: 2px; }

.intro { padding: 28px 0 16px; max-width: 62ch; }
.intro h1 { font-size: 24px; font-weight: 600; line-height: 1.25; margin: 0 0 6px; }
.intro p { margin: 0; color: var(--ink-2); }

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
.picker { padding: 16px 20px 18px; }
.field-label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }

input[type=search], textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 6px; padding: 0 12px; caret-color: var(--copper-600);
}
input[type=search] { height: 44px; }
textarea { padding: 8px 12px; resize: vertical; font-size: 15px; }
input[type=search]:hover, textarea:hover { border-color: var(--forest-200); }
input[type=search]:focus, textarea:focus { outline: none; border-color: var(--forest-600); box-shadow: 0 0 0 3px rgba(53, 112, 82, .15); }
input::placeholder, textarea::placeholder { color: var(--faint); }

.combo { position: relative; }
.suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--popover);
  max-height: min(60vh, 420px); overflow-y: auto;
}
.suggest li { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.suggest li[aria-selected=true], .suggest li:hover { background: var(--forest-50); }
.suggest li[aria-disabled=true] { cursor: default; color: var(--muted); }
.suggest li[aria-disabled=true]:hover { background: transparent; }
.s-name { font-weight: 600; }
.s-sub { display: block; font-size: 13px; color: var(--muted); }
.s-tag { flex: none; font-size: 12px; color: var(--muted); }
.suggest .s-empty { color: var(--muted); cursor: default; }

.chosen-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.chosen { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.chosen li {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 34px; padding: 0 4px 0 12px;
  background: var(--forest-50); border: 1px solid var(--forest-200); border-radius: 6px; font-size: 14px;
}
.chosen li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chosen li button {
  border: 0; background: transparent; width: 28px; height: 28px; border-radius: 4px; cursor: pointer;
  color: var(--muted); font-size: 18px; line-height: 1;
}
.chosen li button:hover { background: var(--forest-100); color: var(--ink); }
.count { font-size: 12.5px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn-primary, .btn-quiet {
  font: inherit; font-size: 14px; font-weight: 600; height: 40px; padding: 0 16px; border-radius: 6px; cursor: pointer;
}
.btn-primary { color: var(--surface); background: var(--forest-700); border: 1px solid var(--forest-700); }
.btn-primary:hover { background: var(--forest-800); }
.btn-primary:disabled { opacity: .45; cursor: default; }
.btn-quiet { color: var(--forest-700); background: transparent; border: 1px solid transparent; padding: 0 10px; }
.btn-quiet:hover { background: var(--forest-50); }

/* results: the list, and the card for the selected pair beside it (below it on a phone) */
.results { margin-top: 20px; }
.results-grid { display: grid; gap: 20px; }
@media (min-width: 960px) {
  .results-grid { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
  .card { position: sticky; top: 16px; }
}
.summary { padding: 14px 20px; border-bottom: 1px solid var(--rule-soft); font-weight: 600; }
.pairs { list-style: none; margin: 0; padding: 0; }
.pair { border-bottom: 1px solid var(--rule-soft); }
.pair button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px;
  width: 100%; padding: 12px 20px; cursor: pointer;
}
.pair button:hover { background: rgba(240, 245, 241, .7); }
.pair button:focus-visible { outline: 2px solid var(--copper-600); outline-offset: -2px; }
.pair.selected button { background: rgba(226, 235, 229, .7); }
.pair-names { font-weight: 600; }
/* the list is for scanning: three lines at most, the whole text is in the card */
.pair-claim { grid-column: 2; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.extra { padding: 4px 20px 8px; font-size: 14px; color: var(--ink-2); }
.extra h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
.extra ul { margin: 0; padding-left: 18px; }
.list-foot { padding: 8px 12px 10px; border-top: 1px solid var(--rule-soft); }

/* levels: a pale wash with a deep same-hue text (the Tone Pair Rule) */
.lvl { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; align-self: start; margin-top: 2px; }
.lvl-Contraindicated { color: var(--danger); background: var(--danger-bg); }
.lvl-Major { color: var(--copper-700); background: var(--copper-100); }
.lvl-Moderate { color: var(--warn); background: var(--warn-bg); }
.lvl-Minor { color: var(--slate); background: var(--slate-bg); }
.lvl-Ungraded { color: var(--ink-2); background: var(--rule-soft); }

.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0 2px; max-width: 220px; }
.meter i { height: 8px; border-radius: 2px; background: var(--rule-soft); }
.meter i.on:nth-child(1) { background: var(--forest-600); }
.meter i.on:nth-child(2) { background: #b8892a; }
.meter i.on:nth-child(3) { background: var(--copper-600); }
.meter i.on:nth-child(4) { background: var(--danger); }

.card { padding: 18px 20px 16px; }
.card h2 { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0; }
.card .finding { border-top: 1px solid var(--rule-soft); margin-top: 14px; padding-top: 12px; }
.card .subs { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.card .claim { margin: 0 0 8px; max-width: 62ch; }
.card .detail { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); white-space: pre-line; max-width: 62ch; }
.card .rec { margin: 0; font-size: 14px; }
.card .rec b { font-weight: 600; }
.card .notext { color: var(--muted); font-style: italic; margin: 0; }
.card .card-foot { margin-top: 14px; border-top: 1px solid var(--rule-soft); padding-top: 8px; }
.card-empty { color: var(--muted); font-size: 14px; }

.advice {
  margin: 24px 0 0; padding: 12px 16px; border-left: 3px solid var(--copper-500); background: var(--surface);
  border-radius: 0 6px 6px 0; max-width: 72ch;
}
.footer { padding-top: 20px; padding-bottom: 40px; font-size: 12.5px; color: var(--muted); }
.footer p { margin: 0 0 6px; max-width: 90ch; }

.dialog {
  border: 1px solid var(--rule); border-radius: 6px; padding: 20px; width: min(480px, calc(100vw - 32px));
  box-shadow: var(--dialog); color: var(--ink); background: var(--surface);
}
.dialog::backdrop { background: rgba(28, 38, 32, .5); }
.dialog h2 { font-size: 16px; margin: 0 0 4px; }
.report-pair { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.dialog fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.radio { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; cursor: pointer; }
.radio input { accent-color: var(--forest-700); width: 16px; height: 16px; margin: 0; }
.report-msg { min-height: 1.2em; margin: 8px 0 0; font-size: 14px; color: var(--forest-700); }
.report-msg.err { color: var(--danger); }
