:root {
  --green: #17493c;
  --ink: #213d34;
  --muted: #54665d;
  --line: #dce4dd;
  --cream: #f6f5f0;
  --gold: #e9d6a1;
  --serif: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--cream); font: 15px/1.45 system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
:focus-visible { outline: 3px solid #a07124; outline-offset: 3px; }
a { color: inherit; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(2.35rem, 5.5vw, 4.3rem); line-height: 1.03; letter-spacing: -.055em; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.2rem); line-height: 1.13; letter-spacing: -.035em; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--green); color: white; padding: 32px 22px 24px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand strong { font: 32px/1 var(--serif); }
.brand small { display: block; color: #e9d6a1; font-size: 10px; letter-spacing: .1em; margin-top: 6px; }
.monogram { display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid #a2b8ab; border-radius: 12px; color: var(--gold); font: 29px var(--serif); }
.workspace { margin: 38px 0 26px; padding: 14px 13px; border: 1px solid #6a8b7c; border-radius: 12px; background: #205345; }
.workspace span { display: block; color: #e0ebe3; font-size: 12px; margin-top: 3px; }
#steps { display: grid; gap: 7px; }
#steps button { min-height: 47px; padding: 9px 10px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 9px; text-align: left; font-weight: 620; font-size: 13px; display: flex; gap: 9px; align-items: center; }
#steps button[aria-current] { background: #2d6755; border-color: #6d9883; }
#steps button span { color: var(--gold); font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-note { margin-top: auto; color: #d8e7df; font-size: 12px; }
.main { margin-left: 248px; min-width: 0; }
.toolbar { padding: 13px clamp(18px, 4vw, 60px); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #fbfaf6; min-height: 64px; font-size: 13px; }
.toolbar div { display: flex; align-items: center; gap: 9px; }
.breadcrumb { color: var(--muted); }
.quiet { padding: 8px 9px; min-height: 40px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; white-space: nowrap; }
.quiet:hover { background: #e9eee8; }
.badge { border-radius: 99px; color: var(--green); background: #e7eee7; padding: 5px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.content { width: min(100%, 1120px); margin: auto; padding: 37px clamp(18px, 4vw, 60px) 20px; }
.eyebrow { color: #73521b; font-size: 10px; letter-spacing: .14em; font-weight: 750; margin-bottom: 10px; }
.intro p, .stage-head p { color: var(--muted); margin-top: 9px; }
.summary { display: grid; grid-template-columns: .95fr .95fr 1.15fr; gap: 12px; margin: 24px 0 16px; }
.summary > div { padding: 12px 16px; background: #fbfaf6; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.summary span { display: block; color: var(--muted); font-size: 12px; font-weight: 560; }
.summary strong { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(1.2rem, 2.8vw, 1.8rem); margin-top: 2px; }
.summary small { font: 12px system-ui; color: var(--muted); }
.stage { padding: clamp(15px, 3.5vw, 32px); background: white; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 10px 28px #213d340a; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.stage-head p, .end p, .export-note { font-size: 13px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #fff; border: 1px solid #a8b9ae; border-radius: 9px; padding: 8px 13px; min-height: 44px; font-weight: 650; font-size: 13px; text-decoration: none; white-space: nowrap; }
.button:hover:not(:disabled) { background: #eef3ee; }
.button.primary { color: white; background: var(--green); border-color: var(--green); }
.button.primary:hover:not(:disabled) { background: #276453; }
.area-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.area-switch button { display: flex; align-items: center; gap: 8px; min-height: 44px; border: 1px solid var(--line); background: #f7f8f4; border-radius: 9px; padding: 6px 12px; font-weight: 650; }
.area-switch button[aria-pressed="true"] { background: #e8f0e9; border-color: #8ba897; }
.area-switch button span { color: var(--muted); font-size: 11px; }
.count-list { border: 1px solid var(--line); border-radius: 12px; }
.count-row { display: grid; grid-template-columns: minmax(96px, 1fr) 128px 121px 52px; align-items: center; gap: 10px; padding: 8px 12px; min-height: 64px; }
.count-row + .count-row { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.item strong { display: block; font-size: 14px; }
.item small, td small, th small, .file-card small { display: block; color: var(--muted); font-size: 11px; font-weight: 450; }
.initial { display: grid; place-items: center; flex: 0 0 33px; height: 33px; border-radius: 9px; color: var(--green); background: #eaf0e9; font: 18px var(--serif); }
.controls { display: grid; grid-template-columns: 40px 48px 40px; align-items: center; }
.controls button, .controls input, .fills button { border: 1px solid #a8b9ae; min-width: 0; height: 44px; background: white; text-align: center; }
.controls button { font-size: 20px; background: #f0f4ef; }
.controls button:first-child { border-radius: 8px 0 0 8px; }
.controls button:last-child { border-radius: 0 8px 8px 0; }
.controls input { padding: 0 2px; border-inline: 0; font-variant-numeric: tabular-nums; }
.controls input[aria-invalid] { background: #fff3df; }
.fills { display: flex; gap: 5px; }
.fills button { min-width: 36px; border-radius: 7px; }
.fills button[aria-pressed="true"] { background: var(--green); color: white; }
.count-status { grid-column: 4; color: var(--muted); font-size: 11px; text-align: right; }
.counted .count-status { color: var(--green); font-weight: 700; }
.end { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 17px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: right; font-variant-numeric: tabular-nums; }
th:first-child { text-align: left; }
thead { background: #edf2eb; }
tbody tr + tr { border-top: 1px solid var(--line); }
.file-card { display: flex; align-items: center; gap: 13px; background: #f0f5ee; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.file-icon { display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 9px; background: var(--green); color: white; font-weight: 750; }
.export-note { margin-top: 12px; }
footer { padding-top: 20px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 15px; }
footer div { display: flex; gap: 13px; }
.message:not(:empty) { position: fixed; z-index: 2; bottom: 12px; right: 12px; max-width: min(350px, calc(100vw - 24px)); background: var(--green); color: white; padding: 10px 15px; border-radius: 9px; box-shadow: 0 4px 18px #0003; pointer-events: none; }
dialog { color: var(--ink); border: 1px solid var(--line); padding: 22px; border-radius: 14px; width: min(430px, calc(100% - 36px)); }
dialog p, .standalone p { margin: 10px 0 16px; }
dialog::backdrop { background: #102a25a6; }
.standalone { max-width: 700px; margin: 45px auto; padding: 24px; }
@media (max-width: 1060px) {
  .initial { display: none; }
}
@media (max-width: 850px) {
  .sidebar { position: static; width: 100%; padding: 16px 18px 10px; }
  .workspace, .sidebar-note { display: none; }
  #steps { grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
  #steps button { justify-content: center; }
  .main { margin-left: 0; }
  .content { padding-top: 25px; }
}
@media (max-width: 510px) {
  .sidebar { padding: 13px 12px 10px; }
  .brand strong { font-size: 26px; }
  .monogram { width: 38px; height: 38px; font-size: 24px; }
  #steps { gap: 5px; }
  #steps button { flex-direction: column; gap: 2px; text-align: center; padding: 6px 3px; font-size: 11px; }
  .toolbar { min-height: 49px; padding: 4px 12px; }
  .content { padding: 20px 12px 16px; }
  .summary { gap: 6px; margin: 15px 0 11px; }
  .summary > div { padding: 8px; }
  .summary span { font-size: 10px; }
  .summary strong { font-size: 18px; }
  .stage { padding: 13px; }
  .stage-head { gap: 10px; align-items: start; margin-bottom: 13px; }
  .stage-head .button { font-size: 11px; padding-inline: 8px; }
  .stage-head p { font-size: 12px; }
  .count-row { grid-template-columns: minmax(70px, 1fr) 128px; gap: 5px 8px; padding: 8px; }
  .count-row:has(.fills) .fills { grid-column: 2; grid-row: 2; }
  .count-status { grid-column: 1; grid-row: 2; text-align: left; }
  .fills button { flex: 1; height: 40px; }
  th, td { padding-inline: 6px; }
}

.catalog-tools { display: grid; gap: 8px; min-width: 0; margin-bottom: 10px; }
.category-rail { display: flex; gap: 7px; min-width: 0; overflow-x: auto; padding: 4px 4px 9px; margin-inline: -4px; scrollbar-width: thin; scrollbar-color: #8ba897 #edf2eb; }
.category-rail button { flex: 0 0 auto; min-height: 44px; padding: 6px 13px; border-radius: 999px; border: 1px solid #a8b9ae; background: #f7f8f4; font-size: 13px; font-weight: 630; }
.category-rail button[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); }
.catalog-search { position: relative; min-width: 0; width: min(100%, 350px); }
.catalog-search svg { position: absolute; left: 12px; top: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.catalog-search input { width: 100%; min-height: 44px; background: #fff; border: 1px solid #a8b9ae; border-radius: 9px; padding: 8px 12px 8px 38px; }
.filter-result { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.filter-result:empty, .count-row[hidden], .count-list[hidden] { display: none; }
.count-row:nth-child(1 of :not([hidden])) { border-top: 0; }
@media (max-width: 510px) {
  .catalog-search { width: 100%; }
  .catalog-search input { font-size: 16px; }
}
