:root {
  color-scheme: light;
  --page: #eee9dc;
  --surface: #eee9dc;
  --surface-subtle: #eee9dc;
  --ink: #18352f;
  --ink-secondary: #18352f;
  --muted: #18352f;
  --faint: #18352f;
  --line: #18352f;
  --accent: #c84b2b;
  --accent-hover: #c84b2b;
  --accent-text: #c84b2b;
  --danger: #c84b2b;
  --badge-product: #18352f;
  --badge-product-text: #eee9dc;
  --badge-cart: #18352f;
  --badge-cart-text: #eee9dc;
  --card-radius: 0;
  --control-radius: 0;
  --font: "Segoe UI", Arial, sans-serif;
  --display-font: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101b1d;
  --surface: #101b1d;
  --surface-subtle: #101b1d;
  --ink: #edf0e6;
  --ink-secondary: #edf0e6;
  --muted: #edf0e6;
  --faint: #edf0e6;
  --line: #edf0e6;
  --accent: #d2e46c;
  --accent-hover: #d2e46c;
  --accent-text: #d2e46c;
  --danger: #d2e46c;
  --badge-product: #edf0e6;
  --badge-product-text: #101b1d;
  --badge-cart: #edf0e6;
  --badge-cart-text: #101b1d;
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
  transition: none !important;
  animation: none !important;
}

html { min-width: 320px; min-height: 100%; background: var(--page); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page-shell { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.55px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--surface);
}

.brand-mark svg { width: 21px; height: 21px; }
.brand-period { color: var(--accent); }

.header-controls { display: flex; align-items: center; gap: 20px; }

.theme-picker {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.theme-picker-label {
  padding: 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
}

.theme-choice {
  min-height: 29px;
  padding: 5px 9px;
  border: 0;
  border-bottom: 2px solid var(--surface);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
}

.theme-choice:hover { background: var(--surface); }
.theme-choice.is-active { border-bottom-color: var(--accent); color: var(--ink); font-weight: 650; }

.topbar-note, .footer-local {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot { width: 7px; height: 7px; flex: 0 0 auto; background: var(--accent); }

.text-button {
  padding: 7px 0 7px 8px;
  border: 0;
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.text-button:hover { color: var(--accent); }
.text-button span { margin-left: 4px; }

.auth-layout {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, .82fr);
  align-items: center;
  gap: clamp(48px, 7vw, 100px);
  padding: 70px 42px 82px;
}

.auth-copy {
  position: relative;
  max-width: 590px;
  padding: 8px 0 12px 25px;
  border-left: 4px solid var(--accent);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .075em;
}

.eyebrow-line { width: 16px; height: 1px; background: var(--accent); }

.auth-copy h1 {
  max-width: 640px;
  margin: 23px 0 19px;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(50px, 5.5vw, 72px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.06em;
}

.auth-copy h1 span { color: var(--accent); }

.auth-copy > p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.auth-points { display: grid; gap: 0; margin-top: 29px; color: var(--ink-secondary); font-size: 12px; }
.auth-points > span { min-height: 43px; display: flex; align-items: center; border-top: 1px solid var(--line); }
.auth-points > span:last-child { border-bottom: 1px solid var(--line); }
.check-icon { width: 23px; height: 23px; display: inline-grid; flex: 0 0 auto; place-items: center; margin-right: 11px; background: var(--ink); color: var(--surface); font-size: 10px; font-weight: 700; }
.orbit-art { display: none; }

.auth-card {
  width: 100%;
  max-width: 420px;
  justify-self: end;
  padding: 34px;
  border: 1px solid var(--ink);
  border-top: 5px solid var(--accent);
  border-radius: var(--card-radius);
  background: var(--surface);
}

.card-heading { display: flex; align-items: center; gap: 9px; }
.card-heading .eyebrow { font-size: 10px; letter-spacing: .045em; }
.card-icon { width: 25px; height: 25px; display: grid; place-items: center; background: var(--ink); color: var(--page); font-size: 14px; }

.auth-card h2 {
  margin: 22px 0 7px;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 27px;
  font-weight: 620;
  line-height: 1.3;
  letter-spacing: -.035em;
}

.card-description { min-height: 38px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 21px 0 20px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-subtle);
}

.auth-tab {
  min-height: 34px;
  border: 1px solid var(--surface);
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
}

.auth-tab.is-active { border-color: var(--line); background: var(--surface); color: var(--ink); }

label { display: block; margin: 14px 0 6px; color: var(--ink-secondary); font-size: 11px; font-weight: 600; }
.input-wrap { position: relative; }

.input-wrap input, .add-panel input, .select-wrap select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}

.input-wrap input { padding: 0 12px 0 36px; }
.input-wrap input::placeholder, .add-panel input::placeholder { color: var(--faint); opacity: 1; }
.input-wrap input:focus, .add-panel input:focus, .select-wrap select:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }

.input-icon { position: absolute; top: 50%; left: 12px; color: var(--faint); font-size: 13px; transform: translateY(-50%); pointer-events: none; }
.lock-icon { font-size: 15px; }

