:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", sans-serif;
  --bg: #070707;
  --panel: #111;
  --panel-2: #151515;
  --line: #2d2d2d;
  --text: #f2f2f2;
  --muted: #9b9b9b;
  --cyan: #ededed;
  --gold: #b8b8b8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% 42%, #111 0, var(--bg) 42%, #050505 100%); color: var(--text); }
button, input { font: inherit; }
.app-shell { width: min(980px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: clamp(150px, 28vh, 285px) 0 64px; }
.topbar { display: none; }
.brand-title { margin: 0 0 20px; color: #c8c8c8; font-size: clamp(22px, 2.3vw, 28px); font-weight: 400; letter-spacing: -.02em; text-align: center; }
.eyebrow { margin: 0 0 5px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); }
.subtitle { margin: 7px 0 0; color: var(--muted); }
.stats { min-width: 145px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: right; }
.stats strong { display: block; color: var(--cyan); font-size: 24px; }
.stats span { color: var(--muted); font-size: 12px; }
.search-panel { display: grid; grid-template-columns: 58px minmax(0, 1fr) 58px 58px; align-items: center; gap: 8px; min-height: 84px; padding: 8px 10px; border: 1px solid #303030; border-radius: 999px; background: linear-gradient(100deg, rgba(22,22,22,.94), rgba(16,16,16,.94)); box-shadow: 0 18px 70px rgba(0,0,0,.5); }
.search-box { display: flex; align-items: center; gap: 19px; min-width: 0; padding: 0; border: 0; background: transparent; }
.search-box:focus-within { border-color: transparent; box-shadow: none; }
.search-icon { width: 28px; color: #aeb0b7; font-size: 32px; line-height: 1; }
.search-box input { width: 100%; padding: 18px 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: clamp(18px, 2vw, 24px); }
.search-box input::placeholder { color: #858585; }
.voice-button, .help-button, .secondary-button, .filter { border: 1px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer; }
.voice-button, .help-button { display: grid; width: 58px; height: 58px; padding: 0; place-items: center; border-color: #303030; border-radius: 50%; background: linear-gradient(145deg, #2c2c2c, #191919); }
.help-button { color: #d7d7d7; font-size: 24px; font-weight: 500; transition: background .16s ease, transform .16s ease; }
.help-button:hover { background: #343434; transform: translateY(-1px); }
.quick-add { position: relative; }
.quick-add-button { display: grid; width: 58px; height: 58px; padding: 0 0 3px; place-items: center; border: 1px solid #303030; border-radius: 50%; background: linear-gradient(145deg, #2c2c2c, #191919); color: #f0f0f0; cursor: pointer; font-size: 32px; font-weight: 300; line-height: 1; transition: transform .16s ease, background .16s ease; }
.quick-add-button:hover, .quick-add-button[aria-expanded="true"] { background: #343434; transform: rotate(45deg); }
.voice-button.listening { background: #6f2330; border-color: #e0586d; animation: pulse 1s infinite; }
.voice-button.waiting-item { background: #145638; border-color: #42d88a; }
.mic { width: 24px; height: 24px; margin: 0; fill: none; stroke: #f0f0f0; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#voiceLabel, .secondary-button, .voice-status { display: none; }
.content { display: block; margin-top: 54px; min-height: 240px; }
.filters, .details { display: none; }
.details.empty-details { display: grid; min-height: 90px; margin-top: 28px; padding: 0; border: 0; background: transparent; }
.item-total { display: block; margin-top: 9px; color: #c8c8c8; font-size: 13px; font-weight: 500; }
.catalog-area { border: 0; background: transparent; }
.filters, .details { padding: 16px; }
.filters h2, .details h2 { margin: 0 0 14px; font-size: 15px; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.filter { width: 100%; margin-bottom: 8px; padding: 10px; background: transparent; text-align: left; }
.filter:hover, .filter.active { border-color: var(--cyan); background: rgba(57, 198, 244, .1); color: var(--cyan); }
.tip { display: grid; gap: 8px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.tip strong { color: var(--text); }
.catalog-area { padding: 0; overflow: visible; }
.catalog-toolbar { display: none; }
.catalog-toolbar small { color: var(--muted); font-weight: 400; letter-spacing: 0; }
.catalog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; letter-spacing: 0; }
.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.file-button { display: inline-flex; align-items: center; min-height: 32px; padding: 7px 11px; border: 1px solid #484848; border-radius: 6px; background: #242424; color: #eee; cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; }
.file-button:hover { border-color: #8a8a8a; background: #303030; }
.icon-picker { position: relative; }
.icon-picker-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; min-width: 160px; padding: 5px; border: 1px solid #484848; border-radius: 7px; background: #202020; box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.quick-add-menu { top: calc(100% + 12px); right: auto; left: 0; min-width: 210px; padding: 7px; border-color: #353535; border-radius: 13px; background: #181818; }
.icon-picker-menu label { display: block; padding: 9px 10px; border-radius: 5px; color: #eee; cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
.icon-picker-menu label:hover { background: #343434; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, 100px); justify-content: center; gap: 30px 24px; overflow: visible; }
.item-card { width: 100px; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; cursor: pointer; }
.item-card img { display: block; width: 100px; height: 100px; margin: 0 auto 12px; border: 1px solid #303030; border-radius: 16px; object-fit: cover; background: linear-gradient(145deg, #181818, #0d0d0d); box-shadow: 0 14px 30px rgba(0,0,0,.22); transition: border-color .18s ease, box-shadow .18s ease; }
.item-card:hover img, .item-card:focus-visible img { border-color: #777; box-shadow: 0 0 10px rgba(255,255,255,.25), 0 0 26px rgba(255,255,255,.12); }
.item-card strong { display: block; min-height: 0; overflow: hidden; color: #aaa; font-size: 14px; font-weight: 400; line-height: 1.35; text-align: center; word-break: break-word; }
.item-card small { display: block; margin: 0 0 7px; color: var(--text); font-size: 17px; text-align: center; }
.item-card .copy-id { display: none; }
.copy-id { width: 100%; margin-top: 9px; padding: 7px 9px; border: 1px solid #484848; border-radius: 6px; background: #242424; color: #eeeeee; cursor: pointer; font-size: 11px; font-weight: 700; }
.copy-id:hover { border-color: #8a8a8a; background: #303030; }
.details { align-self: start; min-height: 260px; }
.details-icon { display: block; width: 128px; height: 128px; margin: 0 auto 14px; border: 1px solid #5f4928; border-radius: 10px; object-fit: cover; }
.detail-name { margin: 0 0 4px; font-size: 20px; text-align: center; }
.detail-id { margin: 0 0 18px; color: var(--gold); text-align: center; }
.field { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.field span { color: var(--muted); }
.empty-state, .empty-details { display: grid; place-content: center; min-height: 160px; color: var(--muted); text-align: center; }
.empty-details p { margin: 0 0 6px; color: var(--text); }
.empty-details span { font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; padding: 12px 17px; border: 1px solid #5b5b5b; border-radius: 8px; background: #242424; color: #f3f3f3; box-shadow: 0 12px 35px rgba(0,0,0,.55); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.help-dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 1px solid #3b3b3b; border-radius: 18px; background: #151515; color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.72); }
.help-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.help-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.help-header h2 { margin: 3px 0 0; font-size: 22px; }
.help-eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.help-close-button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid #3b3b3b; border-radius: 50%; background: #222; color: #eee; cursor: pointer; font-size: 25px; line-height: 1; }
.help-close-button:hover { background: #303030; }
.help-content { display: grid; gap: 12px; max-height: min(66vh, 560px); padding: 20px 22px 24px; overflow-y: auto; }
.help-content p { margin: 0; color: #b8b8b8; font-size: 14px; line-height: 1.5; }
.help-content strong { color: #f0f0f0; }
.help-example { margin-top: 4px; padding: 13px 14px; border: 1px solid #353535; border-radius: 10px; background: #1d1d1d; color: #d0d0d0; font-size: 13px; line-height: 1.5; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(224, 88, 109, .15); } }
@media (max-width: 700px) {
  .app-shell { width: min(100% - 24px, 980px); padding-top: 18vh; }
  .search-panel { min-height: 68px; padding: 6px 7px; grid-template-columns: 50px minmax(0, 1fr) 50px 50px; gap: 5px; }
  .voice-button, .help-button, .quick-add-button { width: 50px; height: 50px; }
  .search-icon { font-size: 27px; }
  .search-box { gap: 12px; }
  .search-box input { font-size: 16px; }
  .content { margin-top: 38px; }
  .catalog { grid-template-columns: repeat(auto-fill, 100px); gap: 28px 16px; }
  .item-card img { border-radius: 16px; }
}
