:root {
  --background: #100e0c;
  --surface: rgba(31, 27, 23, 0.9);
  --surface-strong: #27211c;
  --surface-soft: rgba(255, 255, 255, 0.038);
  --surface-hover: rgba(220, 167, 88, 0.075);
  --border: rgba(237, 211, 169, 0.14);
  --border-strong: rgba(220, 167, 88, 0.42);
  --text: #f4eee5;
  --muted: #aaa095;
  --muted-dark: #81786f;
  --accent: #dca758;
  --accent-hover: #e7b66c;
  --accent-soft: rgba(220, 167, 88, 0.13);
  --green: #82b48b;
  --green-soft: rgba(130, 180, 139, 0.12);
  --red: #dc8277;
  --red-soft: rgba(220, 130, 119, 0.11);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
  color: var(--text);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% -10%, rgba(153, 91, 35, 0.22), transparent 35%),
    radial-gradient(circle at 90% 20%, rgba(92, 64, 35, 0.14), transparent 32%),
    var(--background);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  pointer-events: none;
  filter: blur(115px);
  opacity: 0.16;
}
.ambient-one { top: 28%; left: -210px; background: #b66c31; }
.ambient-two { right: -210px; bottom: 3%; background: #70512f; }

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #20160b;
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
button:hover { transform: translateY(-1px); background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: wait; transform: none; }
.button-link { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 9px 13px; border: 1px solid transparent; border-radius: 9px; color: #20160b; background: var(--accent); font-size: 0.76rem; font-weight: 750; text-decoration: none; }
.button-link:hover { background: var(--accent-hover); }
.quiet-link { border-color: var(--border); color: var(--muted); background: var(--surface-soft); }
.quiet-link:hover { color: var(--text); border-color: var(--border-strong); background: var(--accent-soft); }

.quiet {
  min-height: 36px;
  padding: 8px 11px;
  border-color: var(--border);
  color: var(--muted);
  background: var(--surface-soft);
}
.quiet:hover { color: var(--text); border-color: var(--border-strong); background: var(--accent-soft); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 17px 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 14, 12, 0.84);
  backdrop-filter: blur(18px);
}
.topbar nav { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.topbar #user-name { margin: 0 5px 0 10px; color: var(--muted); font-size: 0.8rem; }
.brand { display: grid; gap: 1px; color: var(--text); text-decoration: none; }
.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.brand span { margin: 0; }

.shell { width: min(1500px, calc(100% - 60px)); margin: 0 auto; padding: 34px 0 80px; }
.hidden { display: none !important; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -0.025em; }
h1 { margin: 3px 0 0; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; }
h2 { margin: 3px 0 12px; font-size: clamp(1.55rem, 3vw, 2.25rem); }
h3 { margin: 2px 0; font-size: 1.25rem; }
.eyebrow {
  display: block;
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.muted, small { color: var(--muted); font-size: 0.87rem; line-height: 1.5; }
.error { color: var(--red); min-height: 1.4em; }

.panel,
.track-card,
.job-card,
.generation-form fieldset {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.panel { padding: 20px; }

.login-page { display: grid; place-items: center; padding: 24px; }
.login-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(120deg, rgba(220, 167, 88, 0.035), transparent 50%);
}
.login-card {
  width: min(470px, 100%);
  padding: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(28, 24, 21, 0.95);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
}
.login-card::before { display: block; width: 34px; height: 2px; margin-bottom: 22px; background: var(--accent); content: ""; }
.login-card h1 { margin-top: 6px; font-size: 2.8rem; }
.login-card > .muted { margin: 12px 0 0; }
.login-card form { display: grid; gap: 18px; margin-top: 30px; }

label { display: grid; gap: 10px; color: #d7cec3; font-size: 0.79rem; font-weight: 700; }
.field-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.info-tip {
  position: relative;
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1;
  cursor: help;
}
.info-tip::after {
  position: absolute;
  right: -1px;
  bottom: calc(100% + 10px);
  z-index: 60;
  width: min(330px, calc(100vw - 48px));
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: #e8dfd4;
  background: #2a231d;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  content: attr(data-tip);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}
.info-tip:hover::after, .info-tip:focus::after { opacity: 1; transform: translateY(0); }
.info-tip:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale-hint { display: flex; justify-content: space-between; gap: 12px; color: var(--muted-dark); font-size: 0.7rem; font-weight: 550; }
input, textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: rgba(9, 8, 7, 0.37);
  font-size: 0.86rem;
  line-height: 1.45;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input:hover, textarea:hover, select:hover { border-color: rgba(237, 211, 169, 0.25); }
input:focus, textarea:focus, select:focus { border-color: var(--border-strong); background: rgba(9, 8, 7, 0.52); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: #746b63; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%); background-position: calc(100% - 17px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px); background-repeat: no-repeat; background-size: 5px 5px, 5px 5px; padding-right: 32px; }
textarea { resize: vertical; }
input[type="file"] { padding: 8px; color: var(--muted); }
input[type="file"]::file-selector-button { margin-right: 11px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; color: var(--text); background: var(--surface-soft); cursor: pointer; }

.generation-form { display: grid; gap: 15px; }
.generation-form fieldset { min-width: 0; margin: 0; padding: 22px; }
.generation-form fieldset > label + label { margin-top: 22px; }
.generation-form fieldset > label + .grid { margin-top: 22px; }
.generation-form fieldset > .grid + label { margin-top: 4px; }
legend { padding: 0 8px; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
legend::before { display: inline-block; width: 14px; height: 2px; margin: 0 9px 4px 0; background: var(--accent); content: ""; }
legend span { color: var(--muted); font-family: Inter, sans-serif; font-size: 0.75rem; }
.grid { display: grid; gap: 20px 14px; margin: 0 0 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.checkbox { display: flex; align-items: center; align-self: end; gap: 9px; min-height: 42px; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.planning-selector { display: grid; gap: 11px; margin: 4px 0 22px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: rgba(0, 0, 0, 0.12); }
.planning-selector > .field-title { max-width: 620px; color: #d7cec3; font-size: 0.79rem; font-weight: 700; }
.segmented-radio { display: inline-grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(520px, 100%); padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: rgba(9, 8, 7, 0.4); }
.segmented-radio label { display: block; cursor: pointer; }
.segmented-radio input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented-radio span { display: grid; min-height: 38px; place-items: center; padding: 8px 12px; border-radius: 7px; color: var(--muted); font-size: 0.78rem; transition: color 140ms ease, background 140ms ease; }
.segmented-radio input:checked + span { color: #20160b; background: var(--accent); }
.segmented-radio input:focus-visible + span { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.planning-estimate { margin: -2px 0 20px; padding: 11px 13px; border-left: 2px solid var(--accent); color: var(--muted); background: var(--surface-soft); font-size: 0.78rem; line-height: 1.55; }
.reference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.reference-card { display: grid; gap: 11px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: rgba(0, 0, 0, 0.11); }
.reference-card h3 { color: var(--accent); font-size: 1.05rem; }
.submit-row { position: sticky; bottom: 14px; z-index: 8; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 13px; background: rgba(24, 20, 17, 0.94); box-shadow: 0 20px 55px rgba(0, 0, 0, 0.42); backdrop-filter: blur(18px); }
.submit-row p { margin-right: auto; }

.job-list { display: grid; gap: 9px; }
.job-list > h2 { margin: 30px 0 4px; }
.job-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 17px 20px; cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.job-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: linear-gradient(90deg, var(--surface-hover), var(--surface)); }
.job-card p { margin: 4px 0; }
.job-card h3 { font-size: 1.2rem; }
.status { display: inline-block; padding: 5px 9px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); background: var(--surface-soft); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.status.completed, .status.scored { color: var(--green); border-color: rgba(130, 180, 139, 0.36); background: var(--green-soft); }
.status.failed { color: var(--red); border-color: rgba(220, 130, 119, 0.35); background: var(--red-soft); }
.status.running, .status.queued, .status.generating, .status.analyzing { color: var(--accent); border-color: var(--border-strong); background: var(--accent-soft); }

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 15px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.detail-header h1 { margin-top: 5px; font-size: clamp(2rem, 4vw, 3.35rem); }
.detail-header > div:first-child > p:last-child { max-width: 820px; color: var(--muted); line-height: 1.55; }
.technical-id { margin: 10px 0 0; color: var(--muted-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.7rem; overflow-wrap: anywhere; }
.download-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.progress-box { min-width: 275px; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.progress-box p { margin: 7px 0 0; color: var(--muted); font-size: 0.78rem; }
.cost-details { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border); }
.cost-details > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; color: #d9d0c5; list-style: none; }
.cost-details > summary::-webkit-details-marker { display: none; }
.cost-details > summary::before { color: var(--accent); content: "+"; font-weight: 800; }
.cost-details[open] > summary::before { content: "−"; }
.cost-details > summary span { margin-right: auto; }
.cost-details > summary strong { color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 500; }
.cost-details-body { min-width: 390px; margin-top: 11px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: rgba(0, 0, 0, 0.14); }
.cost-total-row, .cost-operation-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.cost-total-row { color: #ddd4ca; font-size: 0.78rem; }
.cost-total-row strong { color: var(--accent); }
.cost-operation-list { display: grid; gap: 5px; margin: 8px 0 12px; padding: 9px 0 10px; border-bottom: 1px solid var(--border); }
.cost-operation-list > div { color: var(--muted); font-size: 0.73rem; }
.cost-operation-list strong { color: #cfc6bc; font-weight: 600; }
.cost-operation-list p { margin: 3px 0 0; padding-left: 10px; border-left: 1px solid var(--border); font-size: 0.7rem; line-height: 1.55; }
.cost-warning { padding: 8px 9px; border-left: 2px solid var(--red); color: #dca198 !important; background: var(--red-soft); }
.cost-caveat { color: var(--muted-dark) !important; font-size: 0.7rem !important; line-height: 1.5; }
#detail-content > .panel { margin-top: 14px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin-bottom: 5px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.input-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.input-group-grid article { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: rgba(0, 0, 0, 0.1); }
.input-group-grid h3 { margin-bottom: 9px; color: #ddd4ca; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 0.78rem; font-weight: 750; letter-spacing: 0; }
.input-json { max-height: 300px; margin: 0; padding: 11px; overflow: auto; border-radius: 8px; color: #c5bcb2; background: rgba(7, 6, 5, 0.36); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.input-inspector > details { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--border); }
.input-inspector > details > .input-json { margin-top: 10px; max-height: 440px; }
.image-strip { display: grid; grid-template-columns: repeat(7, minmax(100px, 1fr)); gap: 9px; margin: 12px 0 0; }
.input-image { min-height: 0; aspect-ratio: 1.45; padding: 0; overflow: hidden; border-color: var(--border); border-radius: 11px; background: var(--surface-strong); cursor: zoom-in; }
.input-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
.input-image:hover img { transform: scale(1.045); }

.track-list { display: grid; gap: 14px; margin-top: 14px; }
.track-card { padding: 20px; overflow: hidden; }
.track-card > .track-heading { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.track-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.track-heading h2 { margin: 3px 0 0; font-size: 1.9rem; }
.rationale { margin: 15px 0; padding: 13px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.rationale strong { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.rationale p { margin: 7px 0 0; color: #c9c0b5; font-size: 0.82rem; line-height: 1.55; }
details { margin-top: 12px; }
summary { color: var(--muted); font-size: 0.8rem; cursor: pointer; }
summary:hover { color: var(--text); }
.prompt { padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; color: #d6cec4; background: var(--surface-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.76rem; line-height: 1.65; white-space: pre-wrap; }

.variant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.variant { padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: rgba(0, 0, 0, 0.12); transition: transform 180ms ease, border-color 180ms ease; }
.variant:hover { transform: translateY(-2px); border-color: rgba(237, 211, 169, 0.24); }
.variant.selected { border-color: rgba(130, 180, 139, 0.45); box-shadow: inset 0 0 0 1px rgba(130, 180, 139, 0.15); }
.variant-title-line { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.automatic-selection { display: inline-block; padding: 4px 7px; border-radius: 99px; color: #102315; background: var(--green); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 0.63rem; font-weight: 850; letter-spacing: 0.08em; line-height: 1.25; text-transform: uppercase; }
.variant .track-heading h3 { font-size: 1.2rem; }
.variant-score-group { display: flex; align-items: center; flex: 0 0 auto; gap: 7px; }
.variant-score { color: var(--accent); font-family: Georgia, serif; font-size: 1.05rem; }
.score-info-button { display: inline-grid; width: 25px; height: 25px; min-height: 25px; place-items: center; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--accent); background: var(--accent-soft); font-family: Georgia, "Times New Roman", serif; font-size: 0.82rem; font-style: italic; line-height: 1; }
.score-info-button:hover, .score-info-button[aria-expanded="true"] { color: #24170a; border-color: var(--accent); background: var(--accent); }
.score-info-button:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.score-details { margin: 10px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(0, 0, 0, 0.12); }
.score-details-body { padding: 13px; }
.score-panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.score-panel-heading strong { color: #e2d9ce; font-size: 0.88rem; }
.score-panel-heading span { color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: 1rem; }
.score-intro { margin: 0 0 13px; color: #c9c0b5; font-size: 0.82rem; line-height: 1.5; }
.score-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.score-component { padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.score-component-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.score-component-heading strong { color: #ded5ca; font-size: 0.82rem; }
.score-component-heading span { flex: 0 0 auto; color: var(--accent); font-size: 0.8rem; font-weight: 750; }
.score-component p { margin: 7px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.score-meter { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.07); }
.score-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--green)); }
.score-evidence { margin-top: 13px; padding: 11px 12px; border-left: 2px solid var(--accent); background: var(--surface-soft); }
.score-evidence strong { color: #ddd3c8; font-size: 0.82rem; }
.score-evidence ul { margin: 8px 0 0; padding-left: 18px; }
.score-evidence li { margin-top: 5px; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.score-caveat { margin: 12px 0 0; color: var(--muted-dark); font-size: 0.76rem; line-height: 1.5; }
.processing-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 11px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: rgba(0, 0, 0, 0.16); }
.processing-toggle button { color: var(--muted); background: transparent; }
.processing-toggle button.active { color: #24170a; background: var(--accent); }
audio { display: block; width: 100%; height: 36px; margin: 10px 0 5px; }
.metric-row { display: grid; grid-template-columns: 1fr 82px; align-items: center; gap: 10px; margin: 7px 0; }
.metric-row label { color: var(--muted); font-size: 0.75rem; }
.metric-row select { padding-block: 7px; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0; }
.flag { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); background: var(--surface-soft); font-size: 0.7rem; font-weight: 600; cursor: pointer; }
.flag input { width: 13px; height: 13px; margin: 0; accent-color: var(--red); }
.flag:has(input:checked) { color: #2d110e; border-color: var(--red); background: var(--red); }
.variant > label { margin-top: 18px; }
.variant > label + label { margin-top: 24px; }
.review-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 11px; }
.compact { min-height: 34px; padding: 7px 10px; font-size: 0.72rem; }
.save-state { min-width: 65px; color: var(--green); font-size: 0.7rem; }
.pair-review { margin-top: 14px; padding: 14px; box-shadow: none; background: var(--surface-soft); }
.experience-review { margin-top: 15px; padding: 22px; }
.review-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin: 15px 0; }

dialog { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 18px; color: var(--text); background: #171411; box-shadow: 0 34px 120px rgba(0, 0, 0, 0.75); }
dialog::backdrop { background: rgba(6, 5, 4, 0.84); backdrop-filter: blur(9px); }
.dialog-close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; min-height: 38px; padding: 0; border-color: var(--border); border-radius: 50%; color: var(--text); background: rgba(16, 13, 11, 0.78); font-size: 1.35rem; }
.dialog-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr); min-height: 70vh; }
.dialog-layout img { width: 100%; height: 100%; max-height: calc(100vh - 34px); object-fit: contain; border-right: 1px solid var(--border); background: #0b0908; }
.dialog-layout > div { max-height: calc(100vh - 34px); padding: 24px; overflow: auto; }
.analysis-text { padding: 12px; border: 1px solid var(--border); border-radius: 10px; color: #c8bfb5; background: rgba(0, 0, 0, 0.14); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.76rem; line-height: 1.55; white-space: pre-wrap; }
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: 420px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text); background: #27211c; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: 180ms ease; }
#toast.show { opacity: 1; }

@media (max-width: 1100px) {
  .grid.four, .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-strip { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
}

@media (max-width: 820px) {
  .topbar { position: relative; align-items: flex-start; padding: 18px; }
  .shell { width: min(100% - 28px, 1500px); padding-top: 22px; }
  .reference-grid, .variant-grid, .dialog-layout { grid-template-columns: 1fr; }
  .dialog-layout { overflow: auto; }
  .dialog-layout img { min-height: 300px; max-height: 50vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .detail-header { display: grid; }
  .progress-box { min-width: 0; }
  .cost-details-body { min-width: 0; }
  .input-group-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  :root { font-size: 15px; }
  .topbar { display: grid; }
  .topbar nav { justify-content: flex-start; }
  .grid.two, .grid.four, .review-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .job-card { grid-template-columns: 1fr; }
  .image-strip { display: flex; overflow-x: auto; }
  .input-image { min-width: 180px; }
  .track-heading { align-items: flex-start; }
  .variant-heading { align-items: center; }
  .score-breakdown { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
  .submit-row { position: relative; bottom: auto; flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