.primary-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--accent);
  border-radius: var(--control-radius);
  background: var(--ink);
  color: var(--page);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.primary-button:hover { border-color: var(--accent-hover); background: var(--ink); }
:root[data-theme="dark"] .primary-button { color: var(--page); }
:root[data-theme="dark"] .primary-button:hover { color: var(--page); }
.primary-button:disabled { cursor: wait; }
.auth-submit { width: 100%; margin-top: 10px; }
.auth-submit span, .save-button span { font-size: 15px; font-weight: 400; }

.privacy-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 17px 0 0; color: var(--muted); font-size: 10px; }
.privacy-note span { color: var(--accent); font-size: 13px; }
.form-message { min-height: 17px; margin: 7px 0 0; font-size: 11px; line-height: 1.5; }
.form-message.is-error { color: var(--danger); }
.form-message.is-success { color: var(--accent-text); }

.dashboard { padding: 52px 0 36px; }

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 31px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ink);
}

.dashboard-heading h1 {
  margin: 11px 0 7px;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.045em;
}

.dashboard-heading > div > p { margin: 0; color: var(--muted); font-size: 13px; }
.total-card { min-width: 190px; display: flex; align-items: center; gap: 13px; padding: 13px 16px; border: 1px solid var(--ink); border-radius: var(--card-radius); background: var(--ink); color: var(--surface); }
.total-icon { width: 37px; height: 37px; display: grid; place-items: center; background: var(--accent); color: var(--ink); font-size: 18px; }
.total-card strong, .total-card small { display: block; }
.total-card strong { color: var(--surface); font-size: 21px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.total-card small { margin-top: 2px; color: var(--surface); font-size: 10px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 25px; }
.links-panel, .add-panel { border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--surface); }
.links-panel { min-height: 360px; padding: 24px 25px 16px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 19px; border-bottom: 1px solid var(--ink); }
.panel-heading .eyebrow { font-size: 9px; }
.panel-heading h2, .add-panel h2 { margin: 5px 0 0; color: var(--ink); font-family: var(--display-font); font-size: 21px; font-weight: 620; line-height: 1.35; letter-spacing: -.035em; }

.filter-group { display: flex; gap: 0; padding: 2px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-subtle); }
.filter-button { min-height: 27px; padding: 5px 9px; border: 0; border-radius: 0; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 550; cursor: pointer; }
.filter-button.is-active { background: var(--ink); color: var(--surface); }

.search-field {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 2px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface-subtle);
  color: var(--muted);
}
.search-field:focus-within { border-color: var(--accent); }
.search-icon { flex: 0 0 auto; font-size: 19px; line-height: 1; }
.search-field input {
  width: 100%;
  min-width: 0;
  height: 37px;
  padding: 0;
  border: 0;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
}
.search-field input::placeholder { color: var(--faint); opacity: 1; }
.search-hint { flex: 0 0 auto; color: var(--faint); font-size: 8px; font-weight: 650; letter-spacing: .05em; }

.link-list { display: grid; }
.link-card { min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.link-card:last-child { border-bottom: 0; }
.link-card-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); font-size: 17px; }
.product-icon { background: var(--badge-product); color: var(--badge-product-text); }
.cart-icon { background: var(--badge-cart); color: var(--badge-cart-text); }
.link-details { min-width: 0; }
.link-details h3 { overflow: hidden; margin: 0 0 3px; color: var(--ink); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.link-url { display: block; overflow: hidden; max-width: 100%; color: var(--muted); font-size: 10px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .015em; }
.link-url:hover { color: var(--accent-text); text-decoration: underline; }
.link-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.type-badge { padding: 3px 7px; font-size: 9px; font-weight: 600; }
.product-badge { background: var(--badge-product); color: var(--badge-product-text); }
.cart-badge { background: var(--badge-cart); color: var(--badge-cart-text); }
.tag-chip { min-height: 21px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-subtle); color: var(--accent-text); font-size: 9px; cursor: pointer; }
.tag-chip:hover { border-color: var(--accent); background: var(--surface); }
.card-actions { display: flex; align-items: center; gap: 5px; }
.open-link, .delete-link { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--muted); text-decoration: none; font-size: 14px; cursor: pointer; }
.open-link:hover, .delete-link:hover { border-color: var(--accent); color: var(--accent-text); }
.delete-link:hover { border-color: var(--danger); color: var(--danger); }

.empty-state { display: flex; flex-direction: column; align-items: center; padding: 37px 18px 26px; text-align: center; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-subtle); color: var(--accent-text); font-size: 19px; }
.empty-state h3 { margin: 13px 0 4px; color: var(--ink); font-family: var(--display-font); font-size: 14px; font-weight: 600; }
.empty-state p { max-width: 340px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.secondary-button { min-height: 35px; display: flex; align-items: center; gap: 8px; margin-top: 15px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink-secondary); font-size: 10px; font-weight: 600; cursor: pointer; }
.secondary-button:hover { border-color: var(--accent); color: var(--accent-text); }
.no-matches { margin: 21px 0; color: var(--muted); font-size: 11px; text-align: center; }

