:root {
  color-scheme: dark;
  --ink: #fff7fb;
  --paper: #1c151a;
  --paper-soft: #281d24;
  --muted: #d3b9c5;
  --line: rgba(255, 184, 211, .2);
  --pistache: #ff91bd;
  --pistache-deep: #c63f74;
  --night: #09070a;
  --field: #120d11;
  --warning: #ffd0df;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #0e0a0d; color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.topbar { min-height: 82px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 14px clamp(18px, 4vw, 60px); background: var(--night); border-bottom: 1px solid rgba(255, 145, 189, .16); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 9px; width: fit-content; text-decoration: none; letter-spacing: .08em; }
.brand-mark, .brand small { color: #ffd4e2; }
.brand-mark { font-size: 1.55rem; }
.brand strong { font-size: .78rem; }
.brand small { margin-left: 3px; font-size: .66rem; }
.title-block { text-align: center; }
.title-block p, .title-block h1 { margin: 0; }
.title-block p { color: #f2aec5; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.title-block h1 { font: 700 1.62rem/1.05 "Playfair Display", serif; }
.top-links { display: flex; justify-content: flex-end; align-items: center; gap: 13px; font-size: .78rem; }
.top-links a { color: #ffdbe7; }
.session-status { color: #ead5de; }

.page-shell { max-width: 1540px; margin: 0 auto; padding: clamp(20px, 3vw, 44px); }
.access-gate, .intro-card, .panel, .stats-grid article { background: var(--paper); border: 1px solid var(--line); box-shadow: 0 13px 35px rgba(0, 0, 0, .25); }
.access-gate { max-width: 550px; margin: 50px auto; padding: 35px; border-radius: 22px; }
.access-gate h2 { margin: 9px 0; font: 700 2rem/1.05 "Playfair Display", serif; }
.access-gate p, .intro-card p, .projector-copy, .brief-privacy { color: var(--muted); }
.intro-card { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: clamp(24px, 3vw, 36px); border-radius: 24px; }
.intro-card h2, .panel h2 { margin: 4px 0 9px; font-family: "Playfair Display", serif; line-height: 1.04; }
.intro-card h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.intro-card p { max-width: 780px; margin: 0; line-height: 1.6; }
.eyebrow { display: block; color: var(--pistache); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.safety-notice { min-width: 240px; max-width: 310px; padding: 16px 18px; border: 1px solid rgba(255, 226, 238, .2); border-radius: 16px; background: var(--pistache-deep); color: #fff; }
.safety-notice strong, .safety-notice span { display: block; }
.safety-notice span { margin-top: 6px; color: #ffe3ec; font-size: .8rem; line-height: 1.45; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 18px 0; }
.stats-grid article { padding: 17px; border-radius: 16px; }
.stats-grid span { display: block; color: var(--muted); font-size: .78rem; }
.stats-grid strong { display: block; margin-top: 4px; color: #fff; font: 700 2rem/1 "Playfair Display", serif; }
.workbench { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(440px, 1.22fr); gap: 18px; align-items: start; }
.second-row { grid-template-columns: minmax(330px, .9fr) minmax(350px, 1.1fr); margin-top: 18px; }
.panel { padding: clamp(20px, 2.5vw, 30px); border-radius: 22px; }
.panel-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.panel h2 { font-size: 1.55rem; }
.subtle-status, .proposal-badge { display: inline-block; padding: 7px 9px; border: 1px solid rgba(255, 145, 189, .16); border-radius: 999px; background: #37202b; color: #ffd5e4; font-size: .72rem; font-weight: 700; text-align: center; }
.proposal-badge { background: #48202f; color: #ffc1d8; }

label { display: block; color: #ffe3ef; font-size: .8rem; font-weight: 700; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid #583342; border-radius: 10px; background: var(--field); color: var(--ink); font-size: .9rem; font-weight: 400; }
textarea { resize: vertical; line-height: 1.4; }
input:focus, textarea:focus, select:focus { outline: 2px solid #efabc3; outline-offset: 1px; border-color: var(--pistache); }
.search-field { margin-bottom: 13px; }
.search-field span { display: none; }
.catalog-list { display: grid; gap: 9px; max-height: 695px; overflow: auto; padding-right: 4px; }
.catalog-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 11px; align-items: center; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper-soft); color: var(--ink); text-align: left; }
.catalog-item:hover, .catalog-item.is-selected { border-color: var(--pistache); box-shadow: 0 5px 16px rgba(255, 102, 164, .14); }
.catalog-thumb { width: 56px; height: 56px; border-radius: 9px; background: #100c0f center/cover no-repeat; }
.catalog-item strong, .catalog-item span { display: block; }
.catalog-item strong { font-size: .88rem; }
.catalog-item span { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.catalog-item em { color: var(--pistache); font-size: .68rem; font-style: normal; font-weight: 700; }
.empty-state { padding: 16px; border: 1px dashed #704257; border-radius: 13px; color: var(--muted); line-height: 1.55; }
.selected-model { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: #33202b; color: #ffd4e2; font-size: .85rem; font-weight: 700; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-panel form > label, .brief-panel form > label { margin-top: 12px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin-top: 17px; color: var(--pistache); font-size: .8rem; font-weight: 700; }
.primary-button, .secondary-button, .primary-link { display: inline-block; border: 0; border-radius: 10px; padding: 11px 15px; text-decoration: none; font-weight: 700; }
.primary-button, .primary-link { background: var(--pistache-deep); color: #fff; }
.secondary-button { border: 1px solid #75445a; background: #3a2530; color: #ffd2e1; }
.primary-button:hover, .secondary-button:hover, .primary-link:hover { filter: brightness(1.12); }

.proposal-panel { min-height: 380px; }
.proposal-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-soft); }
.proposal-card + .proposal-card { margin-top: 11px; }
.proposal-card h3 { margin: 0 0 6px; font: 700 1.25rem "Playfair Display", serif; }
.proposal-card p { margin: 5px 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.proposal-card a { color: var(--pistache); font-size: .82rem; font-weight: 700; }
.proposal-list { margin: 8px 0 0; padding-left: 19px; color: #f1dbe4; font-size: .84rem; line-height: 1.5; }
.proposal-warning { margin-bottom: 12px; padding: 12px; border: 1px solid rgba(255, 190, 216, .18); border-radius: 11px; background: #402331; color: var(--warning); font-size: .85rem; line-height: 1.45; }
.corrections-panel { margin-top: 18px; }
.correction-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1.25fr; gap: 12px; align-items: start; }
.correction-form .form-actions { grid-column: 1 / -1; margin-top: 0; }

.projector-panel { margin: 18px 0; }
.projector-copy { margin: 0; font-size: .87rem; line-height: 1.55; }
.projector-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(220px, .55fr); gap: 16px; align-items: stretch; margin-top: 16px; }
.projector-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.projector-preview { display: grid; min-height: 255px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #100c0f; place-items: center; position: relative; }
.projector-label { align-self: start; justify-self: stretch; padding: 9px 12px; background: rgba(39, 22, 31, .94); border-bottom: 1px solid var(--line); color: #ffd1e1; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; z-index: 1; }
.projector-preview video { display: block; width: 100%; height: 100%; max-height: 430px; background: #000; object-fit: contain; }
.projector-preview .empty-state { width: calc(100% - 28px); margin: 14px; background: #21181e; text-align: center; }
.projector-actions { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 10px; }
.projector-actions button { width: 100%; }
.projector-feedback { margin: 2px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.projector-result { margin: 16px 0 0; white-space: pre-wrap; }
.brief-privacy { margin-bottom: 13px; padding: 11px 12px; border: 1px solid rgba(255, 145, 189, .14); border-radius: 11px; background: #33202b; color: #ffd4e2; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .title-block { order: 3; grid-column: 1 / -1; }
  .top-links { justify-content: flex-end; }
  .intro-card { align-items: flex-start; flex-direction: column; }
  .safety-notice { max-width: none; width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .workbench, .second-row { grid-template-columns: 1fr; }
  .catalog-list { max-height: 390px; }
  .correction-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .projector-layout { grid-template-columns: 1fr; }
  .projector-previews { grid-template-columns: 1fr; }
  .projector-preview { min-height: 190px; }
}

@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 13px 17px; }
  .top-links { gap: 8px; font-size: .68rem; }
  .page-shell { padding: 18px 14px; }
  .stats-grid, .two-columns, .correction-form { grid-template-columns: 1fr; }
  .panel, .intro-card { border-radius: 17px; }
  .panel { padding: 18px; }
  .topbar .title-block { text-align: left; }
  .session-status { max-width: 155px; text-align: right; }
  .catalog-item { grid-template-columns: 47px 1fr; }
  .catalog-item em { grid-column: 2; }
  .catalog-thumb { width: 47px; height: 47px; }
}
