:root {
  color-scheme: light;
  --paper: #f6f7f4;
  --white: #fff;
  --ink: #1d2926;
  --muted: #78837e;
  --line: #e5eae5;
  --green: #27694f;
  --green-dark: #1b503c;
  --green-soft: #e5f2ea;
  --orange: #e5a566;
  --shadow: 0 8px 32px rgba(25, 42, 34, .055);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
input, textarea { color: var(--ink); }
input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid #88bba3; outline-offset: 2px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.05em; white-space: nowrap; }
.brand-mark { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; background: var(--green); color: white; font-size: 22px; line-height: 1; font-weight: 400; transform: rotate(-5deg); }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .17em; margin: 0 0 13px; }
.button { appearance: none; border: 1px solid transparent; min-height: 44px; padding: 0 18px; border-radius: 11px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; transition: transform .15s, background .15s, border-color .15s; white-space: nowrap; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green); box-shadow: 0 4px 10px rgba(39, 105, 79, .18); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-secondary { color: var(--ink); background: var(--white); border-color: var(--line); }
.button-secondary:hover:not(:disabled) { border-color: #b9c9bf; background: #fafcf9; }
.button-small { min-height: 37px; font-size: 12px; padding: 0 13px; }
.button-wide { width: 100%; justify-content: space-between; padding: 0 20px; height: 48px; }
.plus-icon { font-size: 22px; font-weight: 400; line-height: 1; margin-right: 2px; }
.quiet-button { border: 0; background: transparent; color: #5f7066; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 650; }
.quiet-button:hover { color: var(--green); background: #eff4ef; }
.quiet-button svg { width: 17px; height: 17px; }
.text-button { background: none; border: 0; color: var(--green); font-weight: 750; font-size: 13px; padding: 6px 0; }
.text-button:hover { text-decoration: underline; }

.topbar { height: 72px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); }
.topbar-inner { height: 100%; max-width: 1240px; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.main-content { max-width: 1240px; margin: auto; padding: 52px 32px 110px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 30px; margin-bottom: 40px; }
.page-heading h1 { margin: 0; font-size: clamp(38px, 4vw, 52px); line-height: 1.04; letter-spacing: -.065em; font-weight: 800; }
.heading-dot { color: var(--orange); }
.page-subtitle { color: var(--muted); margin: 12px 0 0; font-size: 14px; }
.new-button { height: 45px; margin-top: 20px; }
.catalog-toolbar { display: flex; gap: 24px; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.search-box { width: min(420px, 45%); height: 44px; display: flex; align-items: center; gap: 11px; padding: 0 13px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 17px; }
.search-box:focus-within { border-color: #89b29d; box-shadow: 0 0 0 3px rgba(39, 105, 79, .09); }
.search-box svg { color: #87948a; width: 18px; height: 18px; flex: none; }
.search-box input { border: 0; outline: 0; min-width: 0; flex: 1; background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #9ba69e; }
.search-hint { font-size: 10px; color: #a1aba4; border: 1px solid #eef0ec; padding: 3px 5px; border-radius: 4px; white-space: nowrap; }
.tabs { display: flex; align-self: stretch; align-items: end; gap: 25px; }
.tab { display: flex; align-items: center; gap: 8px; border: 0; border-bottom: 2px solid transparent; padding: 0 1px 18px; background: transparent; color: #859089; font-size: 13px; font-weight: 750; }
.tab.active { color: var(--green); border-color: var(--green); }
.tab-count { min-width: 20px; height: 20px; padding: 1px 5px; display: grid; place-items: center; border-radius: 6px; color: #7f8a83; background: #e9ede8; font-size: 10px; }
.tab.active .tab-count { background: var(--green-soft); color: var(--green); }
.catalog-status { min-height: 20px; color: #89958c; font-size: 12px; margin-bottom: 14px; }
.item-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.item-card { text-align: left; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow); color: inherit; width: 100%; display: flex; flex-direction: column; transition: transform .16s, box-shadow .16s, border-color .16s; }
.item-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(25, 42, 34, .105); border-color: #d4e0d6; }
.item-image { height: 180px; width: 100%; position: relative; background: #e9ede8; overflow: hidden; }
.item-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 80% 20%, #f3e7d7, transparent 45%), linear-gradient(145deg, #e8eee8, #f4f5ec); }
.item-placeholder svg { width: 50px; height: 50px; color: #a6b7a9; stroke-width: 1.3; }
.item-card-body { padding: 16px 16px 17px; display: flex; flex: 1; flex-direction: column; }
.item-topline { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.item-title { margin: 0; font-size: 15px; font-weight: 750; line-height: 1.35; letter-spacing: -.025em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.quantity-badge { flex: none; background: #ecf4ed; color: var(--green); border-radius: 7px; padding: 5px 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.quantity-badge.unknown { background: #f1f2ef; color: #869189; }
.item-description { color: #89938c; font-size: 12px; line-height: 1.5; margin: 8px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item-card-bottom { margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-end; }
.price-stack { display: flex; flex-direction: column; gap: 2px; }
.item-price { font-size: 16px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.item-price-muted { font-size: 12px; font-weight: 650; color: #8b958f; }
.item-price-old { font-size: 11px; color: #98a19a; text-decoration: line-through; }
.swatches { display: flex; align-items: center; justify-content: flex-end; padding-left: 6px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px #d4dcd5; margin-left: -5px; }
.swatch-more { color: #8b968c; font-size: 10px; margin-left: 3px; white-space: nowrap; }
.archive-ribbon { position: absolute; top: 11px; left: 11px; padding: 5px 8px; border-radius: 6px; background: rgba(27, 41, 34, .75); color: white; font-size: 10px; font-weight: 750; }
.load-more-wrap { display: flex; justify-content: center; margin-top: 30px; }
.empty-state { text-align: center; padding: 66px 20px; background: white; border: 1px dashed #d9e1d9; border-radius: 16px; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 18px; background: var(--green-soft); color: var(--green); border-radius: 18px; font-size: 36px; line-height: 1; }
.empty-state h2 { margin: 0 0 7px; font-size: 19px; letter-spacing: -.03em; }
.empty-state p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.mobile-fab { display: none; }

.editor-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(860px, calc(100dvh - 32px)); border: 0; padding: 0; border-radius: 18px; background: var(--white); color: var(--ink); box-shadow: 0 30px 90px rgba(14, 30, 22, .25); }
.editor-dialog::backdrop { background: rgba(14, 30, 22, .46); backdrop-filter: blur(3px); }
.editor-dialog form { display: flex; flex-direction: column; max-height: inherit; }
.editor-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 26px 32px 19px; border-bottom: 1px solid var(--line); }
.editor-header .eyebrow { margin-bottom: 6px; }
.editor-header h2 { margin: 0; font-size: 26px; letter-spacing: -.055em; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: #f2f5f1; color: #53635a; font-size: 25px; font-weight: 300; line-height: 1; }
.icon-button:hover { background: #e9efea; }
.editor-body { overflow-y: auto; padding: 0 32px 18px; }
.form-section { padding: 24px 0 25px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
.section-heading h3 { font-size: 15px; margin: 0; letter-spacing: -.025em; }
.section-heading span { color: #929c94; font-size: 11px; }
.photo-list { display: flex; gap: 11px; overflow-x: auto; padding: 1px 2px 7px; min-height: 111px; }
.photo-tile, .photo-empty { width: 105px; height: 105px; flex: none; border: 1px solid #dce4dc; border-radius: 11px; overflow: hidden; position: relative; background: #f5f7f3; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-primary-label { position: absolute; left: 5px; bottom: 5px; border-radius: 5px; background: var(--green); color: white; font-size: 9px; font-weight: 800; padding: 3px 5px; }
.photo-remove { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(21, 37, 26, .76); color: white; font-size: 16px; line-height: 1; }
.photo-main-button { position: absolute; bottom: 5px; left: 5px; border: 0; border-radius: 5px; background: rgba(255,255,255,.94); color: var(--green); font-size: 9px; font-weight: 800; padding: 4px 5px; }
.photo-empty { display: grid; place-items: center; color: #a8b8aa; border-style: dashed; }
.photo-empty svg { width: 31px; height: 31px; stroke-width: 1.3; }
.photo-actions { display: flex; gap: 8px; margin-top: 12px; }
.field-help { margin: 9px 0 0; font-size: 11px; color: #9aa59c; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 12px; font-weight: 750; }
.field input, .field textarea { width: 100%; border: 1px solid #dfe6de; background: #fbfcfa; border-radius: 9px; padding: 10px 12px; outline: none; font-size: 13px; line-height: 1.4; }
.field input { min-height: 42px; }
.field input:focus, .field textarea:focus { border-color: #7cad92; box-shadow: 0 0 0 3px rgba(39, 105, 79, .09); }
.field input::placeholder, .field textarea::placeholder { color: #a4afa5; }
.field textarea { resize: vertical; min-height: 96px; }
.required { color: #c27055; }
.unit { color: #87948b; font-weight: 500; }
.form-grid { display: grid; gap: 13px; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.color-list { display: flex; flex-direction: column; gap: 9px; }
.color-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 105px 28px; align-items: center; gap: 9px; }
.color-picker { width: 46px; height: 43px; padding: 4px; border: 1px solid #dce4dc; border-radius: 9px; background: #fbfcfa; cursor: pointer; }
.color-row input[type="text"], .color-row input[type="number"] { width: 100%; min-width: 0; min-height: 42px; padding: 9px 10px; border: 1px solid #dfe6de; background: #fbfcfa; border-radius: 9px; font-size: 13px; }
.color-remove { width: 28px; height: 28px; border: 0; background: transparent; color: #9aa79b; border-radius: 6px; font-size: 21px; font-weight: 300; }
.color-remove:hover { color: #b14c4c; background: #fbeeee; }
.color-warning { color: #a86b2f; background: #fff5e9; border: 1px solid #f5e3cf; border-radius: 8px; font-size: 11px; line-height: 1.5; padding: 9px 11px; margin: 13px 0 0; }
.editor-footer { flex: none; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); background: white; }
.footer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-left: auto; }
.archive-button { color: #9d6952; margin-right: 12px; }
.toast { position: fixed; z-index: 5; left: 50%; bottom: 26px; transform: translateX(-50%); padding: 12px 17px; border-radius: 10px; background: #233a2e; box-shadow: 0 12px 40px rgba(0,0,0,.17); color: white; font-size: 13px; font-weight: 650; white-space: nowrap; max-width: calc(100vw - 30px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.login-view { min-height: 100dvh; display: grid; grid-template-columns: 48% 52%; background: #fff; }
.login-art { position: relative; overflow: hidden; background: radial-gradient(circle at 10% 70%, #527f68, transparent 50%), linear-gradient(150deg, #2e6b50 10%, #183f30 100%); }
.login-art::before, .login-art::after { content: ""; position: absolute; width: 450px; height: 450px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.login-art::before { left: -150px; top: -220px; }
.login-art::after { right: -180px; bottom: -240px; }
.art-card { position: absolute; background: #f7f6ef; width: 235px; height: 295px; border-radius: 17px; box-shadow: 0 25px 55px rgba(8, 39, 22, .22); }
.art-card::before { content: ""; position: absolute; inset: 18px 18px 78px; border-radius: 10px; background: #cfded1; }
.art-card::after { content: ""; position: absolute; left: 20px; bottom: 36px; width: 100px; height: 9px; border-radius: 6px; background: #cad5ca; box-shadow: 0 17px 0 #e1e9e1; }
.art-card-one { left: 24%; top: 23%; transform: rotate(-15deg); }
.art-card-one::before { background: radial-gradient(circle at 38% 40%, #e7b88a 0 20%, transparent 21%), #d5d1b9; }
.art-card-two { left: 38%; top: 35%; transform: rotate(9deg); }
.art-card-two::before { background: radial-gradient(circle at 56% 43%, #a66845 0 28%, transparent 29%), #dfd9c8; }
.art-card-three { left: 20%; top: 45%; transform: rotate(-1deg); }
.art-card-three::before { background: radial-gradient(circle at 56% 53%, #658b68 0 28%, transparent 29%), #d4dfd1; }
.login-panel { width: min(420px, calc(100% - 80px)); margin: auto; }
.login-panel .brand { margin-bottom: 82px; }
.login-panel h1 { font-size: clamp(38px, 4vw, 53px); line-height: 1.08; letter-spacing: -.065em; margin: 0 0 20px; }
.login-intro { color: #78877c; font-size: 14px; line-height: 1.7; margin: 0 0 40px; }
.login-form { display: flex; flex-direction: column; gap: 9px; }
.login-form label { font-size: 12px; font-weight: 750; }
.login-form input { min-height: 49px; padding: 0 14px; border: 1px solid #dce5da; border-radius: 9px; background: #fafbf9; font-size: 14px; margin-bottom: 10px; }
.login-form input:focus { border-color: #82b195; outline: 3px solid rgba(39,105,79,.09); }
.login-form input::placeholder { color: #a7b2a9; }
.form-error { color: #b44545; font-size: 12px; margin: -4px 0 6px; }

@media (max-width: 1100px) { .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .topbar { height: 63px; }
  .topbar-inner { padding: 0 20px; }
  .topbar-actions { gap: 4px; }
  .quiet-button span { display: none; }
  .quiet-button svg { width: 20px; height: 20px; }
  .main-content { padding: 33px 20px 110px; }
  .page-heading { margin-bottom: 29px; }
  .page-heading h1 { font-size: 41px; }
  .new-button { display: none; }
  .catalog-toolbar { flex-direction: column; gap: 0; align-items: stretch; }
  .search-box { width: 100%; margin-bottom: 17px; }
  .tabs { gap: 24px; }
  .tab { padding-bottom: 14px; }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .item-image { height: 155px; }
  .item-card-body { padding: 13px; }
  .item-title { font-size: 13px; }
  .quantity-badge { font-size: 9px; }
  .mobile-fab { display: grid; place-items: center; position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border: 0; border-radius: 18px; background: var(--green); color: white; font-size: 32px; font-weight: 300; box-shadow: 0 10px 23px rgba(26, 76, 51, .28); z-index: 2; }
  .editor-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .editor-header { padding: 22px 20px 17px; }
  .editor-body { padding: 0 20px 18px; }
  .editor-footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { width: min(420px, calc(100% - 48px)); padding: 50px 0; }
  .login-panel .brand { margin-bottom: 75px; }
}
@media (max-width: 500px) {
  .page-heading h1 { font-size: 37px; }
  .page-subtitle { font-size: 12px; }
  .item-image { height: 130px; }
  .item-card-bottom { padding-top: 15px; }
  .item-price { font-size: 14px; }
  .item-description { font-size: 11px; }
  .three-columns { grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .three-columns .field:first-child { grid-column: 1 / -1; }
  .color-row { grid-template-columns: 42px minmax(0, 1fr) 76px 25px; gap: 6px; }
  .color-picker { width: 40px; }
  .color-row input[type="text"], .color-row input[type="number"] { font-size: 12px; padding: 8px; }
  .editor-header h2 { font-size: 23px; }
  .editor-footer .button { padding: 0 12px; font-size: 12px; }
  .archive-button { font-size: 11px; max-width: 70px; text-align: left; }
  .footer-actions { gap: 6px; }
  .photo-actions { flex-wrap: wrap; }
}