.add-panel { padding: 23px 23px 0; border-top: 4px solid var(--accent); }
.add-panel-top { display: flex; align-items: center; gap: 9px; }
.add-panel-top .eyebrow { font-size: 9px; }
.add-icon { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-subtle); color: var(--accent-text); font-size: 15px; }
.add-panel h2 { margin-top: 16px; font-size: 23px; }
.add-intro { margin: 6px 0 18px; color: var(--muted); font-size: 12px; }
.add-panel label { margin: 14px 0 6px; font-size: 10px; }
.add-panel input, .select-wrap select { height: 40px; padding: 0 11px; font-size: 11px; }
.add-panel .optional-label { margin-left: 4px; color: var(--faint); font-size: 9px; font-weight: 400; }
.field-hint { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.url-wrap input { padding-left: 32px; }
.url-wrap .input-icon { left: 11px; font-size: 13px; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 32px; cursor: pointer; }
.select-wrap > span { position: absolute; top: 50%; right: 10px; color: var(--muted); font-size: 14px; pointer-events: none; transform: translateY(-55%); }
.save-button { width: 100%; min-height: 42px; margin-top: 9px; font-size: 11px; }
.add-panel .form-message { min-height: 0; }
.panel-footnote { display: flex; align-items: center; gap: 7px; margin: 18px -23px 0; padding: 13px 23px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.panel-footnote span { color: var(--accent); font-size: 12px; }
.storage-note { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 17px 0 0; color: var(--muted); font-size: 10px; }
.storage-note .status-dot { width: 6px; height: 6px; }

.footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--ink-secondary); font-size: 11px; font-weight: 600; }
.footer-muted { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 400; }
.footer-local { font-size: 10px; }
.is-hidden { display: none !important; }

.auth-copy::after {
  display: block;
  margin-top: 22px;
  padding-top: 11px;
  border-top: 1px solid var(--ink);
  color: var(--accent-text);
  content: "FINDEN   /   MERKEN   /   WIEDERFINDEN";
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

@media (max-width: 900px) {
  .page-shell { width: min(720px, calc(100% - 40px)); }
  .auth-layout { min-height: 0; grid-template-columns: 1fr; gap: 38px; padding: 48px 12px 55px; }
  .auth-copy { max-width: 620px; }
  .auth-copy h1 { max-width: 590px; font-size: clamp(48px, 8vw, 64px); }
  .auth-card { max-width: none; justify-self: stretch; }
  .content-grid { grid-template-columns: 1fr; }
  .add-panel { order: -1; }
  .add-panel h2 br { display: none; }
  .add-panel-top { margin-bottom: -7px; }
  .dashboard { padding-top: 38px; }
}

@media (max-width: 600px) {
  .page-shell { width: calc(100% - 32px); }
  .topbar { min-height: 64px; flex-wrap: wrap; gap: 9px; padding: 12px 0; }
  .brand { font-size: 17px; }
  .header-controls { min-width: 0; flex: 1 1 100%; justify-content: space-between; gap: 8px; }
  .theme-picker { min-width: 0; }
  .theme-picker-label { padding: 0 4px; font-size: 9px; }
  .theme-choice { min-height: 28px; padding: 5px 8px; font-size: 10px; }
  .topbar-note { display: none; }
  .auth-layout { gap: 27px; padding: 32px 0 40px; }
  .auth-copy { padding-left: 17px; }
  .auth-copy h1 { margin: 15px 0 11px; font-size: 41px; letter-spacing: -.05em; }
  .auth-copy > p { font-size: 13px; line-height: 1.65; }
  .auth-points { gap: 0; margin-top: 20px; font-size: 11px; }
  .auth-points > span { min-height: 39px; }
  .auth-copy::after { margin-top: 17px; font-size: 8px; }
  .auth-card { padding: 25px 20px 22px; }
  .auth-card h2 { margin-top: 15px; font-size: 22px; }
  .auth-tabs { margin: 17px 0 15px; }
  .dashboard { padding-top: 27px; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 19px; }
  .dashboard-heading h1 { margin-top: 8px; font-size: 31px; }
  .total-card { min-width: auto; }
  .links-panel { min-height: 285px; padding: 17px 14px 10px; }
  .panel-heading { align-items: flex-start; flex-direction: column; gap: 11px; }
  .filter-group { width: 100%; }
  .filter-button { flex: 1; }
  .link-card { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; padding: 12px 0; }
  .link-card-icon { width: 31px; height: 31px; }
  .card-actions { gap: 4px; }
  .open-link, .delete-link { width: 27px; height: 27px; }
  .link-meta { flex-wrap: wrap; gap: 5px; }
  .add-panel { padding: 19px 17px 0; }
  .panel-footnote { margin-right: -17px; margin-left: -17px; padding-right: 17px; padding-left: 17px; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; padding: 12px 0; }
}
