:root {
  --paper: #f7f4ee;
  --surface: #fffdf9;
  --surface-2: #f1ede5;
  --ink: #28332f;
  --muted: #7f867f;
  --line: #e6e0d6;
  --green: #294f45;
  --green-2: #3d675d;
  --sage: #b7c2aa;
  --cream: #ece4d2;
  --clay: #c8795e;
  --ochre: #d3a85c;
  --blue: #59747e;
  --shadow: 0 18px 45px rgba(45, 57, 50, .08);
  --shadow-sm: 0 8px 24px rgba(45, 57, 50, .08);
  --radius: 22px;
  --font: "Onest", "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 264px; display: flex; flex-direction: column; padding: 28px 18px 20px; background: #fffcf7; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; flex: none; color: var(--green); border-radius: 13px; background: #e4e8dc; }
.brand-mark svg { width: 29px; height: 29px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.brand strong { font-size: 17px; letter-spacing: -.03em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }

.side-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { margin: 0 12px 8px; color: #a5a59d; font-size: 10px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.side-nav a { min-height: 46px; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px; padding: 0 13px; color: #68706b; border-radius: 13px; font-size: 13.5px; font-weight: 500; transition: .2s ease; }
.side-nav a svg { width: 19px; height: 19px; }
.side-nav a:hover { color: var(--ink); background: var(--surface-2); }
.side-nav a.active { color: white; background: var(--green); box-shadow: 0 9px 22px rgba(41, 79, 69, .18); }
.nav-count { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 8px; background: #ece8df; color: #8a8a82; font-size: 10px; }
.side-nav a.active .nav-count { background: rgba(255,255,255,.16); color: #fff; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.install-card { width: 100%; display: grid; grid-template-columns: 34px 1fr 18px; align-items: center; gap: 10px; padding: 13px 12px; text-align: left; border: 1px solid #ded8cd; border-radius: 16px; background: #f4efe6; cursor: pointer; }
.install-card > span:nth-child(2), .profile-card > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.install-card strong, .profile-card strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.install-card small, .profile-card small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.install-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--green); border-radius: 11px; background: white; }
.install-icon svg { width: 17px; }
.profile-card { display: grid; grid-template-columns: 36px 1fr 28px; align-items: center; gap: 9px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar, .mobile-avatar { display: grid; place-items: center; color: white; background: var(--clay); font-weight: 700; }
.avatar { width: 36px; height: 36px; border-radius: 12px; font-size: 12px; }

.main-area { min-width: 0; grid-column: 2; }
.topbar { position: sticky; z-index: 15; top: 0; min-height: 74px; display: flex; align-items: center; gap: 22px; padding: 12px clamp(24px, 3.2vw, 52px); background: rgba(247,244,238,.88); border-bottom: 1px solid rgba(230,224,214,.78); backdrop-filter: blur(18px); }
.mobile-brand { display: none; }
.global-search { width: min(500px, 46vw); height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 13px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 14px; transition: .2s ease; }
.global-search:focus-within { background: white; border-color: #aebbb5; box-shadow: 0 0 0 3px rgba(41,79,69,.08); }
.global-search svg { width: 18px; flex: none; color: #92958f; }
.global-search input { min-width: 0; flex: 1; padding: 0; color: var(--ink); background: none; border: 0; outline: none; font-size: 13px; }
.global-search input::placeholder { color: #a2a49e; }
.global-search kbd { padding: 3px 6px; color: #a2a49e; background: #f6f3ed; border: 1px solid #e5e0d8; border-radius: 6px; font: 9px var(--font); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.icon-button, .help-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: rgba(255,255,255,.68); cursor: pointer; transition: .2s ease; }
.icon-button:hover, .help-button:hover { background: white; border-color: #d1cabf; transform: translateY(-1px); }
.icon-button { position: relative; width: 40px; height: 40px; padding: 0; border-radius: 13px; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button i { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; background: var(--clay); border: 1.5px solid white; border-radius: 50%; }
.icon-button.subtle { width: 28px; height: 28px; background: transparent; border: 0; }
.help-button { height: 40px; gap: 7px; padding: 0 13px; border-radius: 13px; font-size: 11.5px; }
.help-button svg { width: 16px; }
.mobile-avatar { display: none; width: 34px; height: 34px; border: 0; border-radius: 11px; font-size: 11px; }
.content { width: 100%; max-width: 1510px; margin: 0 auto; padding: 40px clamp(24px, 3.2vw, 52px) 90px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; color: var(--clay); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.06; letter-spacing: -.045em; }
.heading-copy { max-width: 610px; margin: 11px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.primary-button, .secondary-button, .ghost-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border-radius: 13px; cursor: pointer; font-size: 12.5px; font-weight: 600; transition: .2s ease; }
.primary-button { color: white; background: var(--green); border: 1px solid var(--green); box-shadow: 0 9px 20px rgba(41,79,69,.16); }
.primary-button:hover { background: #203f37; transform: translateY(-1px); }
.primary-button svg, .secondary-button svg, .ghost-button svg { width: 17px; height: 17px; }
.secondary-button { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.secondary-button:hover { border-color: #cbc4b9; background: white; }
.ghost-button { min-height: 38px; padding: 0 11px; color: var(--green); background: transparent; border: 0; }
.ghost-button:hover { background: #eef0e8; }

.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr); gap: 18px; margin-bottom: 24px; }
.welcome-card { position: relative; min-height: 226px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 30px; color: white; background: var(--green); border-radius: 26px; box-shadow: var(--shadow); }
.welcome-card::before, .welcome-card::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.welcome-card::before { width: 280px; height: 280px; right: -80px; top: -150px; }
.welcome-card::after { width: 180px; height: 180px; right: 60px; top: -125px; }
.welcome-copy { position: relative; z-index: 1; max-width: 520px; }
.welcome-copy small { display: block; margin-bottom: 13px; color: #bfcfc9; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.welcome-copy h2 { max-width: 500px; margin: 0; font-size: clamp(24px, 2.6vw, 37px); line-height: 1.12; letter-spacing: -.045em; }
.welcome-bottom { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; }
.welcome-bottom .primary-button { color: var(--green); background: #f6f0e4; border-color: #f6f0e4; box-shadow: none; }
.welcome-bottom p { margin: 0; color: #c2cec9; font-size: 11px; line-height: 1.45; }
.quick-panel { display: flex; flex-direction: column; padding: 25px; background: #ece3d2; border: 1px solid #e1d5c1; border-radius: 26px; }
.quick-panel-head { display: flex; align-items: center; justify-content: space-between; }
.quick-panel h3 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.quick-panel-head span { color: #887b68; }
.quick-actions { margin-top: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-action { min-height: 73px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 12px; color: #665d50; text-align: left; background: rgba(255,255,255,.5); border: 1px solid rgba(136,123,104,.15); border-radius: 15px; cursor: pointer; transition: .2s ease; }
.quick-action:hover { color: var(--green); background: rgba(255,255,255,.84); transform: translateY(-2px); }
.quick-action svg { width: 18px; height: 18px; }
.quick-action span { font-size: 10.5px; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.stat-card { min-height: 116px; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 13px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 19px; }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); border-radius: 13px; background: #edf0e8; }
.stat-icon.clay { color: #9d5944; background: #f5e6df; }
.stat-icon.ochre { color: #926d2c; background: #f3ead8; }
.stat-icon.blue { color: #44626e; background: #e4ecee; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-card strong { display: block; font-size: 24px; line-height: 1; letter-spacing: -.04em; }
.stat-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 15px; }
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.recent-grid, .item-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.item-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 19px; cursor: pointer; transition: .24s ease; }
.item-card:hover { border-color: #d2cbbf; box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.item-photo { position: relative; aspect-ratio: 1.28; overflow: hidden; background: #ede8df; }
.item-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.item-card:hover .item-photo img { transform: scale(1.035); }
.fallback-photo { width: 100%; height: 100%; background-color: var(--photo-bg, #ece6db); background-image: radial-gradient(circle at 40% 45%, var(--photo-color, #c8795e) 0 18%, transparent 19%), repeating-linear-gradient(118deg, rgba(255,255,255,.38) 0 2px, transparent 2px 10px); }
.photo-badge { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; color: #56645e; background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.65); border-radius: 9px; backdrop-filter: blur(8px); font-size: 8.5px; font-weight: 600; }
.photo-badge svg { width: 11px; height: 11px; }
.favorite-button { position: absolute; top: 9px; right: 9px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; color: #78807c; background: rgba(255,255,255,.86); border: 0; border-radius: 10px; cursor: pointer; backdrop-filter: blur(8px); }
.favorite-button svg { width: 15px; height: 15px; }
.favorite-button.active { color: var(--clay); }
.favorite-button.active svg { fill: currentColor; }
.item-body { padding: 14px 14px 15px; }
.item-category { margin: 0 0 7px; color: var(--clay); font-size: 8.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.item-body h3 { overflow: hidden; margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 10px; color: var(--muted); border-top: 1px solid #eee9e1; font-size: 9.5px; }
.item-location { min-width: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-location svg { width: 12px; height: 12px; flex: none; }
.quantity { flex: none; color: var(--ink); font-weight: 600; }

.catalog-top { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.filter-scroller { min-width: 0; display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 3px 2px 6px; scrollbar-width: none; }
.filter-scroller::-webkit-scrollbar { display: none; }
.filter-chip { height: 36px; flex: none; padding: 0 13px; color: #707872; background: rgba(255,255,255,.68); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 10.5px; font-weight: 600; }
.filter-chip:hover { border-color: #c8c1b6; }
.filter-chip.active { color: white; background: var(--green); border-color: var(--green); }
.catalog-tools { margin-left: auto; display: flex; gap: 7px; }
.select-control { height: 36px; padding: 0 31px 0 11px; color: #68706b; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; outline: none; font-size: 10px; cursor: pointer; }
.view-toggle { display: flex; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.view-toggle button { width: 29px; height: 28px; display: grid; place-items: center; padding: 0; color: #959994; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.view-toggle button.active { color: var(--green); background: #ebece5; }
.view-toggle svg { width: 15px; height: 15px; }
.results-line { margin: 0 0 14px; color: var(--muted); font-size: 10px; }
.item-grid.list { grid-template-columns: 1fr; gap: 9px; }
.item-grid.list .item-card { display: grid; grid-template-columns: 116px minmax(0,1fr); }
.item-grid.list .item-photo { aspect-ratio: auto; min-height: 108px; }
.item-grid.list .item-body { display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: center; column-gap: 24px; }
.item-grid.list .item-meta { grid-column: 2; grid-row: 1 / span 3; min-width: 170px; align-items: flex-end; justify-content: center; flex-direction: column; margin: 0; padding: 0 0 0 15px; border-top: 0; border-left: 1px solid var(--line); }

.empty-state { grid-column: 1 / -1; min-height: 300px; display: grid; place-items: center; text-align: center; padding: 44px; background: rgba(255,255,255,.5); border: 1px dashed #d7cfc3; border-radius: 22px; }
.empty-icon { width: 55px; height: 55px; display: grid; place-items: center; margin: 0 auto 16px; color: var(--green); background: #e9ede5; border-radius: 18px; }
.empty-icon svg { width: 24px; }
.empty-state h3 { margin: 0; font-size: 17px; }
.empty-state p { max-width: 360px; margin: 8px auto 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.location-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .65fr); gap: 18px; }
.location-list { display: grid; gap: 10px; }
.location-card { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; cursor: pointer; transition: .2s ease; }
.location-card:hover { border-color: #cbc5bb; transform: translateX(3px); }
.location-symbol { width: 48px; height: 48px; display: grid; place-items: center; color: var(--green); border-radius: 15px; background: #e9ede5; }
.location-symbol.warm { color: #9c5d48; background: #f4e5df; }
.location-symbol.blue { color: #4f6d77; background: #e3ecef; }
.location-symbol svg { width: 21px; }
.location-card h3 { margin: 0 0 5px; font-size: 13px; }
.location-card p { margin: 0; color: var(--muted); font-size: 10px; }
.location-card > span:last-child { color: #9b9e99; }
.storage-map { min-height: 370px; padding: 22px; background: #e9e0d0; border: 1px solid #ddd2c0; border-radius: 22px; }
.storage-map h3 { margin: 0 0 5px; font-size: 15px; }
.storage-map > p { margin: 0 0 20px; color: #857b6d; font-size: 10px; }
.shelf { overflow: hidden; background: rgba(255,255,255,.5); border: 8px solid #9f765e; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(54,37,27,.18); }
.shelf-row { height: 77px; display: flex; align-items: flex-end; gap: 7px; padding: 10px 12px 0; border-bottom: 7px solid #9f765e; }
.shelf-row:last-child { border-bottom: 0; }
.box { position: relative; height: 52px; flex: 1; display: grid; place-items: center; color: #695d4e; background: #d8c49e; border: 1px solid #b79c71; border-radius: 5px 5px 2px 2px; font-size: 8px; font-weight: 600; }
.box.small { flex: .65; background: #c7d0bd; border-color: #9fab93; }
.box.clay { background: #d4a18c; border-color: #b67b64; }
.box::before { content: ""; position: absolute; left: 8px; right: 8px; top: 8px; height: 12px; background: rgba(255,255,255,.48); border-radius: 2px; }
.box span { position: relative; z-index: 1; margin-top: 16px; }

.pattern-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.pattern-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; cursor: pointer; transition: .22s ease; }
.pattern-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.pattern-preview { position: relative; aspect-ratio: 1.55; display: grid; place-items: center; overflow: hidden; background-color: #eee8dd; background-image: linear-gradient(rgba(109,100,87,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(109,100,87,.07) 1px, transparent 1px); background-size: 18px 18px; }
.pattern-preview svg { width: 56%; height: 70%; color: #897a68; stroke-width: .9; }
.pattern-type { position: absolute; left: 11px; top: 11px; padding: 5px 7px; color: white; background: var(--clay); border-radius: 7px; font-size: 8px; font-weight: 700; }
.pattern-body { padding: 15px; }
.pattern-body h3 { margin: 0; font-size: 13px; }
.pattern-body p { margin: 7px 0 12px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 4px 7px; color: #67716b; background: #eef0ea; border-radius: 6px; font-size: 8px; }

.shopping-card { max-width: 760px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.shopping-input { display: flex; gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); }
.shopping-input input { min-width: 0; flex: 1; height: 42px; padding: 0 13px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 11px; outline: none; font-size: 12px; }
.shopping-list { margin: 0; padding: 0; list-style: none; }
.shopping-row { min-height: 58px; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 11px; padding: 8px 17px; border-bottom: 1px solid #eee9e1; }
.shopping-row:last-child { border-bottom: 0; }
.shopping-row label { font-size: 12px; cursor: pointer; }
.shopping-row.done label { color: #a2a49f; text-decoration: line-through; }
.check-control { width: 19px; height: 19px; accent-color: var(--green); cursor: pointer; }
.row-delete { width: 29px; height: 29px; display: grid; place-items: center; padding: 0; color: #a6a7a3; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.row-delete:hover { color: var(--clay); background: #f8eae5; }
.row-delete svg { width: 15px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; max-width: 900px; }
.settings-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 19px; }
.settings-card h3 { margin: 0 0 6px; font-size: 14px; }
.settings-card p { margin: 0 0 17px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(25,34,31,.45); backdrop-filter: blur(6px); animation: fade-in .18s ease; }
.modal { width: min(600px, 100%); max-height: min(780px, calc(100vh - 36px)); overflow: auto; background: #fffdf9; border: 1px solid rgba(255,255,255,.6); border-radius: 24px; box-shadow: 0 30px 90px rgba(30,40,36,.25); animation: modal-in .24s ease; }
.modal.wide { width: min(760px, 100%); }
.modal-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 17px; background: rgba(255,253,249,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.modal-head h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; flex: none; padding: 0; color: #7e837f; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.modal-close svg { width: 16px; }
.modal-body { padding: 22px 24px 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #59625d; font-size: 10px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 43px; padding: 10px 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 11px; outline: none; font-size: 11.5px; }
.form-field textarea { min-height: 80px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #aab8b2; box-shadow: 0 0 0 3px rgba(41,79,69,.07); }
.upload-zone { min-height: 108px; display: grid; place-items: center; padding: 15px; color: var(--muted); text-align: center; background: #f5f1e9; border: 1px dashed #cec5b8; border-radius: 14px; cursor: pointer; }
.upload-zone:hover { color: var(--green); background: #f1f2eb; border-color: #9dafaa; }
.upload-zone svg { width: 22px; margin: 0 auto 7px; }
.upload-zone strong { display: block; color: var(--ink); font-size: 10.5px; }
.upload-zone small { display: block; margin-top: 3px; font-size: 9px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.details-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; }
.details-photo { overflow: hidden; min-height: 300px; background: var(--surface-2); border-radius: 17px; }
.details-photo img { width: 100%; height: 100%; object-fit: cover; }
.details-copy .item-category { margin-top: 4px; }
.details-copy h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.detail-list { display: grid; gap: 0; margin: 20px 0; }
.detail-row { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 10.5px; }
.detail-row span:first-child { color: var(--muted); }
.detail-notes { padding: 13px; color: #626b66; background: var(--paper); border-radius: 12px; font-size: 10.5px; line-height: 1.55; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.danger-button { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; color: #9a493d; background: #fbefeb; border: 1px solid #f0d8d0; border-radius: 11px; cursor: pointer; font-size: 10.5px; font-weight: 600; }
.danger-button svg { width: 15px; }

.install-steps { display: grid; gap: 12px; counter-reset: install; }
.install-step { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; padding: 13px; background: var(--paper); border-radius: 13px; }
.install-step::before { counter-increment: install; content: counter(install); width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 11px; font-size: 11px; font-weight: 700; }
.install-step strong { display: block; font-size: 11px; }
.install-step p { margin: 4px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; }

.toast-region { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 260px; display: flex; align-items: center; gap: 10px; padding: 13px 15px; color: white; background: #263e37; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; box-shadow: 0 14px 35px rgba(30,44,39,.25); animation: toast-in .25s ease; font-size: 10.5px; }
.toast svg { width: 17px; flex: none; }
.mobile-nav { display: none; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 1180px) {
  .recent-grid, .item-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .welcome-grid { grid-template-columns: 1fr; }
  .quick-panel { min-height: 160px; }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .pattern-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-area { width: 100%; }
  .topbar { min-height: 66px; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .mobile-brand .brand-mark svg { width: 25px; }
  .mobile-brand strong { font-size: 14px; letter-spacing: -.03em; }
  .global-search { width: auto; flex: 1; background: rgba(255,255,255,.78); }
  .global-search input { font-size: 11px; }
  .global-search kbd, .help-button { display: none; }
  .top-actions .icon-button { display: none; }
  .mobile-avatar { display: grid; }
  .content { padding: 26px 16px calc(102px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); height: 68px; display: grid; grid-template-columns: 1fr 1fr 62px 1fr 1fr; align-items: center; padding: 6px 8px; background: rgba(255,253,249,.93); border: 1px solid rgba(222,215,204,.95); border-radius: 21px; box-shadow: 0 14px 45px rgba(43,53,48,.18); backdrop-filter: blur(18px); }
  .mobile-nav a { height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #969993; border-radius: 13px; }
  .mobile-nav a.active { color: var(--green); background: #edf0e8; }
  .mobile-nav a svg { width: 19px; height: 19px; }
  .mobile-nav small { font-size: 8px; font-weight: 600; }
  .mobile-add { align-self: center; justify-self: center; width: 52px; height: 52px; display: grid; place-items: center; margin-top: -25px; color: white; background: var(--green); border: 5px solid var(--paper); border-radius: 17px; box-shadow: 0 8px 20px rgba(41,79,69,.25); }
  .mobile-add svg { width: 20px; height: 20px; }
  .location-layout { grid-template-columns: 1fr; }
  .storage-map { min-height: auto; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .mobile-brand { flex: 1; }
  .global-search { order: 3; width: 100%; flex-basis: 100%; height: 40px; }
  .content { padding-top: 22px; }
  .page-heading { align-items: flex-start; margin-bottom: 21px; }
  .page-heading .primary-button { min-width: 42px; width: 42px; padding: 0; }
  .page-heading .primary-button span { display: none; }
  .heading-copy { margin-top: 8px; font-size: 11px; }
  h1 { font-size: 28px; }
  .welcome-card { min-height: 250px; padding: 24px 21px; border-radius: 22px; }
  .welcome-copy h2 { font-size: 27px; }
  .welcome-bottom { align-items: flex-start; flex-direction: column; gap: 10px; }
  .welcome-bottom p { max-width: 200px; }
  .quick-panel { padding: 20px; border-radius: 22px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 98px; grid-template-columns: 35px 1fr; gap: 10px; padding: 13px; border-radius: 16px; }
  .stat-icon { width: 35px; height: 35px; border-radius: 11px; }
  .stat-icon svg { width: 17px; }
  .stat-card strong { font-size: 20px; }
  .stat-card small { font-size: 8.5px; }
  .recent-grid, .item-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .item-card { border-radius: 16px; }
  .item-photo { aspect-ratio: 1.08; }
  .item-body { padding: 11px; }
  .item-body h3 { font-size: 11px; }
  .item-category { font-size: 7.5px; }
  .item-meta { align-items: flex-end; font-size: 8px; }
  .item-location { max-width: 90px; }
  .photo-badge { display: none; }
  .catalog-top { flex-wrap: wrap; }
  .filter-scroller { width: 100%; }
  .catalog-tools { width: 100%; margin: 0; }
  .select-control { flex: 1; }
  .item-grid.list .item-card { grid-template-columns: 90px minmax(0,1fr); }
  .item-grid.list .item-meta { display: none; }
  .pattern-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .form-grid, .details-layout { grid-template-columns: 1fr; }
  .details-photo { min-height: 220px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 23px 23px 0 0; animation-name: sheet-in; }
  .modal-head { padding: 18px 17px 14px; }
  .modal-body { padding: 18px 17px calc(22px + env(safe-area-inset-bottom)); }
  .toast-region { left: 14px; right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; }
}

@keyframes sheet-in { from { opacity: 0; transform: translateY(35px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
