:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #64615b;
  --blue: #205b91;
  --blue-strong: #164a79;
  --blue-soft: #e7edf2;
  --beige: #e9e5dc;
  --beige-deep: #cec8bc;
  --paper: #f8f6f0;
  --line: #d3cfc5;
  --coal: #402657;
  --coal-soft: #57396f;
  --red: #a23c32;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--beige);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, #40265708 25%, transparent 25%) 0 0 / 9px 9px,
    var(--beige);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #205b9140;
  outline-offset: 2px;
}

.topbar {
  height: 68px;
  padding: 0 max(5vw, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--blue);
  background: var(--coal);
}

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.install-button { min-height: 32px; padding: 0 10px; border: 1px solid #cbd5df; border-radius: 4px; background: #f5f8fb; color: var(--blue); font-size: 10px; font-weight: 600; }
.install-button:hover { border-color: #8da5bc; background: var(--blue-soft); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f4f0e8;
  text-decoration: none;
}

.brand-name {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .25px;
  text-transform: uppercase;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: #f1ede4;
  color: var(--coal);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.brand-light { margin-left: 4px; color: #a9c3d9; font-weight: 500; }
.local-note { display: flex; align-items: center; gap: 8px; color: #d0ccc3; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 0; background: #8fb5d6; transform: rotate(45deg); }

.page { width: min(920px, calc(100% - 40px)); margin: 0 auto; }

.intro {
  position: relative;
  margin-top: 28px;
  padding: 96px 34px 30px;
  overflow: hidden;
  border-left: 4px solid var(--blue);
  background:
    linear-gradient(110deg, #ffffff12 1px, transparent 1px) 0 0 / 24px 24px,
    var(--coal);
  color: #f5f1e9;
}
.intro::after {
  position: absolute;
  top: -44px;
  right: -30px;
  width: 190px;
  height: 190px;
  border: 1px solid #ffffff14;
  content: "";
  transform: rotate(45deg);
  pointer-events: none;
}
.eyebrow { margin: 0 0 10px; color: #7ca8cc; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
h1, h2, h3, p { margin-top: 0; }

h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-size: clamp(32px, 4.2vw, 44px);
  line-height: 1.2;
  letter-spacing: -.55px;
  font-weight: 600;
}

.intro-copy { position: relative; z-index: 1; max-width: 560px; margin-bottom: 22px; color: #c7c3ba; font-size: 14px; line-height: 1.6; }

.search-form {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 7px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f8f6f0;
  box-shadow: 4px 4px 0 #26163832;
}

.search-form:focus-within { border-color: #7395b5; box-shadow: 4px 4px 0 #26163832, 0 0 0 3px #205b9112; }
.search-icon { width: 19px; height: 19px; flex: none; color: #718398; }
.search-icon svg { width: 100%; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.search-form input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-form input::placeholder { color: #8998a7; }
.search-actions { display: flex; flex: none; gap: 7px; }
.search-form button { height: 40px; padding: 0 13px; border: 0; border-radius: 4px; background: var(--blue); color: white; font-size: 11px; font-weight: 600; transition: background .15s ease; white-space: nowrap; }
.search-form button:hover { background: var(--blue-strong); }
.search-form button span { padding-left: 5px; font-size: 16px; }
.search-form .search-direct-button { border: 1px solid #57396f; background: #57396f; color: #f5f1e9; }
.search-form .search-direct-button:hover { border-color: #8da5bc; background: var(--blue-soft); }
.form-message { min-height: 18px; margin: 8px 0 0; color: var(--red); font-size: 12px; }
.form-message.success-message { color: var(--green); }

.list-section { padding: 23px 0 0; border-top: 1px solid var(--beige-deep); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.section-heading .eyebrow { margin-bottom: 7px; }
h2 { margin: 0; font-size: 19px; letter-spacing: -.35px; font-weight: 650; }
.count { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.list-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.import-hint { color: var(--muted); font-size: 10px; }
.list-actions .secondary-button { white-space: nowrap; }
.list-manager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; border-bottom: 1px solid var(--beige-deep); }
.list-tabs { display: flex; min-width: 0; gap: 5px; overflow-x: auto; }
.list-tab { display: inline-flex; min-height: 39px; flex: none; align-items: center; gap: 7px; padding: 0 11px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.list-tab[aria-selected="true"] { border-bottom-color: var(--list-color); color: var(--ink); }
.list-tab-color { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--list-color); }
.list-tab-count { min-width: 18px; padding: 2px 5px; border-radius: 10px; background: #edf0f2; color: var(--muted); font-size: 9px; text-align: center; }
.list-manager-actions { display: flex; flex: none; align-items: center; gap: 12px; }
.list-manager-hint { margin: -8px 0 13px; color: var(--muted); font-size: 10px; }
.secondary-button, .primary-button { min-height: 35px; padding: 0 11px; border: 1px solid #cbd5df; border-radius: 4px; background: var(--paper); color: var(--blue); font-size: 11px; font-weight: 600; }
.secondary-button:hover { border-color: #8da5bc; background: #f4f7fa; }
.primary-button { border-color: var(--blue); background: var(--blue); color: #fff; }
.primary-button:hover:not(:disabled) { background: var(--blue-strong); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; }
.text-button { padding: 4px 0; border: 0; background: none; color: var(--blue); font-size: 11px; }
.text-button:hover { color: var(--blue-strong); }
.template-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; padding: 12px 14px; border: 1px solid #bdb7ab; border-left: 3px solid var(--coal); border-radius: 2px; background: #f0ede5; }
.template-note strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; }
.template-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.template-actions { display: flex; flex: none; flex-wrap: wrap; gap: 8px; }
.template-note .secondary-button { flex: none; }

.product-list { display: grid; gap: 7px; }
.product-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #c8c4bb; border-left: 3px solid var(--coal); border-radius: 2px; background: var(--paper); box-shadow: 2px 2px 0 #2616380c; }
.product-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 5px; background: var(--blue-soft); color: var(--blue); }
.product-icon svg { width: 20px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.product-info { min-width: 0; flex: 1; }
.product-name { margin: 0 0 4px; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; font-weight: 600; }
.product-meta { margin: 0; color: var(--muted); font-size: 10px; }
.product-specifications { margin: 6px 0 0; color: var(--blue); font-size: 10px; line-height: 1.45; }
.pending-label { flex: none; padding: 5px 8px; border-radius: 3px; background: var(--beige); color: #76674d; font-size: 10px; }
.price-label { background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; }
.remove-button { width: 29px; height: 29px; flex: none; border: 0; border-radius: 4px; background: transparent; color: #788798; font-size: 18px; }
.remove-button:hover { background: #f7e9e5; color: var(--red); }
.store-actions, .store-search-feedback, .store-offers { width: 100%; }
.store-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 2px; }
.store-search-button { min-height: 32px; padding: 0 11px; border: 1px solid #a7a49d; border-radius: 2px; background: #f3f1eb; color: #252523; font-size: 10px; font-weight: 600; }
.store-search-button:hover { border-color: #8da5bc; background: var(--blue-soft); }
.store-search-google-shopping { border-color: var(--coal); background: var(--coal); color: #f5f1e9; }

.empty-state { padding: 27px 10px 30px; text-align: center; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 8px; background: #eee7da; color: #7c705c; }
.empty-icon svg { width: 26px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h3 { margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }

.connection-note { display: flex; gap: 11px; align-items: flex-start; margin: 23px 0 55px; padding: 14px; border: 1px solid #bdb7ab; border-left: 3px solid var(--coal); border-radius: 2px; background: #f0ede5; }
.connection-icon { width: 17px; height: 17px; flex: none; display: grid; place-items: center; border: 1px solid #9a8c74; border-radius: 50%; color: #786b55; font-family: serif; font-size: 12px; font-weight: 700; }
.connection-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.connection-note strong { color: var(--ink); }
.import-dialog { width: min(760px, calc(100% - 32px)); max-height: min(86vh, 760px); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--paper); box-shadow: 0 20px 80px #172b4330; }
.import-dialog::backdrop { background: #172b4380; }
.list-dialog { width: min(420px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--paper); box-shadow: 0 20px 80px #172b4330; }
.list-dialog::backdrop { background: #172b4380; }
.list-dialog form { display: grid; gap: 14px; }
.list-dialog h2 { margin: -8px 0 0; }
.list-field { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.list-field input[type="text"] { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 13px; }
.list-field input[type="color"] { width: 54px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.dialog-close-form { position: absolute; top: 17px; right: 17px; }
.dialog-close { width: 32px; height: 32px; border: 0; border-radius: 4px; background: var(--beige); color: var(--muted); font-size: 21px; line-height: 1; }
.import-dialog > .eyebrow { margin-bottom: 7px; }
.import-dialog h2 { margin: 0 42px 6px 0; font-size: 22px; }
.dialog-description, .privacy-note { color: var(--muted); font-size: 12px; }
.dialog-description { margin-bottom: 19px; overflow-wrap: anywhere; }
.column-mapping { display: grid; gap: 12px; margin-bottom: 15px; }
.sheet-mapping { min-width: 0; margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 4px; }
.sheet-mapping legend { padding: 0 5px; color: var(--ink); font-size: 11px; font-weight: 700; }
.sheet-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mapping-field { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.mapping-field select { min-width: 0; width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 11px; }
.mapping-field input { width: 120px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 12px; }
.spreadsheet-setup-hint { margin: 0 0 12px; padding: 10px; border-left: 3px solid var(--blue); background: var(--beige); color: var(--ink); font-size: 12px; line-height: 1.5; }
.start-row-field { margin-bottom: 12px; }
.preview-summary { margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.preview-wrap { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
.preview-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.preview-table th, .preview-table td { max-width: 240px; padding: 10px; border-bottom: 1px solid #edf0f2; overflow-wrap: anywhere; }
.preview-table th { position: sticky; top: 0; background: var(--beige); color: var(--ink); font-size: 10px; font-weight: 700; }
.preview-table td { color: #33465a; }
.preview-table tr:last-child td { border-bottom: 0; }
.preview-table .sheet-start td { border-top: 2px solid var(--beige-deep); }
.preview-table .remaining-rows { color: var(--muted); text-align: center; }
.import-error { margin: 12px 0; padding: 11px; border-radius: 4px; background: #f7e9e5; color: var(--red); font-size: 12px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.privacy-note { margin: 15px 0 0; font-size: 10px; }
footer { padding: 18px; border-top: 3px solid var(--blue); color: #cbc7be; background: var(--coal); text-align: center; font-size: 10px; }
footer span { padding: 0 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { border-bottom-color: var(--blue); }
.brand-mark { background: #f1ede4; }
.brand-light { color: #a9c3d9; }
.status-dot { background: #8fb5d6; }

body {
  background:
    linear-gradient(135deg, #40265708 25%, transparent 25%) 0 0 / 9px 9px,
    var(--beige);
}

.intro {
  border-left-color: var(--blue);
  background:
    linear-gradient(110deg, #ffffff12 1px, transparent 1px) 0 0 / 24px 24px,
    var(--coal);
  color: #f5f1e9;
  box-shadow: 8px 8px 0 var(--coal);
}

.cat-sticker {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 18px;
  width: 145px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(3px 4px 0 var(--coal));
  transform: rotate(-3deg);
}

.intro::before {
  display: none;
}

.eyebrow { color: #7ca8cc; }
.intro-copy { color: #c7c3ba; }
.search-form { border-color: var(--line); box-shadow: 4px 4px 0 #26163832; }
.search-form:focus-within { box-shadow: 4px 4px 0 #26163832, 0 0 0 3px #205b9112; }
.search-form button { background: var(--blue); }
.search-form button:hover { background: var(--blue-strong); }
.search-form .search-direct-button { border-color: #57396f; background: #57396f; }
.search-form .search-direct-button:hover { border-color: #8da5bc; background: var(--blue-soft); }

.list-section { border-top-color: #c9b99f; }
.list-manager { border-bottom-color: #c9b99f; }
.list-tab-count { border-radius: 10px; background: #edf0f2; color: var(--muted); }
.secondary-button, .primary-button { border-color: #cbd5df; border-radius: 4px; box-shadow: 2px 2px 0 #26163820; }
.secondary-button:hover { border-color: #8da5bc; background: #f4f7fa; }
.primary-button, .primary-button:hover:not(:disabled) { border-color: var(--blue); background: var(--blue); }
.text-button { color: var(--blue); }
.text-button:hover { color: var(--blue-strong); }

.template-note {
  position: relative;
  border-color: #bdb7ab;
  border-left-color: var(--coal);
  background: #f0ede5;
  box-shadow: 4px 4px 0 #26163820;
}
.template-note::before {
  position: absolute;
  top: -8px;
  right: 22px;
  width: 56px;
  height: 14px;
  background: #d8d2c5c9;
  content: "";
  transform: rotate(5deg);
}

.product-card {
  border-color: #c8c4bb;
  border-left-color: var(--coal);
  box-shadow: 3px 3px 0 #2616381a;
}
.product-card:nth-child(3n + 2) { border-left-color: #5c7891; background: #f1f3f3; }
.product-card:nth-child(3n) { border-left-color: #8b806e; background: #f0ede5; }
.product-icon { border-radius: 2px; background: var(--blue-soft); }
.product-card:nth-child(3n + 2) .product-icon { background: #e4e8e8; color: #465c6d; }
.product-card:nth-child(3n) .product-icon { background: #e8e2d7; color: #665b4d; }
.pending-label { border-radius: 2px; background: var(--beige); color: #76674d; }
.price-label { background: var(--blue-soft); color: var(--blue); }
.store-search-button { border-color: #a7a49d; background: #f3f1eb; }
.store-search-button:hover { border-color: #8da5bc; background: var(--blue-soft); }
.store-search-google-shopping { border-color: var(--coal); background: var(--coal); color: #f5f1e9; }

.empty-icon { border-radius: 2px; background: #eee7da; color: #7c705c; transform: rotate(-4deg); }
.connection-note { border-color: #bdb7ab; background: #f0ede5; box-shadow: 4px 4px 0 #26163820; }
footer { border-top-color: var(--blue); }

@media (max-width: 560px) {
  .topbar { height: 60px; padding: 0 18px; }
  .topbar-actions { gap: 8px; }
  .local-note { max-width: 130px; font-size: 10px; }
  .page { width: calc(100% - 36px); }
  .intro { margin-top: 20px; padding: 96px 18px 24px; }
  h1 { letter-spacing: -1.5px; }
  .desktop-break { display: none; }
  .intro-copy { font-size: 14px; }
  .search-form { height: auto; flex-wrap: wrap; gap: 9px; padding: 10px; }
  .search-icon { margin-left: 3px; }
  .search-form input { min-height: 36px; font-size: 13px; }
  .search-actions { width: 100%; }
  .search-form button { min-width: 0; flex: 1; padding: 0 8px; font-size: 10px; }
  .section-heading { align-items: center; gap: 10px; }
  h2 { font-size: 17px; }
  .section-heading { flex-wrap: wrap; }
  .list-actions { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .list-manager { align-items: flex-start; flex-direction: column; gap: 6px; }
  .list-tabs { width: 100%; }
  .list-manager-actions { width: 100%; justify-content: space-between; padding-bottom: 7px; }
  .template-note { align-items: flex-start; flex-direction: column; }
  .template-actions { width: 100%; }
  .template-actions .secondary-button { flex: 1; }
  .pending-label { display: none; }
  .product-card { gap: 10px; padding: 12px; }
  .store-offer { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .store-offer a { grid-column: 1 / -1; }
  .connection-note { margin-bottom: 45px; }
  .import-dialog { padding: 23px 17px; }
  .import-dialog h2 { font-size: 19px; }
  .sheet-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-table th, .preview-table td { padding: 8px 6px; font-size: 10px; }
  .intro { box-shadow: 5px 5px 0 var(--coal); }
  .product-card { box-shadow: 2px 2px 0 #2616381a; }
  .connection-note { box-shadow: 3px 3px 0 #26163820; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
