:root {
  color-scheme: light;
  --paper: #f6f7fa;
  --ink: #1c2033;
  --muted: #555d73;
  --line: #dce0e9;
  --violet: #5143b5;
  --violet-dark: #3e3292;
  --soft: #efeefa;
  --radius: 16px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
a { color: var(--violet); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #7264d4; outline-offset: 3px;
}
.skip { position: absolute; z-index: 3; left: 12px; top: -90px; background: white; padding: 12px; }
.skip:focus { top: 8px; }
.masthead { background: white; border-bottom: 1px solid var(--line); }
.masthead-inner, .page, .footer { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.masthead-inner { min-height: 76px; display: flex; align-items: stretch; justify-content: space-between; gap: 20px; }
.wordmark { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; font-size: 1.48rem; font-weight: 750; color: var(--ink); letter-spacing: -.06em; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--violet); display: inline-grid; place-items: center; position: relative; }
.mark::before { content: ""; width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; position: relative; left: -1px; top: -1px; }
.mark::after { content: ""; width: 8px; height: 2px; background: white; position: absolute; left: 17px; top: 20px; border-radius: 2px; transform: rotate(45deg); }
nav { display: flex; gap: clamp(16px, 3vw, 36px); align-items: stretch; }
nav a { display: inline-flex; gap: 5px; align-items: center; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .94rem; border-block: 3px solid transparent; }
nav a[aria-current] { color: var(--violet); border-bottom-color: var(--violet); }
.count { font-size: .75rem; background: var(--soft); color: var(--violet-dark); padding: 1px 5px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.page { flex: 1; padding-block: clamp(32px, 6vw, 76px) 60px; }
.page:focus { outline: none; }
.view-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; justify-content: space-between; margin-bottom: clamp(26px, 4vw, 44px); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2.15rem, 5vw, 3.65rem); letter-spacing: -.065em; line-height: 1.06; font-weight: 700; overflow-wrap: anywhere; }
h2 { font-size: 1.35rem; letter-spacing: -.04em; line-height: 1.25; }
h3 { font-size: 1.18rem; line-height: 1.38; letter-spacing: -.025em; overflow-wrap: anywhere; }
.lede, .section-note, .source-card p, .field-note, .small-facts dt, .fine, .list-meta, .match-secondary, .empty p, #remove-detail { color: var(--muted); line-height: 1.55; }
.lede { margin-top: 12px; }
.section-note { margin: 6px 0 18px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, .47fr); gap: clamp(20px, 3vw, 38px); align-items: start; }
.column, .side, .stack, .template-list { display: grid; gap: 14px; min-width: 0; }
.column { gap: 32px; }
.button, .text-button, .close, .template { border: 0; color: inherit; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; min-height: 44px; padding: 10px 16px; border-radius: 10px; font-size: .95rem; line-height: 1.35; font-weight: 650; }
.primary { background: var(--violet); color: white; }
.primary:hover:enabled { background: var(--violet-dark); }
.secondary { background: white; color: #363b53; border: 1px solid #cdd1e0; }
.secondary:hover:enabled, .close:hover { background: #f0f1f7; }
.danger { background: #9e3540; color: white; }
.plus-icon { width: 14px; height: 14px; position: relative; }
.plus-icon::before, .plus-icon::after { content: ""; background: currentColor; height: 2px; width: 12px; position: absolute; top: 6px; left: 1px; border-radius: 2px; }
.plus-icon::after { transform: rotate(90deg); }
.template { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%; background: white; border: 1px solid var(--line); padding: 18px 20px; border-radius: var(--radius); }
.template:hover:enabled { border-color: #9e96d5; background: #fdfdff; }
.template-text { display: grid; gap: 4px; min-width: 0; }
.template-text strong { font-size: 1.06rem; overflow-wrap: anywhere; }
.template-text small { font-size: .9rem; color: var(--muted); line-height: 1.45; }
.template-open { margin-left: auto; color: var(--violet); font-size: .9rem; font-weight: 650; }
.tile { width: 48px; height: 48px; flex: none; border-radius: 12px; display: grid; place-items: center; }
.clothes { background: #eeeafb; color: #5240a6; }
.equipment { background: #e4f0eb; color: #316a57; }
.hanger { position: relative; width: 25px; height: 20px; }
.hanger::before { content: ""; position: absolute; width: 6px; height: 7px; top: 0; left: 9px; border-radius: 5px; border: 2px solid currentColor; border-left-color: transparent; transform: rotate(-35deg); }
.hanger::after { content: ""; position: absolute; width: 23px; height: 13px; top: 8px; left: 1px; background: currentColor; clip-path: polygon(50% 0,100% 72%,100% 100%,0 100%,0 72%,50% 0,50% 20%,9% 78%,9% 82%,91% 82%,91% 78%,50% 20%); }
.dock { width: 25px; height: 13px; border: 2px solid currentColor; border-radius: 4px; position: relative; transform: rotate(-8deg); }
.dock::before, .dock::after { content: ""; position: absolute; background: currentColor; top: 4px; height: 2px; }
.dock::before { width: 5px; left: 3px; } .dock::after { width: 6px; right: 3px; }
.source-card, .result, .search-card, .empty, .error-box { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 2.5vw, 27px); }
.source-card { background: #eeeff8; border-color: #d9dced; }
.source-card h2 { font-size: 1.07rem; letter-spacing: -.02em; }
.source-card p { margin-top: 12px; font-size: .94rem; }
.source-card .source-label { display: flex; align-items: center; gap: 8px; color: #3e395a; margin-top: 21px; }
.source-dot { width: 9px; height: 9px; background: #7a6baa; border-radius: 3px; flex-shrink: 0; }
body[data-source="licensed"] .source-dot { background: #25745b; }
.small-facts { margin-top: 20px; padding-top: 16px; border-top: 1px solid #d5d8e6; }
.small-facts dt, .source-card .fine, .field-note, .list-meta, .match-secondary { font-size: .875rem; }
.small-facts dd { margin-top: 3px; font-size: .94rem; }
.small-facts div:not([hidden]) + div { margin-top: 11px; }
.source-card .lag { background: #fff3da; color: #714c0c; border-left: 3px solid #ba8426; padding: 8px 11px; border-radius: 4px; }
.source-card .button { margin-top: 17px; }
.search-card-top, .match-head, .row-actions, .price-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search-card-top, .match-head { align-items: flex-start; justify-content: space-between; }
.status { font-size: .8rem; font-weight: 650; border-radius: 6px; padding: 4px 8px; white-space: nowrap; }
.active-status { color: #245c48; background: #e3f2ea; }
.paused-status { color: #525669; background: #eceef3; }
.unseen { color: #483997; background: var(--soft); }
.filter-list { list-style: none; display: flex; gap: 7px; flex-wrap: wrap; padding: 0; margin: 15px 0; }
.filter-list li { font-size: .87rem; background: #f3f4f8; padding: 5px 8px; border-radius: 5px; overflow-wrap: anywhere; }
.row-actions { margin-top: 10px; gap: 4px 16px; }
.text-button { padding: 6px 0; min-height: 40px; font-size: .92rem; color: var(--violet); background: transparent; font-weight: 600; }
.text-button:hover:enabled { text-decoration: underline; }
.text-button.remove { color: #82434d; }
.inbox { max-width: 760px; }
#inbox-page { width: min(100%, 760px); margin-inline: auto; }
.empty h2 { margin-bottom: 8px; }
.check-summary { overflow-wrap: anywhere; }
.check-summary h2 { font-size: 1.15rem; }
.check-summary p { margin-top: 6px; }
.empty:has(#first-check-heading) { overflow-wrap: anywhere; }
.empty p { max-width: 52ch; }
.empty a { margin-top: 16px; }
.result-header { display: grid; gap: 4px; }
.price-row { gap: 8px 18px; margin: 14px 0 5px; }
.price { font-size: 1.45rem; line-height: 1.2; letter-spacing: -.035em; font-weight: 700; }
.advantage { border-radius: 5px; padding: 4px 7px; font-size: .86rem; background: #e4f2e9; color: #235a41; font-weight: 650; }
.match-secondary { overflow-wrap: anywhere; }
.footer { padding: 22px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer span:first-child { font-weight: 700; }
.initial-state { color: var(--muted); }
.error-box p { margin-bottom: 12px; }
#feedback:not(:empty) { position: fixed; z-index: 4; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #22273a; color: white; width: max-content; max-width: calc(100% - 28px); padding: 12px 17px; border-radius: 10px; font-size: .94rem; }
dialog { color: var(--ink); background: white; margin: auto; padding: clamp(18px, 4vw, 30px); border: 1px solid var(--line); border-radius: 18px; width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 28px); overflow: auto; }
dialog::backdrop { background: #20243c66; }
#search-dialog { padding: 0; overflow: hidden; }
#search-form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
#search-form .dialog-top { margin: 0; padding: 16px 22px 10px; }
.editor-body { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; min-height: 0; padding: 8px 22px 16px; }
#more-filters { border-top: 1px solid var(--line); margin-top: 18px; }
#more-filters > summary { cursor: pointer; font-size: .92rem; font-weight: 650; padding: 14px 0; }
#more-filters > summary span { display: block; padding: 4px 0 0 15px; color: var(--muted); font-size: .82rem; font-weight: 400; }
#search-form .dialog-actions { margin: 0; padding: 12px 22px; border-top: 1px solid var(--line); }
#search-form .form-error:not([hidden]) { margin: 0; padding: 8px 22px; }
@media (max-width: 390px) {
  #search-form .dialog-top, #search-form .dialog-actions, .editor-body { padding-inline: 14px; }
  #search-form .editor-body > .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #search-form .dialog-actions { gap: 8px; }
}
body:has(dialog[open]) { overflow: hidden; }
.dialog-top, .dialog-actions { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.dialog-top { margin-bottom: 20px; }
.dialog-top h2 { font-size: 1.55rem; }
.close { display: grid; place-items: center; width: 40px; height: 40px; background: #f3f4f7; border-radius: 50%; font-size: 1.6rem; line-height: 1; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.fields label { display: flex; flex-direction: column; min-width: 0; gap: 5px; font-weight: 600; font-size: .9rem; }
.wide { grid-column: 1 / -1; }
.field-note { font-weight: 400; }
input, select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #bec3d1; border-radius: 8px; padding: 9px 10px; color: var(--ink); background-color: white; font-size: 1rem; }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, #555d73 50%), linear-gradient(135deg, #555d73 50%, transparent 50%); background-position: calc(100% - 13px) 53%, calc(100% - 8px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
.dialog-actions { margin-top: 24px; justify-content: flex-end; }
.form-error { color: #95323c; margin-top: 12px; font-size: .95rem; }
.form-hint { margin-top: 14px; }
.archive { margin-top: 15px; padding-top: 18px; border-top: 1px solid var(--line); }
.archive h3 { margin-bottom: 5px; font-size: 1.02rem; }
.archive-row { padding-top: 13px; margin-top: 12px; border-top: 1px solid var(--line); display: grid; justify-items: start; gap: 5px; }
.archive-row strong { overflow-wrap: anywhere; }
.archive-row a { font-size: .875rem; }
.phone-choice { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; font-size: .95rem; line-height: 1.45; cursor: pointer; }
.phone-choice input { flex: none; width: 20px; min-height: 20px; height: 20px; margin: 0; accent-color: var(--violet); }
.category-field { min-width: 0; }
.category-field > span, .picker-body > label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 5px; }
#category-picker { border: 1px solid #bec3d1; border-radius: 8px; }
#category-picker summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; cursor: pointer; min-height: 44px; list-style: none; }
#category-picker summary::-webkit-details-marker { display: none; }
#category-value { overflow-wrap: anywhere; }
.picker-verb { font-size: .86rem; font-weight: 600; color: var(--violet); }
.picker-body { border-top: 1px solid var(--line); padding: 12px; }
.picker-path, .picker-footer { display: flex; align-items: center; flex-wrap: wrap; column-gap: 12px; }
.picker-list { list-style: none; padding: 0; margin: 4px 0; max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.picker-list li + li { border-top: 1px solid var(--line); }
.picker-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px; min-height: 42px; border: 0; background: white; text-align: left; color: var(--ink); }
.picker-option:hover, .picker-option:focus-visible { background: var(--soft); }
.picker-option > span { display: grid; gap: 3px; overflow-wrap: anywhere; }
.picker-option small { color: var(--muted); line-height: 1.35; }
.picker-branch { flex: none; font-size: .85rem; color: var(--violet); }
#category-feedback { margin: 7px 0; font-size: .86rem; }
#category-feedback:empty { display: none; }
.picker-footer { border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { margin-top: 3px; }
  .masthead-inner { min-height: 62px; }
}
@media (max-width: 480px) {
  .masthead-inner, .page, .footer { width: calc(100% - 32px); }
  .masthead-inner { gap: 8px; }
  .wordmark { font-size: 1.24rem; gap: 7px; }
  .mark { width: 27px; height: 27px; }
  nav { gap: 12px; } nav a { font-size: .86rem; }
  .view-heading { gap: 18px; }
  .template { gap: 12px; padding: 15px; }
  .template-open { display: none; } .tile { height: 40px; width: 40px; }
  .fields { gap: 12px 10px; }
}
@media (max-width: 350px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .masthead-inner { flex-wrap: wrap; padding-top: 9px; }
  nav a { min-height: 42px; }
}
