:root {
  color-scheme: light;
  --ink: #182923;
  --muted: #53645a;
  --accent: #27594a;
  --accent-hover: #1a4437;
  --border: #dcded5;
  --paper: #f7f7f2;
  --white: #fff;
  --sidebar: #18332d;
  --sidebar-text: #d5e1d9;
  --sidebar-muted: #a7bcb0;
  --sand: #e9d19c;
  --photo: #f2eee7;
  --focus: #a66619;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: var(--accent); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 5; padding: .6rem 1rem; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }
[data-icon] { width: 20px; height: 20px; flex: 0 0 auto; display: inline-flex; }
[data-icon] svg { display: block; width: 100%; height: 100%; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.workspace { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  background: var(--sidebar); color: var(--sidebar-text); min-height: 0;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 25px 22px 24px; color: #fff; }
.brand-icon {
  width: 43px; height: 43px; display: grid; place-items: center;
  color: #29392c; background: var(--sand); border-radius: 12px;
}
.brand-icon svg { width: 22px; height: 22px; }
.brand strong { display: block; font-size: 24px; line-height: 1.1; letter-spacing: .055em; }
.brand div span { display: block; color: var(--sidebar-muted); font-size: 12px; margin-top: 4px; }
.nav-slot { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #6a8275 transparent; }
.sidebar .nav-slot { flex: 1; }
#catalog-nav { padding: 2px 12px 12px; }
.nav-label { padding: 14px 10px 8px; color: var(--sidebar-muted); font-size: 12px; font-weight: 650; }
.nav-entry { position: relative; display: flex; align-items: center; border-radius: 8px; min-height: 44px; }
.nav-entry:hover, .nav-sub:hover { background: #25463c; }
.nav-entry.current-group { color: #fff; }
.nav-entry .nav-main, .nav-sub {
  text-align: left; border: 0; background: transparent; width: 100%; font-size: 14px; min-width: 0;
}
.nav-entry .nav-main {
  display: flex; align-items: center; gap: 10px; flex: 1; padding: 8px 10px; min-height: 44px;
  font-weight: 600; overflow-wrap: anywhere;
}
.nav-entry .nav-main > [data-icon] { color: #aac4b7; width: 18px; height: 18px; }
.nav-entry.all-entry { border: 1px solid #466458; }
.nav-entry.all-entry .nav-main { justify-content: flex-start; }
.nav-entry.all-entry .nav-count { margin-left: auto; }
.nav-entry.selected, .nav-sub.selected { color: #fff; background: #32584a; }
.nav-sub.selected::before { content: ""; position: absolute; inset: 9px auto 9px 0; width: 3px; background: var(--sand); border-radius: 2px; }
.nav-arrow {
  display: grid; place-items: center; width: 42px; height: 44px; padding: 0;
  flex: 0 0 auto; border: 0; background: transparent; color: #b2c7ba; border-radius: 7px;
}
.nav-arrow:hover { background: #3d5e50; }
.nav-arrow [data-icon] { width: 16px; height: 16px; }
.nav-arrow[aria-expanded="true"] [data-icon] { transform: rotate(180deg); }
.nav-children { padding: 2px 0 6px 15px; }
.nav-sub {
  display: flex; align-items: center; gap: 9px; position: relative; padding: 6px 11px 6px 13px;
  color: var(--sidebar-text); min-height: 44px; border-radius: 7px; line-height: 1.3;
}
.nav-sub .nav-count { margin-left: auto; }
.nav-count { color: var(--sidebar-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.selected .nav-count { color: #eddeb9; }
.sidebar-footer { border-top: 1px solid #385348; padding: 16px 22px 17px; color: var(--sidebar-muted); font-size: 12px; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 80px; padding: 12px clamp(24px, 3.2vw, 52px); background: var(--white); border-bottom: 1px solid var(--border);
}
.toolbar-title { font-size: 16px; font-weight: 700; }
.title-short { display: none; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#install-app { white-space: nowrap; }
.mobile-nav-button { display: none !important; }
.search {
  display: flex; align-items: center; gap: 10px; padding: 0 5px 0 12px; width: min(370px, 100%);
  min-height: 44px; color: var(--muted); background: #f7f8f5; border: 1px solid var(--border); border-radius: 9px;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #27594a30; }
.search input { border: 0; outline: 0; color: var(--ink); flex: 1; min-width: 0; width: 100%; background: none; padding: 10px 0; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search .icon-button { width: 38px; height: 38px; min-height: 38px; }
.main { max-width: 1600px; margin: 0 auto; padding: 30px clamp(24px, 3.2vw, 52px) 48px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--muted); min-height: 37px; font-size: 13px; }
.breadcrumb button { border: 0; background: transparent; padding: 3px 3px 3px 0; color: var(--accent); min-height: 36px; }
.breadcrumb button:hover { text-decoration: underline; }
.breadcrumb > [data-icon] { width: 13px; height: 13px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 4px 0 24px; }
.heading > div { min-width: 0; }
h1 { font-size: clamp(31px, 3.5vw, 49px); line-height: 1.09; letter-spacing: -.045em; overflow-wrap: anywhere; }
.result-count { margin-top: 8px; color: var(--muted); font-size: 14px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px;
  padding: 9px 15px; border-radius: 8px; border: 1px solid transparent; background: var(--white);
  color: var(--ink); font-weight: 650; text-align: center; line-height: 1.25;
}
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover { background: var(--accent-hover); }
.button-outline { border-color: #b5c5bb; color: var(--accent); }
.button-outline:hover { background: #ecf3ed; }
.add-button { flex: 0 0 auto; font-size: 14px; }
.filters {
  display: flex; align-items: center; gap: 5px; margin-bottom: 19px; padding: 4px;
  border: 1px solid #e0e3d8; border-radius: 10px; background: #ecefe7; width: fit-content; max-width: 100%;
}
.filters button {
  border: 1px solid transparent; border-radius: 7px; min-height: 44px;
  background: transparent; padding: 4px 11px; color: var(--muted); font-size: 13px; font-weight: 650;
}
.filters button:hover { color: var(--ink); background: #e3e9df; }
.filters button[aria-pressed="true"] { background: var(--white); color: var(--accent-hover); border-color: #d7e0d5; box-shadow: 0 1px 2px #1829230d; }
.filters span { color: inherit; font-variant-numeric: tabular-nums; opacity: .85; margin-left: 3px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 242px), 1fr)); gap: 16px; }
.product-card {
  display: flex; flex-direction: column; overflow: hidden; min-width: 0; text-align: left;
  border: 1px solid var(--border); background: var(--white); border-radius: 12px; padding: 0;
  box-shadow: 0 1px 2px #292b2310;
}
.product-card:hover { border-color: #8ba397; box-shadow: 0 4px 15px #18292314; }
.product-photo {
  height: clamp(135px, 14vw, 207px); width: 100%; padding: 10px; display: grid;
  place-items: center; background: var(--photo); overflow: hidden; border-bottom: 1px solid #ebe7dd;
}
.product-photo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.no-photo { display: grid; place-items: center; gap: 6px; color: #6b6c5f; text-align: center; font-size: 13px; }
.no-photo [data-icon] { width: 30px; height: 30px; color: #807e6e; }
.card-info { padding: 13px 15px 14px; min-width: 0; flex: 1; width: 100%; display: flex; flex-direction: column; }
.card-name { display: flex; justify-content: space-between; align-items: start; gap: 8px; font-size: 16px; font-weight: 730; line-height: 1.24; overflow-wrap: anywhere; }
.card-name [data-icon] { width: 17px; height: 17px; color: var(--accent); }
.card-meta { font-size: 13px; margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }
.card-end { margin-top: auto; padding-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.card-price { color: var(--accent-hover); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-review { display: inline-block; background: #f6ebd4; color: #795017; font-weight: 650; font-size: 12px; padding: 3px 8px; border-radius: 5px; }
.status-approved { display: inline-block; background: #e5f1e7; color: #21503a; font-weight: 650; font-size: 12px; padding: 3px 8px; border-radius: 5px; }
.list-end { display: flex; justify-content: center; padding-top: 26px; }
.empty { grid-column: 1 / -1; border: 1px dashed #cbd4cb; border-radius: 12px; padding: 28px 22px; background: #fff; }
.empty h2 { font-size: 20px; margin-bottom: 5px; }
.empty p { color: var(--muted); }
.empty button { margin-top: 14px; }
.icon-button {
  display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0;
  background: transparent; border: 0; border-radius: 8px; flex: 0 0 auto;
}
.icon-button:hover { background: #e7eee8; }
body:has(dialog[open]) { overflow: hidden; }
dialog { color: var(--ink); border: 0; background: #fff; padding: 0; }
dialog::backdrop { background: #101f1acc; }
.dialog {
  width: min(720px, calc(100% - 32px)); max-width: none;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  border-radius: 15px; box-shadow: 0 18px 64px #12221b55; overflow: hidden;
}
.dialog[open], .nav-dialog[open] { display: flex; flex-direction: column; }
.dialog-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 17px 20px 14px; border-bottom: 1px solid var(--border); background: var(--white);
}
.dialog-header > div { min-width: 0; }
.dialog-header h2 { font-size: clamp(21px, 3.2vw, 28px); line-height: 1.17; letter-spacing: -.025em; overflow-wrap: anywhere; }
.dialog-header .icon-button { margin: -4px -5px -4px 0; border: 1px solid var(--border); }
.dialog-context { margin-bottom: 3px; font-size: 12px; color: var(--muted); }
.product-actions { display: flex; align-items: center; gap: 9px; }
.product-actions .icon-button { margin-block: 0; }
.product-actions .button { font-size: 13px; }
.product-saved { margin-bottom: 12px; color: var(--accent-hover); font-weight: 650; }
.dialog-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 18px 20px 25px; }
.detail-overview { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.detail-photo {
  height: 226px; padding: 8px; background: var(--photo); border-radius: 9px; overflow: hidden;
  display: grid; place-items: center;
}
.detail-photo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.photo-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.photo-controls button { height: 44px; width: 52px; border: 1px solid var(--border); border-radius: 6px; background: var(--photo); padding: 3px; }
.photo-controls button[aria-pressed="true"] { border: 2px solid var(--accent); }
.photo-controls img { width: 100%; height: 100%; object-fit: contain; }
.photo-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 650; text-underline-offset: 3px; }
.photo-caption { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.detail-summary { display: grid; gap: 10px; }
.detail-summary > :first-child { justify-self: start; }
.detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-field { min-width: 0; overflow-wrap: anywhere; }
.detail-field dt { font-weight: 650; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.detail-field dd { white-space: pre-wrap; }
.detail-summary .detail-field dd { font-weight: 620; font-variant-numeric: tabular-nums; }
.detail-block { margin-top: 17px; }
.detail-block h3 { font-size: 16px; margin-bottom: 6px; }
.detail-block p { white-space: pre-wrap; overflow-wrap: anywhere; }
.receiving { background: #ecf2e9; border: 1px solid #dce7d9; border-radius: 8px; padding: 12px; }
.detail-other { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 17px; }
.detail-source { color: var(--muted); font-size: 12px; margin-top: 15px; overflow-wrap: anywhere; }
.add-dialog { width: min(650px, calc(100% - 32px)); }
.install-dialog { width: min(450px, calc(100% - 24px)); }
.install-dialog ol { margin: 0; padding-left: 1.4em; }
.install-dialog li + li { margin-top: 10px; }
.mcp-settings > label { display: block; margin-top: 14px; font-weight: 650; }
.mcp-settings input { width: 100%; min-height: 44px; padding: 8px; margin: 4px 0 8px; font-size: 16px; border: 1px solid var(--border); border-radius: 7px; }
.mcp-settings [role="status"] { color: var(--accent-hover); }
.mcp-settings dl { margin-top: 13px; }
.mcp-settings dl div + div { margin-top: 8px; }
form label { font-weight: 650; display: block; }
form input, form select, form textarea {
  display: block; width: 100%; border: 1px solid #b9c6bc; border-radius: 7px;
  padding: 9px 10px; min-height: 44px; background: #fff; color: var(--ink); font-size: 16px;
  font-weight: 400; margin-top: 4px;
}
form textarea { min-height: 78px; resize: vertical; }
form > .button { margin-top: 16px; }
#pin { max-width: 240px; letter-spacing: .16em; }
.form-note { color: var(--muted); margin-bottom: 14px; }
.form-error { color: #9d3026; margin-top: 10px; }
.form-grid, .form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-fields, .full-width { grid-column: 1 / -1; }
.field-hint { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.edit-photos { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.edit-photos legend { padding-inline: 4px; font-weight: 650; }
.existing-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 176px), 1fr)); gap: 8px; margin: 8px 0 12px; }
.edit-photo { padding: 8px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.edit-photo-preview { display: grid; place-items: center; height: 94px; border-radius: 5px; background: var(--photo); overflow: hidden; }
.edit-photo-preview img { width: 100%; height: 100%; object-fit: contain; }
.edit-photo label, .edit-photo .button { font-size: 13px; margin-top: 5px; }
.edit-photo input { font-size: 14px; }
.edit-photo .button { width: 100%; }
.edit-photo[data-removed="true"] .edit-photo-preview { opacity: .45; }
.nav-dialog {
  background: var(--sidebar); color: var(--sidebar-text); inset: 0 auto 0 0; margin: 0;
  height: 100vh; height: 100dvh; max-height: 100dvh; width: min(345px, 94vw); max-width: 100%;
}
.nav-dialog .dialog-header { background: var(--sidebar); color: #fff; border-color: #456155; align-items: center; }
.nav-dialog .dialog-header h2 { font-size: 21px; }
.nav-dialog .icon-button { border-color: #59776b; }
.nav-dialog .icon-button:hover { background: #36584a; }
.nav-dialog .nav-slot { padding: 10px 0 env(safe-area-inset-bottom); }
@media (min-width: 1050px) and (max-width: 1560px) {
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 215px minmax(0, 1fr); }
  .toolbar { padding-inline: 20px; }
  .main { padding-inline: 20px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { display: none; }
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 10px 16px 13px; gap: 7px 9px; }
  .toolbar-title { grid-area: 1 / 1; line-height: 1.18; max-width: 250px; }
  .title-full { display: none; }
  .title-short { display: inline; }
  .toolbar-actions { grid-area: 1 / 2; }
  .toolbar-actions .button { padding-inline: 9px; font-size: 13px; }
  .mobile-nav-button { display: inline-flex !important; color: var(--accent); border-color: var(--border); }
  .search { grid-column: 1 / -1; width: 100%; }
  .search input { font-size: 16px; }
  .main { padding: 12px 16px 30px; }
  .heading { margin-bottom: 15px; gap: 12px; }
  .product-photo { height: clamp(117px, 23vw, 166px); }
}
@media (max-width: 370px) {
  .toolbar-actions { gap: 5px; }
  .mobile-nav-button [data-icon] { display: none; }
}
@media (max-width: 470px) {
  .heading { flex-wrap: wrap; align-items: flex-start; }
  .heading > div { flex-basis: 100%; }
  .products { gap: 9px; }
  .card-info { padding: 9px; }
  .card-name { font-size: 14px; gap: 3px; }
  .card-name [data-icon] { width: 14px; height: 14px; }
  .card-meta { font-size: 12px; }
  .filters { width: 100%; }
  .filters button { flex: 1 1 auto; padding-inline: 3px; font-size: 12px; }
  .dialog, .add-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .dialog-header { padding: 13px 13px 10px; }
  .product-dialog .dialog-header { display: grid; grid-template-columns: minmax(0, 1fr) 44px; row-gap: 5px; }
  .product-actions { display: contents; }
  .product-actions .icon-button { grid-row: 1; grid-column: 2; margin-right: 0; }
  .product-actions .button { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
  .dialog-body { padding: 13px 13px max(16px, env(safe-area-inset-bottom)); }
  .detail-overview { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .detail-photo { height: min(165px, 26dvh); min-height: 94px; }
  .form-grid, .form-fields { grid-template-columns: minmax(0, 1fr); }
}
