:root {
  color-scheme: light dark;
  --page: #faf9f6;
  --panel: #fff;
  --aside: #f2f0eb;
  --ink: #24221f;
  --muted: #625e57;
  --line: #dbd7cd;
  --tint: #ebe6df;
  --accent: #a21622;
  --pressed: #86131d;
  --on: #fff;
  --positive: #336743;
  --danger: #a21622;
  --radius: 12px;
  --shade: 0 8px 32px #27221c16;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #171716;
    --panel: #22221f;
    --aside: #1d1d1a;
    --ink: #f5f1e9;
    --muted: #bdb7ab;
    --line: #403d38;
    --tint: #33312e;
    --accent: #e35443;
    --pressed: #ee6959;
    --on: #190e0c;
    --positive: #9ec3a4;
    --danger: #fc8373;
    --shade: 0 8px 32px #0004;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  line-height: 1.45;
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
}
button {
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 9px;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.52;
  cursor: default;
}
button:active:not(:disabled) {
  transform: scale(0.98);
}
input,
select,
textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  min-width: 0;
  max-width: 100%;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 104px;
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.055em;
  font-weight: 620;
}
h2 {
  font-size: 24px;
  letter-spacing: -0.04em;
  line-height: 1.15;
  font-weight: 610;
}
h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
svg {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 20;
  background: var(--panel);
  padding: 12px;
}
.skip:focus {
  top: 12px;
}
#workspace {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100dvh;
}
aside {
  background: var(--aside);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 32px 17px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  letter-spacing: -0.04em;
  font-weight: 650;
  margin: 0 9px 39px;
}
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.brand small { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .16em; vertical-align: middle; margin-left: 4px; }
.overview-intro { color: var(--muted); margin: 10px 0 28px; }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.overview-card { min-height: 136px; background: var(--panel); border: 1px solid var(--line); padding: 20px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shade); }
.overview-card strong { font-size: clamp(30px,4vw,46px); line-height: 1; font-weight: 570; letter-spacing: -.06em; }
.overview-card span { color: var(--muted); font-size: 14px; }
.overview-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 46px; }
.overview-heading { margin-bottom: 16px; }
.production-tabs { display: flex; gap: 6px; margin: 0 0 24px; }
.production-tabs button { padding: 9px 16px; color: var(--muted); background: var(--tint); }
.production-tabs button.tab-active { background: var(--ink); color: var(--page); }
.stage { color: var(--accent); font-size: 12px; white-space: nowrap; }
.static-record { cursor: default; justify-content: space-between; }
.record.rubric-record { grid-template-columns: minmax(0,1fr) auto; }
.record.production-record { grid-template-columns: 58px minmax(0,1fr) auto 20px; }
.stock-connect { max-width: 600px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shade); }
.stock-connect > p { margin: 12px 0 26px; }
.stock-connect-form { display: grid; gap: 15px; }
.stock-connect-form .field { display: grid; gap: 7px; }
.stock-connect-form .primary { justify-self: start; }
.stock-actions { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.stock-record { color: var(--ink); text-decoration: none; }
.stock-record:hover { color: var(--ink); }
#production-editor .sheet-body { display: grid; gap: 14px; }
#production-editor .field { display: grid; gap: 6px; }
#production-editor .field textarea { min-height: 150px; }
@media(max-width: 850px) { .overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 520px) { .overview-card { min-height: 116px; padding: 16px; } .overview-actions > button { width: 100%; justify-content: center; } }
@media(max-width: 800px) { .record.production-record { grid-template-columns: 46px minmax(0,1fr) auto; } .production-record .stage { max-width: 72px; white-space: normal; text-align: right; } }
.mark {
  width: 33px;
  height: 33px;
  display: block;
  background: var(--accent);
  mask: url("/brand/lion-mark.png") center/contain no-repeat;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 24px;
}
#sections {
  display: grid;
  gap: 4px;
}
#sections button,
.sidebar-bottom button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 44px;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 540;
}
#sections button[aria-current="page"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px #18120d0b;
}
#sections button[aria-current="page"] svg {
  color: var(--accent);
}
#main {
  width: min(100%, 1520px);
  margin: 0 auto;
  padding: clamp(27px, 5vw, 74px) clamp(18px, 4vw, 66px) 65px;
}
.titlebar,
.toolbar,
.sheet-actions,
.pager,
.sheet-head,
.sheet-foot,
.row,
.group-head,
.file-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.titlebar {
  justify-content: space-between;
  margin-bottom: 30px;
}
.primary,
.secondary,
.plain,
.icon,
.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 570;
}
.primary {
  background: var(--accent);
  color: var(--on);
}
.secondary,
.icon {
  background: var(--panel);
  border: 1px solid var(--line);
}
.plain,
.inline-link {
  color: var(--accent);
  padding: 7px 10px;
}
.icon {
  width: 42px;
  padding: 0;
  flex: none;
}
.toolbar {
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding-left: 12px;
  flex: 1 1 220px;
  max-width: 520px;
}
.search input {
  background: none;
  border: 0;
  flex: 1;
  min-width: 0;
}
.toolbar select {
  max-width: 100%;
  min-height: 43px;
}
.count,
.meta,
.hint,
.empty,
.muted {
  color: var(--muted);
  font-size: 13px;
}
.count {
  margin: 6px 0 12px;
}
.list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
}
.record {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(95px, auto) 20px;
  gap: 15px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 0;
  min-height: 80px;
}
.record + .record {
  border-top: 1px solid var(--line);
}
.record strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.meta {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.thumb,
.thumb-empty {
  width: 58px;
  height: 56px;
  object-fit: contain;
  background: var(--aside);
  border-radius: 7px;
}
.thumb-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.record-end {
  font-size: 13px;
  text-align: right;
}
.record .row-arrow {
  width: 16px;
  color: var(--muted);
}
.empty {
  padding: 37px 20px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pager {
  justify-content: space-between;
  margin-top: 16px;
}
.pager .row {
  gap: 6px;
}
dialog {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0;
  box-shadow: var(--shade);
}
dialog::backdrop {
  background: rgb(20 17 14/0.43);
}
#editor {
  width: min(680px, 100%);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-radius: 16px 0 0 16px;
}
#edit-form {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.sheet-head,
.sheet-foot {
  justify-content: space-between;
  padding: 18px 25px;
  flex: none;
}
.sheet-head {
  border-bottom: 1px solid var(--line);
}
.sheet-foot {
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.sheet-actions {
  margin-left: auto;
}
.sheet-body {
  padding: 20px 25px 35px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.group {
  margin: 0 0 25px;
  padding: 0;
  border: 0;
}
.group h3,
.group legend {
  font-weight: 640;
  font-size: 16px;
  margin: 2px 0 11px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 560;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font-weight: 400;
  font-size: 15px;
}
.wide {
  grid-column: 1/-1;
}
.hint {
  font-size: 12px;
  font-weight: 400;
}
.form-error {
  font-size: 13px;
  color: var(--danger);
  white-space: pre-line;
}
.form-error:empty {
  display: none;
}
.empty-error {
  color: var(--danger);
}
.preview {
  max-width: 100%;
  max-height: 175px;
  object-fit: contain;
  border-radius: 9px;
  background: var(--aside);
}
.group-head {
  justify-content: space-between;
}
.file-actions {
  flex-wrap: wrap;
}
.file-actions input[type="file"] {
  max-width: 100%;
  width: 100%;
  font-size: 13px;
}
.access {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 26px;
}
.login-card,
.backup-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}
.login-card {
  width: min(100%, 430px);
  box-shadow: var(--shade);
}
.login-card .mark {
  width: 38px;
  height: 38px;
  margin-bottom: 22px;
}
.login-card h1 {
  font-size: 33px;
  margin-bottom: 8px;
}
.login-card form,
.backup-card {
  display: grid;
  gap: 14px;
}
.login-card form {
  margin-top: 22px;
}
.backup-card {
  max-width: 670px;
  margin-bottom: 14px;
}
.backup-card .primary,
.backup-card .secondary {
  justify-self: start;
}
.confirm {
  width: min(390px, calc(100% - 32px));
  border-radius: 15px;
  padding: 22px;
}
.confirm p {
  margin: 12px 0 24px;
  font-size: 14px;
}
.confirm .sheet-actions {
  justify-content: flex-end;
}
#message:not(:empty) {
  position: fixed;
  z-index: 5;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--page);
  box-shadow: var(--shade);
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 14px;
  text-align: center;
  max-width: 90vw;
  pointer-events: none;
}
@media (hover: hover) {
  .record:hover,
  #sections button:hover,
  .secondary:hover,
  .icon:hover {
    background: var(--tint);
  }
  .primary:hover {
    background: var(--pressed);
  }
  .plain:hover,
  .inline-link:hover {
    background: var(--tint);
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background-color 0.14s,
      transform 0.1s,
      color 0.14s;
  }
  #editor[open] {
    animation: enter 0.17s ease-out;
  }
  @keyframes enter {
    from {
      transform: translateX(22px);
      opacity: 0.6;
    }
  }
}
@media (max-width: 800px) {
  #workspace {
    grid-template-columns: 1fr;
    grid-template-rows: max-content minmax(0, 1fr);
  }
  aside {
    position: static;
    height: auto;
    align-self: start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
  }
  .brand {
    margin: 0;
    gap: 8px;
    font-size: 16px;
  }
  .brand .mark {
    width: 27px;
    height: 27px;
  }
  #sections {
    grid-row: 2;
    grid-column: 1/-1;
    display: flex;
    overflow-x: auto;
    gap: 3px;
    align-items: center;
    height: 52px;
  }
  #sections button {
    flex: none;
    min-height: 42px;
    padding: 8px 10px;
    gap: 6px;
    font-size: 13px;
    height: 44px;
  }
  .sidebar-bottom {
    grid-row: 1;
    grid-column: 2;
    margin: 0;
    padding: 0;
  }
  .sidebar-bottom button {
    min-height: 36px;
    padding: 5px 9px;
  }
  .sidebar-bottom svg {
    width: 16px;
  }
  .titlebar {
    margin-bottom: 20px;
  }
  #main {
    padding: 24px 15px 44px;
  }
  .record {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 11px;
    padding: 11px;
  }
  .thumb,
  .thumb-empty {
    width: 46px;
    height: 46px;
  }
  .record .row-arrow {
    display: none;
  }
  .record-end {
    font-size: 12px;
    max-width: 100px;
  }
  .sheet-head,
  .sheet-foot,
  .sheet-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .sheet-foot {
    padding-bottom: max(env(safe-area-inset-bottom), 14px);
  }
  #editor {
    border-radius: 0;
  }
  .titlebar button {
    font-size: 13px;
    padding-inline: 11px;
  }
}
@media (max-width: 500px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    gap: 7px;
  }
  .toolbar .search {
    flex-basis: 100%;
    max-width: none;
  }
  .toolbar select {
    flex: 1;
  }
  .record-end {
    max-width: 86px;
  }
  .sheet-actions button {
    min-height: 44px;
  }
}
.check-field {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  align-self: center;
  min-height: 40px;
}
.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.asset-field {
  display: grid;
  gap: 8px;
}
.asset-field > .secondary {
  justify-self: start;
}
.asset-row {
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}
.asset-row .thumb,
.asset-row .thumb-empty {
  width: 46px;
  height: 46px;
  flex: none;
}
.asset-row .file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.asset-row .icon {
  width: 34px;
  min-height: 36px;
}
.asset-picker {
  padding: 14px;
  background: var(--aside);
  border-radius: 10px;
  display: grid;
  gap: 10px;
}
.asset-picker .group-head h3 {
  margin: 0;
}
.picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 7px;
  max-height: 228px;
  overflow: auto;
}
.picker-option {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}
.picker-option small {
  overflow-wrap: anywhere;
  font-size: 11px;
}
.asset-row .asset-picker {
  flex: 1 0 100%;
  min-width: 0;
}
.asset-row:has(.asset-picker) {
  flex-wrap: wrap;
}
.setup-help {
  margin-top: 9px;
}
.backup-card a.secondary {
  text-decoration: none;
  justify-self: start;
  color: var(--ink);
}
.record.enquiry {
  grid-template-columns: minmax(0, 1fr) auto;
}
.preserve {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sheet-body .field textarea[name="body"] {
  min-height: 230px;
}
.record-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 20px;
  padding: 12px;
  background: var(--aside);
  border-radius: 10px;
}
.record-summary img,
.record-summary .thumb-empty {
  width: 68px;
  height: 68px;
  background: var(--panel);
}
.record-summary strong {
  font-size: 15px;
}
.record-summary .meta {
  overflow-wrap: anywhere;
}
.store-link {
  justify-self: start;
  font-size: 14px;
}
.review-group {
  margin: 26px 0;
}
.review-group h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}
.review-row {
  text-align: left;
}
.review-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.review-tag {
  align-self: center;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.77rem;
  text-align: right;
}
.review-actions,
.selected-review-image {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.selected-review-image:empty {
  display: none;
}
.selected-review-image {
  overflow-wrap: anywhere;
}
.review-link {
  color: var(--accent);
  text-underline-offset: 3px;
  justify-self: start;
}
.alert-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
}
.alert-counts > div {
  display: grid;
  gap: 2px;
}
.alert-counts strong {
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

