:root {
  color-scheme: light;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: #182822;
  background: #f4f6f1;
  line-height: 1.55;
  --green: #1b503f;
  --line: #d5ded4;
  --muted: #52645a;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner {
  min-height: 4.5rem;
  max-width: 76rem;
  margin: auto;
  padding: .7rem clamp(1rem, 4vw, 2.4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: inherit;
  font-weight: 800;
  text-decoration: none;
  line-height: 1.15;
}
.brand small { display: block; color: var(--muted); font-size: .72rem; margin-top: .2rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  color: #fff;
  background: var(--green);
  border-radius: .6rem;
  font-size: 1.15rem;
}
.nav-actions { display: flex; align-items: center; gap: .5rem; }

.public-layout, .admin-layout, .login-layout, .draft-layout {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.4rem);
}
.intake-sheet {
  --green: #284f72;
  --line: #d5dce3;
  --muted: #536272;
  max-width: 58rem;
  color: #182532;
  padding-top: 2rem;
}
.intake-heading { padding-bottom: 1rem; }
.intake-heading h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.3; letter-spacing: -.035em; }
.intake-heading p { margin-top: .34rem; color: var(--muted); font-size: .86rem; }
.intake-sheet .public-panel { border-radius: .45rem; padding: clamp(1rem, 4vw, 2rem); }
.intake-sheet .application-form { margin-top: 0; gap: 1.55rem; }
.intake-sheet .intake-step { display: block; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: .9rem 0 0; }
.intake-sheet .intake-step > legend { color: inherit; padding: 0 .7rem 0 0; font-size: 1rem; }
.intake-sheet .intake-step > .two-col { gap: .9rem 1.2rem; align-items: start; }
.intake-sheet .intake-step:last-of-type > * + * { margin-top: .8rem; }
.intake-sheet input:not([type=checkbox], [type=hidden], [type=radio]),
.intake-sheet select, .intake-sheet textarea { border-color: #c6d0da; border-radius: .32rem; }
.intake-sheet :focus-visible { outline-color: #3d6c94; }
.intake-sheet .privacy { background: #f2f5f7; border-radius: .32rem; }
.intake-sheet .submit { min-width: 10rem; justify-self: end; justify-content: center; border-radius: .32rem; }
.intake-sheet .primary:hover { background: #1e3e5a; }
body:has(.intake-sheet) { background: #f1f3f6; min-height: 100vh; }
body:has(.intake-sheet) .topbar { border-bottom-color: #d5dce3; }
body:has(.intake-sheet) .topbar-inner { min-height: 3.2rem; max-width: 58rem; }
body:has(.intake-sheet) .brand-mark { width: 1.75rem; height: 1.75rem; border-radius: .28rem; background: #284f72; font-size: .85rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 1.35rem; }
.public-panel, .login-panel, .draft-panel { padding: clamp(1.1rem, 4vw, 2.4rem); }
.public-panel h2, .queue h2 { font-size: 1.5rem; letter-spacing: -.045em; }
.muted { color: var(--muted); }
.public-panel > .muted, .draft-panel > .muted { margin-top: .3rem; }
.application-form { display: grid; gap: .95rem; margin-top: 1.25rem; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.intake-step { display: grid; gap: .8rem; min-width: 0; margin: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .75rem; }
.intake-step legend { padding: 0 .25rem; color: var(--green); font-weight: 800; }
.intake-wide { grid-column: 1 / -1; }
.mvno-field { margin-top: .7rem; }
.intake-step [hidden] { display: none; }
.offer-terms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin: 0;
  padding: .85rem;
  border-radius: .6rem;
  background: #eaf2e8;
}
.offer-terms dd { overflow-wrap: anywhere; }
.offer-options { min-width: 0; margin: 0; padding: .5rem 0 .25rem; border: 0; }
.offer-options legend { padding: 0; color: inherit; font-size: .9rem; }
.offer-option-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.offer-option {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .65rem;
  border-radius: .55rem;
  border: 1px solid #aab9ae;
  cursor: pointer;
}
.offer-option:has(:checked) { border-color: var(--green); background: #eaf2e8; }
.offer-option input { flex-shrink: 0; width: 1rem; margin: 0; accent-color: var(--green); }
.offer-option small { display: block; color: var(--muted); }
.offer-payment-method { padding: .55rem .7rem; border-radius: .55rem; background: #eaf2e8; }
.offer-payment-method strong { margin-right: .45rem; }
.intake-sheet .offer-summary { border: 1px solid var(--line); border-radius: .34rem; }
.intake-sheet .offer-summary h2 { padding: .48rem .72rem; font-size: .84rem; background: #eef2f6; border-bottom: 1px solid var(--line); }
.intake-sheet .offer-terms { background: #fff; border: 0; margin: 0; padding: .65rem .72rem; }
.intake-sheet .offer-options { padding: 0; }
.intake-sheet .offer-options > legend { margin-bottom: .32rem; font-size: .9rem; }
.intake-sheet .offer-options-priced .offer-option-list { display: grid; }
.intake-sheet .offer-option { border-color: var(--line); border-radius: .32rem; }
.intake-sheet .offer-option:has(:checked) { background: #eaf1f8; border-color: #6488a9; }
.intake-sheet .offer-option small { margin-left: auto; padding-left: .45rem; white-space: nowrap; }
.intake-sheet .offer-payment-method { background: #eef2f6; border-radius: .32rem; }
#attachment-guide { font-size: .84rem; word-break: keep-all; }
label { display: block; font-weight: 650; font-size: .9rem; }
input:not([type=checkbox], [type=hidden], [type=radio]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: .6rem .65rem;
  margin-top: .32rem;
  border-radius: .55rem;
  border: 1px solid #aab9ae;
  color: inherit;
  background: #fff;
  font-size: .95rem;
  font-weight: 400;
}
textarea { resize: vertical; }
:focus-visible { outline: 3px solid #268362; outline-offset: 2px; }
.privacy { padding: .75rem; border-radius: .55rem; background: #f4f6f1; font-size: .87rem; }
summary { cursor: pointer; font-weight: 650; }
.privacy p { margin-top: .6rem; white-space: pre-wrap; color: var(--muted); }
.check { display: flex; align-items: center; gap: .6rem; }
.check input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--green); }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.55rem;
  padding: .45rem .78rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  font-size: .88rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}
.primary { color: #fff; background: var(--green); }
.primary:hover { background: #153d31; }
.secondary { color: var(--green); border-color: var(--line); background: #f7faf4; }
.secondary:hover { background: #e9f1e5; }
.submit { min-height: 3rem; justify-content: space-between; }
.alert { margin: .85rem 0; padding: .7rem; border-radius: .55rem; color: #861f22; background: #fff0ec; }
.confirmation { display: grid; gap: .75rem; margin-bottom: 1.15rem; }
.reference { overflow-wrap: anywhere; }
.login-layout { max-width: 30rem; padding-top: 4rem; }
.draft-layout { max-width: 54rem; }

.admin-layout > h1, .draft-panel h1, .login-panel h1 { font-size: clamp(1.55rem, 5vw, 2.3rem); letter-spacing: -.055em; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .65rem; }
.counts div { padding: .85rem 1rem; }
dt { color: var(--muted); font-size: .82rem; }
dd { margin: 0; font-weight: 650; }
.counts dd { font-size: 1.6rem; }
.queue { margin-top: 1rem; }
.queue-header, .case, .empty { padding: clamp(.9rem, 3vw, 1.45rem); }
.filters { margin-top: .75rem; display: grid; grid-template-columns: minmax(10rem, 20rem) minmax(7rem, 11rem) auto; justify-content: start; gap: .6rem; align-items: end; }
.case { border-top: 1px solid var(--line); }
.case-header { display: flex; align-items: start; justify-content: space-between; gap: .7rem; }
.case-header .muted { font-size: .8rem; overflow-wrap: anywhere; }
.status { color: var(--green); background: #e8f0e7; padding: .18rem .55rem; border-radius: .4rem; font-size: .8rem; white-space: nowrap; }
.case-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.case-fields dd { overflow-wrap: anywhere; }
.case-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.edit-case { flex: 1; display: grid; grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr) auto; align-items: end; gap: .6rem; }
.empty { border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 530px) {
  .intake-step .two-col { grid-template-columns: 1fr; }
  .offer-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters > label:first-child { grid-column: 1 / -1; }
  .edit-case { flex-basis: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edit-case label:nth-last-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .edit-case button { grid-column: 2; grid-row: 1; }
}
.privacy-notice { white-space: pre-line; }

.operator-theme {
  color-scheme: dark;
  color: #eef3fb;
  background: #0d1422;
  --green: #a9c9ff;
  --line: #35445e;
  --muted: #b2bfd4;
}
.operator-theme .topbar { background: #121c2d; }
.operator-theme .brand-mark, .operator-theme .primary {
  color: #111e33;
  background: #a9c9ff;
}
.operator-theme .primary:hover { background: #c6dcff; }
.operator-theme .panel { background: #172337; }
.operator-theme .counts .panel {
  background: #1a2a43;
  border-top: 2px solid #627ba4;
}
.operator-theme .secondary { background: #20324d; border-color: #586c8e; }
.operator-theme .secondary:hover { background: #2a4266; }
.operator-theme .status { background: #263f63; }
.operator-theme :is(input:not([type=checkbox], [type=hidden]), select, textarea) {
  background: #101a2a;
  border-color: #677c9e;
}
.operator-theme :is(input, textarea)::placeholder { color: #a5b4ca; opacity: 1; }
.operator-theme :focus-visible { outline-color: #c4d9ff; }
.operator-theme .alert { color: #ffd3dc; background: #552739; }
.operator-theme .login-panel { box-shadow: 0 1.1rem 2.5rem #060b1470; }

.operator-workspace { max-width: 90rem; }
.operator-workspace .panel { border-radius: .85rem; }
.operator-page-heading, .operator-detail-summary, .operator-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.operator-page-heading { margin-bottom: 1rem; }
.operator-page-heading h1, .operator-detail-summary h1 { font-size: clamp(1.6rem, 4vw, 2.15rem); letter-spacing: -.05em; }
.operator-dashboard { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.operator-sidebar { display: grid; gap: .25rem; padding: .65rem; }
.operator-sidebar h2 { padding: .3rem .55rem .55rem; font-size: .85rem; color: var(--muted); }
.operator-sidebar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .55rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  text-decoration: none;
  color: inherit;
  font-size: .86rem;
}
.operator-sidebar a:hover, .operator-sidebar [aria-current] { background: #263f63; border-color: #5c7ba6; }
.operator-sidebar a span { color: #c8dcff; font-variant-numeric: tabular-nums; }
.operator-queue { min-width: 0; }
.operator-queue-header { padding: .85rem 1rem; }
.operator-queue-header h2, .operator-detail-panel h2 { font-size: 1.08rem; }
.operator-search { display: flex; gap: .45rem; align-items: center; width: min(100%, 24rem); }
.operator-search input { margin-top: 0; }
.operator-search button { flex-shrink: 0; }
.operator-table-scroll { overflow-x: auto; }
.operator-table { border-collapse: collapse; width: 100%; font-size: .86rem; text-align: start; }
.operator-table :is(th, td) { border-top: 1px solid var(--line); padding: .57rem .7rem; vertical-align: top; text-align: start; }
.operator-table thead { background: #1d2c44; color: var(--muted); }
.operator-table small { display: block; font-size: .76rem; font-weight: 400; }
.operator-table tbody tr:hover { background: #1d2c44; }
.operator-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.operator-row-actions, .operator-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.operator-row-actions { flex-wrap: nowrap; }
.operator-row-actions .button, .operator-row-actions button { white-space: nowrap; min-height: 1.95rem; padding: .2rem .55rem; font-size: .8rem; }
.operator-quick-edit { margin-top: .3rem; }
.operator-quick-edit summary { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.operator-quick-edit form { display: grid; gap: .55rem; margin-top: .45rem; min-width: 10rem; }
.operator-detail-summary, .operator-detail-panel { padding: clamp(.85rem, 3vw, 1.3rem); }
.operator-detail-summary .muted, .operator-detail-panel .muted { overflow-wrap: anywhere; }
.operator-detail-summary .muted { font-size: .88rem; }
.operator-detail-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; margin-top: 1rem; }
.operator-detail-stack { display: grid; gap: 1rem; min-width: 0; }
.operator-detail-panel > .muted { margin: .45rem 0 .75rem; }
.operator-detail-panel .nav-actions { flex-wrap: wrap; }
.operator-detail-panel .case-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.operator-detail-panel li { overflow-wrap: anywhere; }
.operator-audit { margin-top: 1rem; }
.offer-form-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.offer-form-list li, .operator-form-scope { display: flex; align-items: center; justify-content: space-between; gap: .55rem; flex-wrap: wrap; }
.offer-form-list li { border-top: 1px solid var(--line); padding: .75rem 0; }
.operator-form-scope { padding: .6rem .8rem; margin-bottom: .8rem; }
.operator-theme .topbar .nav-actions { justify-content: flex-end; flex-wrap: wrap; }
.operator-theme .catalog-notice { margin-top: .75rem; padding: .6rem .75rem; border-radius: .45rem; background: #20324d; color: #d4e5ff; }

@media (max-width: 820px) {
  .operator-dashboard { grid-template-columns: 1fr; gap: .65rem; }
  .operator-sidebar { display: flex; flex-wrap: wrap; align-items: center; }
  .operator-sidebar h2 { flex-basis: 100%; padding-bottom: .1rem; }
  .operator-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 530px) {
  .operator-theme .catalog-fields { grid-template-columns: 1fr; }
}
