:root {
  color-scheme: light;
  --paper: #f5f3eb;
  --surface: #fffef8;
  --ink: #161910;
  --muted: #575b4c;
  --line: #dcdcd1;
  --lime: #d5fb43;
  --lime-dark: #c6eb36;
  --danger: #a52b20;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, .upload { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #526300; outline-offset: 3px; }

.topbar { background: var(--ink); color: var(--paper); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1152px;
  min-height: 66px;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 900; line-height: 1; letter-spacing: .07em; }
.brand, .store-link { color: inherit; text-decoration: none; }
.topbar :focus-visible { outline-color: var(--lime); }
.brand-mark { width: 21px; height: 23px; background: var(--lime); clip-path: polygon(21% 0, 53% 0, 42% 37%, 74% 0, 100% 0, 59% 49%, 93% 100%, 57% 100%, 32% 60%, 22% 100%, 0 100%); }
.topbar-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 8px 12px; }
.store-link { font-size: 13px; font-weight: 650; }
.store-link span { margin-left: 4px; color: var(--lime); font-size: 16px; }
.store-link:hover { text-decoration: underline; }
.logout { min-height: 34px; padding: 4px 7px; border: 1px solid #575b4c; border-radius: 6px; color: inherit; background: transparent; font-size: 12px; font-weight: 750; }
.logout:hover:not(:disabled) { border-color: var(--lime); }

.workspace { max-width: 1152px; margin: 0 auto; padding: 32px max(20px, env(safe-area-inset-right, 0px)) max(52px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.page-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 22px; margin: 0 0 24px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.055em; line-height: .98; }
h1 { font-size: clamp(38px, 8vw, 72px); font-weight: 850; }
h2 { font-size: clamp(30px, 5vw, 42px); font-weight: 820; }
.notice { display: flex; align-items: center; gap: 10px; margin: 0 0 19px; padding: 12px 14px; border: 1px solid #dedfbc; border-radius: 8px; background: #f0efd9; color: #424733; font-size: 13px; }
.signal { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #657514; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; background: none; font-size: 14px; font-weight: 780; line-height: 1.15; }
.button-primary { background: var(--lime); border-color: #a1b735; color: var(--ink); box-shadow: 0 2px 0 #7e9026; }
.button-primary:hover:not(:disabled) { background: var(--lime-dark); border-color: #879a29; }
.button-primary:active:not(:disabled) { box-shadow: inset 0 1px 2px #4b5b2b33; }
.button-secondary { background: var(--surface); border-color: #c4c6b5; color: var(--ink); box-shadow: 0 2px 0 #e8e8dc; }
.button-secondary:hover:not(:disabled) { background: var(--paper); border-color: #a0a48f; }
.button-secondary:active:not(:disabled) { box-shadow: inset 0 1px 2px #1619101a; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger:hover:not(:disabled) { background: #8e251c; }
.plus { line-height: .75; font-size: 24px; font-weight: 500; }

.catalog-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0 0 14px; }
.tabs { display: inline-flex; flex-wrap: wrap; justify-self: start; align-items: center; gap: 3px; max-width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #eae9de; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 750; font-size: 13px; }
.tab[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #1619101b; }
.count { min-width: 21px; padding: 2px 4px; border-radius: 4px; background: #e6e7db; text-align: center; font-size: 11px; }
.tab[aria-pressed="true"] .count { background: var(--lime); }
.search { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--surface); }
.search:focus-within { border-color: #79834d; }
.search-icon { position: relative; width: 13px; height: 13px; margin-right: 2px; flex: 0 0 13px; border: 1.5px solid var(--muted); border-radius: 50%; }
.search-icon::after { position: absolute; right: -4px; bottom: -2px; width: 5px; height: 1.5px; transform: rotate(48deg); background: var(--muted); content: ""; }
.search input { width: 100%; min-height: 42px; padding: 0; border: none; outline: none; background: transparent; font-size: 14px; }

.list { display: grid; gap: 8px; }
.record { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main main" "meta actions"; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); }
.record-main { grid-area: main; display: flex; align-items: center; gap: 12px; min-width: 0; }
.record-photo { display: grid; flex: 0 0 57px; place-items: center; width: 57px; height: 57px; overflow: hidden; border-radius: 7px; background: #ebebdf; color: var(--muted); font-size: 18px; font-weight: 750; }
.record-photo img { width: 100%; height: 100%; object-fit: cover; }
.record-title { margin: 0; font-size: 16px; font-weight: 780; line-height: 1.18; overflow-wrap: anywhere; }
.record-detail { margin: 5px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.record-meta { grid-area: meta; display: flex; align-items: start; flex-direction: column; gap: 5px; }
.price { font-weight: 800; font-size: 15px; white-space: nowrap; }
.price-on-request { font-size: 13px; line-height: 1.15; white-space: normal; }
.chip { padding: 3px 6px; border-radius: 5px; background: #edf2cf; color: #414d09; font-size: 10px; font-weight: 750; white-space: nowrap; }
.chip-hidden { background: #efeee7; color: var(--muted); }
.record-actions { grid-area: actions; display: flex; align-items: center; gap: 5px; }
.edit-button, .delete-button { min-height: 38px; padding: 7px 8px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); font-size: 12px; font-weight: 750; }
.edit-button { color: var(--ink); border-color: var(--line); }
.edit-button:hover { background: var(--paper); }
.delete-button:hover:not(:disabled) { color: var(--danger); background: #f8eae4; }
.category-row { grid-template-areas: "main actions"; }
.category-row .record-photo { width: 42px; height: 42px; flex-basis: 42px; background: #edf2cf; color: #56640d; font-size: 15px; }
.record-marker { display: grid; flex: 0 0 42px; min-height: 42px; place-items: center; border-radius: 7px; background: #edf2cf; color: #42510c; font-size: 14px; font-weight: 810; }
.record-main > div { min-width: 0; }
.chip-waiting { color: #674914; background: #f3e8ce; }

.state { margin: 0; padding: 22px 16px; border: 1px dashed #c8caba; border-radius: 10px; color: var(--muted); font-size: 14px; }
#retry { margin-top: 12px; }
.login { max-width: 468px; margin: min(8vh, 65px) auto 0; padding: clamp(20px, 6vw, 34px); border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.login h1 { font-size: clamp(35px, 7vw, 55px); }
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-form .button { justify-self: start; min-width: 115px; }
.empty { text-align: center; padding: 35px 18px; }
.empty strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 17px; }
.empty p { margin: 0; }

.payment-panel { max-width: 560px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.payment-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin-bottom: 17px; }
.payment-heading h2 { letter-spacing: -.045em; }
.payment-form { display: grid; gap: 13px; }
.payment-text { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.payment-actions { display: flex; justify-content: start; }
#retry-payment { margin-top: 12px; }

.editor { width: min(100%, 570px); max-width: 100%; max-height: min(92vh, 850px); max-height: min(92dvh, 850px); padding: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 15px 15px 0 0; margin: auto auto 0; background: var(--surface); color: var(--ink); box-shadow: 0 15px 55px #16191035; }
.editor::backdrop { background: #1619109e; }
body:has(.editor[open]) { overflow: hidden; }
.editor-heading, .editor-fields, .editor-actions { padding-left: 18px; padding-right: 18px; }
.editor-heading { display: flex; justify-content: space-between; gap: 15px; align-items: start; padding-top: 19px; padding-bottom: 17px; }
.editor-heading .eyebrow { margin-bottom: 6px; }
.editor-fields { display: grid; gap: 14px; padding-bottom: 20px; }
.editor-actions { position: sticky; bottom: 0; display: flex; justify-content: end; gap: 8px; padding-top: 13px; padding-bottom: max(13px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.editor-actions .button { min-height: 46px; }
#save-record { min-width: 126px; }
#save-record:not(:disabled)::before { width: 12px; height: 7px; border: solid currentColor; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); content: ""; }
.icon-button { display: grid; place-items: center; padding: 0; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 7px; background: none; color: var(--muted); font-size: 24px; line-height: 1; }
.icon-button:hover { background: var(--paper); }
.product-fields { display: grid; gap: 14px; }
.field, .field-pair { display: grid; gap: 6px; }
.field { min-width: 0; font-size: 13px; font-weight: 730; }
.field-pair { grid-template-columns: 1.25fr 1fr; gap: 12px; }
.field-pair.price-inquiry { grid-template-columns: 1fr; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 43px;
  padding: 9px 10px;
  border: 1px solid #cecec2;
  border-radius: 7px;
  background: #faf9f2;
  font-size: 16px;
  font-weight: 450;
}
.field textarea { min-height: 92px; resize: vertical; }
.field-hint { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.45; }
.schedule-group { display: grid; gap: 6px; }
.schedule-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schedule-fields input { min-width: 0; }
.promotion-picker { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.promotion-picker legend { padding-inline: 3px; font-size: 13px; font-weight: 750; }
.picker-results { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding-inline: 2px; }
.picker-choice { display: flex; align-items: center; gap: 9px; min-height: 39px; padding: 5px; border-top: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.picker-choice input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: #647512; }
.picker-choice span { min-width: 0; overflow-wrap: anywhere; }
.picker-choice small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.picker-empty { margin: 6px 3px; color: var(--muted); font-size: 13px; }
.switch-field { display: flex; align-items: center; gap: 11px; padding: 11px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; }
.switch-field input { width: 19px; height: 19px; margin: 0; accent-color: #647512; }
.switch-field small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.photo-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 7px; font-size: 13px; font-weight: 730; }
.photo-heading small { color: var(--muted); font-size: 11px; font-weight: 500; }
.photo-list { display: flex; flex-wrap: wrap; gap: 7px; }
.photo-list:not(:empty) { margin-bottom: 8px; }
.photo-list figure { position: relative; display: grid; place-items: center; width: 69px; height: 69px; overflow: hidden; margin: 0; border-radius: 7px; background: #ebebdf; }
.photo-list img { width: 100%; height: 100%; object-fit: cover; }
.photo-list button { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; min-width: 31px; min-height: 31px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 20px; line-height: 1; }
.photo-number { position: absolute; bottom: 3px; left: 3px; display: grid; min-width: 20px; min-height: 20px; place-items: center; border-radius: 4px; background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 750; }
.upload { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 12px; overflow: hidden; border: 1px solid #b8c285; border-radius: 10px; color: #374211; background: #f1f4dc; box-shadow: 0 1px 0 #dce1c4; font-weight: 750; font-size: 13px; cursor: pointer; }
.upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload:focus-within { outline: 2px solid #526300; outline-offset: 3px; }
.upload:hover { background: #e8edc8; border-color: #98a257; }
.upload:active { box-shadow: inset 0 1px 2px #414d0929; }
.upload-icon { position: relative; flex: 0 0 16px; width: 16px; height: 16px; }
.upload-icon::before { position: absolute; top: 0; left: 3px; width: 10px; height: 11px; background: currentColor; clip-path: polygon(50% 0, 100% 45%, 86% 59%, 58% 33%, 58% 100%, 42% 100%, 42% 33%, 14% 59%, 0 45%); content: ""; }
.upload-icon::after { position: absolute; right: 1px; bottom: 1px; left: 1px; height: 5px; border: 1.5px solid currentColor; border-width: 0 1.5px 1.5px; border-radius: 0 0 2px 2px; content: ""; }
.photo-angles { display: grid; gap: 8px; min-width: 0; margin: 16px 0 0; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 8px; }
.photo-angles legend { padding-inline: 4px; font-size: 13px; font-weight: 750; }
.photo-angle { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: end; gap: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.angle-preview { position: relative; display: grid; place-items: center; height: 48px; overflow: hidden; border-radius: 6px; background: #ebebdf; color: var(--muted); }
.angle-preview img { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--surface); object-fit: contain; }
.photo-angle select { min-width: 0; min-height: 44px; padding-inline: 7px; }
.angle-upload { gap: 6px; padding-inline: 8px; font-size: 12px; }
.form-error { margin: 0; padding: 9px 11px; border-radius: 7px; color: #84271c; background: #fbe9e0; font-size: 13px; }
.confirm { width: min(100%, 410px); }
.confirm-name { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 1; right: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); padding: 12px 16px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 14px; box-shadow: 0 4px 20px #16191030; }

@media (max-width: 360px) {
  .tab { gap: 5px; padding-inline: 7px; }
  .category-row { grid-template-areas: "main main" ". actions"; }
  .photo-angle { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 6px; }
  .angle-preview { height: 44px; }
  .angle-upload { gap: 4px; padding-inline: 6px; }
}

@media (max-width: 455px) {
  .schedule-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 540px) {
  .mobile-break { display: none; }
  .workspace { padding: 48px max(28px, env(safe-area-inset-right, 0px)) 64px max(28px, env(safe-area-inset-left, 0px)); }
  .topbar-inner { padding-right: max(28px, env(safe-area-inset-right, 0px)); padding-left: max(28px, env(safe-area-inset-left, 0px)); }
  .catalog-bar .search { max-width: 280px; }
  .payment-panel { padding: 23px; }
  .editor { width: min(100% - 34px, 570px); margin: auto; border-radius: 15px; }
  .confirm { width: min(100% - 34px, 410px); }
}

@media (min-width: 760px) {
  .page-heading { margin-bottom: 27px; }
  .catalog-bar { grid-template-columns: auto minmax(0, 280px); align-items: center; justify-content: space-between; }
  .record { grid-template-columns: minmax(0, 1fr) minmax(132px, .32fr) auto; grid-template-areas: "main meta actions"; padding: 13px 16px; }
  .category-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main actions"; }
  .record-photo { width: 64px; height: 64px; flex-basis: 64px; }
  .record-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 7px; }
  .chip { font-size: 11px; }
  .edit-button, .delete-button { padding-left: 11px; padding-right: 11px; }
  .editor-heading, .editor-fields, .editor-actions { padding-left: 23px; padding-right: 23px; }
}
