:root {
  --paper: #f7f2e8;
  --paper-dark: #eadfcf;
  --ink: #1f2a1f;
  --muted: #5f675d;
  --accent: #355b3d;
  --accent-soft: #d6e0c7;
  --line: #c7baa6;
  --panel: rgba(255, 251, 244, 0.94);
  --shadow: 0 18px 50px rgba(47, 36, 23, 0.12);
  --page-background:
    radial-gradient(circle at top left, rgba(196, 166, 114, 0.25), transparent 28%),
    radial-gradient(circle at bottom right, rgba(77, 110, 86, 0.18), transparent 30%),
    linear-gradient(180deg, #f6efe2 0%, #efe4d2 100%);
}

@font-face {
  font-family: "Antropos";
  src: url("/AntroposFreefont-BW2G.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  background: #eadfcf;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page-background);
  font-family: "Avenir Next Condensed", "Trebuchet MS", sans-serif;
}

[hidden] {
  display: none !important;
}

input,
select,
textarea,
button {
  font: inherit;
}

body.cart-open {
  overflow: hidden;
}

.page-shell {
  min-height: 100vh;
  padding: 18px 20px 20px;
}

.app-footer {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid rgba(53, 91, 61, 0.12);
  border-radius: 22px;
  background: rgba(255, 251, 244, 0.72);
  box-shadow: 0 12px 28px rgba(47, 36, 23, 0.08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.app-footer p {
  margin: 0;
}

.app-footer p + p {
  margin-top: 8px;
}

.app-footer-credit {
  color: var(--ink);
}

.app-footer a {
  color: var(--accent);
  text-decoration: none;
}

.app-footer a:hover,
.app-footer a:focus-visible {
  text-decoration: underline;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 22px 24px;
  border: 1px solid rgba(53, 91, 61, 0.18);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.96), rgba(246, 238, 224, 0.92));
  box-shadow: var(--shadow);
}

.topbar-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-copy > div,
.topbar-copy > p,
.topbar-copy > h1 {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subline {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.topbar-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
  opacity: 0.94;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 0.95;
}

.brand-title {
  font-family: "Antropos", Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 0.95;
}

.panel-meta,
.status-pill,
.summary-list,
.field span,
.selection-subline {
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  min-width: 132px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
  font-size: 14px;
}

.status-pill[data-state="loading"] {
  border-color: rgba(177, 129, 54, 0.28);
  background: rgba(255, 244, 218, 0.92);
  color: #8a5f12;
}

.status-pill[data-state="success"] {
  border-color: rgba(53, 91, 61, 0.22);
  background: rgba(231, 243, 227, 0.92);
  color: var(--accent);
}

.status-pill[data-state="error"] {
  border-color: rgba(161, 63, 63, 0.22);
  background: rgba(255, 239, 239, 0.92);
  color: #8c2f2f;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  min-height: calc(100vh - 182px);
  align-items: stretch;
}

.panel {
  border: 1px solid rgba(53, 91, 61, 0.18);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.filter-panel,
.cart-drawer {
  padding: 20px;
}

.filter-panel {
  position: sticky;
  top: 18px;
  height: fit-content;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.filter-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.search-card {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(53, 91, 61, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(251, 246, 238, 0.92));
}

.search-card input {
  background: #fff;
}

.catalog-updated {
  margin: 0 0 14px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(53, 91, 61, 0.14);
  background: rgba(214, 224, 199, 0.5);
  color: var(--ink);
  font-size: 13px;
}

.results-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.results-panel .panel-head {
  padding: 20px 22px;
  margin: 0;
  border-bottom: 1px solid rgba(53, 91, 61, 0.12);
  background: #faf4e9;
}

.sticky {
  position: sticky;
  top: 0;
  z-index: 2;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px 14px;
  color: var(--ink);
}

.facet-grid {
  display: grid;
  gap: 10px;
}

.facet-card {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(53, 91, 61, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.category-section {
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.category-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.category-section-title {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.active-category {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(53, 91, 61, 0.08);
  background: rgba(214, 224, 199, 0.42);
  color: var(--ink);
  font-size: 14px;
}

.category-tree {
  display: grid;
  gap: 2px;
}

.category-branch {
  margin: 0;
}

.category-branch + .category-branch,
.category-branch + .category-leaf-row,
.category-leaf-row + .category-branch,
.category-leaf-row + .category-leaf-row {
  margin-top: 2px;
}

.category-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 8px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.category-row:hover {
  background: rgba(255, 255, 255, 0.44);
}

.category-row-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.category-row-label {
  min-width: 0;
  line-height: 1.35;
  font-size: 15px;
}

.category-count {
  flex: 0 0 auto;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(31, 42, 31, 0.06);
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}

.category-branch summary {
  list-style: none;
  cursor: pointer;
}

.category-branch summary::-webkit-details-marker {
  display: none;
}

.category-arrow::before {
  content: "▸";
  display: inline-block;
  color: var(--muted);
  transition: transform 120ms ease;
}

.category-branch[open] > summary .category-arrow::before {
  transform: rotate(90deg);
}

.category-row.is-active,
.category-leaf-row.is-active {
  background: rgba(214, 224, 199, 0.65);
}

#favorites-filter-button {
  margin-bottom: 4px;
}

.category-children {
  display: grid;
  gap: 2px;
  margin: 1px 0 4px;
}

.category-row.category-depth-0 {
  padding-left: 2px;
}

.category-row.category-depth-1 {
  padding-left: 18px;
}

.category-row.category-depth-2 {
  padding-left: 34px;
}

.category-row.category-depth-3 {
  padding-left: 50px;
}

.category-row.category-depth-4 {
  padding-left: 66px;
}

.category-branch > .category-row .category-row-label {
  font-size: 17px;
  font-weight: 700;
}

.category-depth-1.category-row .category-row-label,
.category-depth-1 > .category-row .category-row-label {
  font-size: 15px;
  font-weight: 700;
}

.category-depth-2.category-row .category-row-label,
.category-depth-3.category-row .category-row-label,
.category-depth-4.category-row .category-row-label {
  font-size: 14px;
}

.category-children .category-children {
  border-left: 1px solid rgba(53, 91, 61, 0.1);
  margin-left: 18px;
}

button {
  cursor: pointer;
  border-radius: 999px;
  padding: 11px 16px;
  border: 1px solid transparent;
}

.accent-button,
.small-button {
  color: #f4efe4;
  background: var(--accent);
}

.ghost-button {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.compact-button {
  padding: 8px 12px;
}

.small-button {
  padding: 8px 12px;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    transform 120ms ease;
}

.small-button.is-added {
  background: rgba(53, 91, 61, 0.14);
  color: var(--accent);
  transform: scale(0.98);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  border-color: rgba(53, 91, 61, 0.2);
  background: rgba(255, 255, 255, 0.64);
}

.cart-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.cart-count {
  min-width: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #f4efe4;
  font-size: 13px;
  text-align: center;
}

.summary-card {
  margin-top: 20px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(214, 224, 199, 0.64), rgba(255, 255, 255, 0.5));
}

.summary-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin: 14px 0 0;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(239, 228, 210, 0.95);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-button:hover {
  color: var(--ink);
}

.sort-button.is-active {
  color: var(--ink);
}

.column-visibility-menu {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.column-visibility-trigger {
  color: var(--ink);
  border-color: rgba(53, 91, 61, 0.18);
  background: rgba(255, 255, 255, 0.7);
}

.column-visibility-trigger svg {
  width: 18px;
  height: 18px;
}

.column-visibility-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 3;
  display: grid;
  gap: 6px;
  min-width: 250px;
  padding: 10px;
  border: 1px solid rgba(53, 91, 61, 0.14);
  border-radius: 18px;
  background: rgba(255, 251, 244, 0.98);
  box-shadow: 0 18px 40px rgba(47, 36, 23, 0.14);
  backdrop-filter: blur(10px);
}

.column-visibility-dropdown[hidden] {
  display: none;
}

.column-dropdown-item {
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.column-dropdown-item:hover,
.column-dropdown-item:focus-visible {
  background: rgba(214, 224, 199, 0.42);
}

.column-dropdown-item.is-active {
  border-color: rgba(53, 91, 61, 0.16);
  background: rgba(214, 224, 199, 0.52);
}

.sort-indicator {
  width: 10px;
  min-width: 10px;
  height: 14px;
  opacity: 0.45;
}

.sort-indicator::before {
  content: "↕";
}

.sort-button.is-active[data-sort-direction="asc"] .sort-indicator::before {
  content: "↑";
  opacity: 1;
}

.sort-button.is-active[data-sort-direction="desc"] .sort-indicator::before {
  content: "↓";
  opacity: 1;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(53, 91, 61, 0.1);
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(214, 224, 199, 0.18);
}

th[data-column="lieferant"],
td[data-column="lieferant"] {
  width: 82px;
  white-space: nowrap;
}

table.hide-artikel-nr [data-column="artikel_nr"],
table.hide-lieferant [data-column="lieferant"],
table.hide-hersteller [data-column="hersteller"] {
  display: none;
}

.mono {
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 13px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.article-title {
  line-height: 1.35;
}

.article-title.has-description {
  position: relative;
  display: inline-block;
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(53, 91, 61, 0.42);
  text-underline-offset: 3px;
}

.article-title.has-description::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 4;
  width: min(420px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 42, 31, 0.94);
  color: #f8f3eb;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
  box-shadow: 0 14px 30px rgba(31, 42, 31, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 80ms ease,
    transform 80ms ease;
}

.article-title.has-description:hover::after,
.article-title.has-description:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--paper-dark);
  color: var(--ink);
  font-size: 12px;
}

.tag-button {
  border: 0;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    transform 120ms ease;
}

.tag-button:hover,
.tag-button:focus-visible {
  background: rgba(214, 224, 199, 0.9);
  color: var(--accent);
}

.tag-button:active {
  transform: translateY(1px);
}

.tag-vb {
  background: rgba(53, 91, 61, 0.12);
  color: var(--accent);
}

.tag-catalog {
  background: rgba(31, 42, 31, 0.07);
  color: var(--muted);
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 30, 24, 0.34);
  backdrop-filter: blur(2px);
  z-index: 20;
}

.cart-drawer {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(430px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid rgba(53, 91, 61, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(250, 244, 233, 0.99), rgba(244, 236, 224, 0.99));
  box-shadow: var(--shadow);
  z-index: 21;
  transform: translateX(calc(100% + 24px));
  transition: transform 180ms ease;
  overflow-y: auto;
}

body.cart-open .cart-drawer {
  transform: translateX(0);
}

.cart-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.selection-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.selection-actions-main {
  display: grid;
  gap: 8px;
}

.selection-actions-main > * {
  width: 100%;
}

.selection-actions-side {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  align-items: flex-start;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.92);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(31, 42, 31, 0.92);
  color: #f8f3eb;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.icon-button:hover::after,
.icon-button:focus-visible::after {
  opacity: 1;
}

.selection-list {
  display: grid;
  gap: 12px;
  overflow: visible;
  padding-right: 2px;
}

.saved-carts-section {
  display: grid;
  gap: 10px;
  margin: 4px 0 2px;
}

.saved-carts-summary {
  list-style: none;
  cursor: pointer;
}

.saved-carts-summary::-webkit-details-marker {
  display: none;
}

.saved-carts-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.saved-carts-summary h3::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  transition: transform 120ms ease;
}

.saved-carts-section[open] .saved-carts-summary h3::before {
  transform: rotate(90deg);
}

.saved-carts-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.saved-cart-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgba(53, 91, 61, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
}

.saved-cart-title {
  margin: 0;
  font-weight: 700;
}

.saved-cart-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.saved-cart-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.cart-summary {
  padding: 14px;
  border: 1px solid rgba(53, 91, 61, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.cart-summary-list {
  margin: 0;
}

.cart-summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.cart-summary-list dt,
.cart-summary-list dd {
  margin: 0;
}

.cart-summary-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(53, 91, 61, 0.12);
  font-weight: 700;
  color: var(--ink);
}

.cart-summary-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.selection-item {
  padding: 14px;
  border: 1px solid rgba(53, 91, 61, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.selection-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.selection-title {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}

.selection-price {
  margin: 0;
  white-space: nowrap;
  font-weight: 700;
  color: var(--accent);
}

.selection-meta {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.selection-controls {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-top: 12px;
}

.selection-controls label {
  flex: 1;
}

.selection-controls .mwst-select {
  min-width: 88px;
}

.selection-controls span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

.auth-page,
.account-page {
  min-height: 100vh;
}

.auth-shell,
.account-layout {
  display: grid;
  gap: 20px;
  margin: 0 auto;
}

.auth-shell {
  min-height: 100vh;
  max-width: 560px;
  align-content: center;
  padding: 24px;
}

.auth-card,
.account-panel {
  padding: 24px;
}

.auth-card {
  width: 100%;
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
  margin-bottom: 18px;
}

.auth-brand h1 {
  font-family: "Antropos", Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 0.95;
}

.auth-logo {
  width: min(180px, 42vw);
  height: auto;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.auth-tab {
  color: var(--muted);
  border: 1px solid rgba(53, 91, 61, 0.14);
  background: rgba(255, 255, 255, 0.68);
}

.auth-tab.is-active {
  color: #f4efe4;
  border-color: transparent;
  background: var(--accent);
}

.auth-status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(53, 91, 61, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.auth-status[data-type="error"] {
  border-color: rgba(161, 63, 63, 0.18);
  background: rgba(255, 239, 239, 0.92);
  color: #7f2f2f;
}

.auth-status[data-type="success"] {
  border-color: rgba(53, 91, 61, 0.18);
  background: rgba(231, 243, 227, 0.92);
  color: var(--accent);
}

.auth-status-link {
  margin-left: 10px;
  color: inherit;
  font-weight: 700;
}

.auth-panel {
  display: none;
  gap: 14px;
  margin-top: 18px;
}

.auth-panel.is-active {
  display: grid;
}

.auth-submit {
  justify-self: end;
}

.auth-link-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
}

.auth-text-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 10px;
  border-color: rgba(53, 91, 61, 0.14);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.password-toggle-icon {
  width: 18px;
  height: 18px;
}

.password-toggle .eye-off {
  display: none;
}

.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-off {
  display: block;
}

.account-layout {
  margin-top: 20px;
}

.account-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-tab {
  color: var(--muted);
  border: 1px solid rgba(53, 91, 61, 0.14);
  background: rgba(255, 255, 255, 0.68);
}

.account-tab.is-active {
  color: #f4efe4;
  border-color: transparent;
  background: var(--accent);
}

.account-tab-panel {
  display: none;
  gap: 20px;
}

.account-tab-panel.is-active {
  display: grid;
}

.admin-layout {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.account-grid {
  display: grid;
  gap: 16px;
}

.admin-upload-grid {
  display: grid;
  gap: 16px;
}

.admin-upload-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-dataset-list {
  display: grid;
  gap: 14px;
}

.admin-dataset-card {
  display: grid;
  gap: 18px;
}

.admin-dataset-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.admin-dataset-title {
  font-size: 24px;
  line-height: 1.05;
}

.admin-dataset-meta {
  margin: 8px 0 0;
  color: var(--muted);
}

.admin-dataset-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 42, 31, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-badge.is-active {
  background: rgba(53, 91, 61, 0.16);
  color: var(--accent);
}

.admin-badge.is-latest {
  background: rgba(214, 224, 199, 0.75);
  color: var(--ink);
}

.admin-dataset-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(53, 91, 61, 0.1);
  background: rgba(255, 255, 255, 0.62);
}

.admin-stat strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.admin-stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-dataset-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
}

.admin-compare-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(53, 91, 61, 0.1);
  background: rgba(255, 255, 255, 0.62);
}

.admin-compare-card h4,
.admin-compare-card h5 {
  margin: 0;
}

.admin-compare-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-compare-empty {
  margin: 12px 0 0;
  color: var(--muted);
}

.admin-dataset-groups h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-file-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(53, 91, 61, 0.1);
  background: rgba(255, 255, 255, 0.58);
}

.admin-file-empty {
  color: var(--muted);
}

.admin-dataset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-feature-list {
  display: grid;
  gap: 14px;
}

.feature-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(53, 91, 61, 0.12);
  background: rgba(255, 255, 255, 0.66);
}

.feature-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.favorite-product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.favorite-product-copy {
  min-width: 0;
}

.favorite-cart-button {
  min-width: 168px;
  justify-self: end;
}

.favorite-cart-button[disabled] {
  cursor: wait;
}

.favorite-cart-button.is-loading,
.favorite-cart-button.is-confirmed {
  opacity: 0.92;
}

.account-cart-current {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(53, 91, 61, 0.1);
  background: rgba(214, 224, 199, 0.34);
  color: var(--ink);
}

.account-info-stack {
  display: grid;
  gap: 14px;
}

.account-info-card {
  display: grid;
  gap: 12px;
}

.account-info-card h3 {
  margin: 0;
}

.account-info-card p {
  margin: 0;
  line-height: 1.6;
}

.account-info-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
}

.account-info-list li {
  line-height: 1.55;
}

.account-danger-panel {
  border-color: rgba(161, 63, 63, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 250, 248, 0.98), rgba(250, 241, 238, 0.95)),
    var(--panel);
}

.danger-zone {
  display: grid;
  gap: 16px;
}

.account-delete-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(161, 63, 63, 0.16);
  background: rgba(255, 255, 255, 0.7);
}

.danger-note {
  margin: 0;
  color: #8c2f2f;
  line-height: 1.5;
}

.danger-confirm-target {
  font-weight: 700;
}

.danger-button {
  color: #fff6f4;
  border-color: transparent;
  background: linear-gradient(180deg, #b24f43, #8f372f);
}

.danger-button[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

.saved-cart-account-card {
  padding: 0;
  overflow: hidden;
}

.saved-cart-account-trigger {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition:
    background-color 140ms ease,
    transform 140ms ease;
}

.saved-cart-account-trigger:hover,
.saved-cart-account-trigger:focus-visible {
  background: rgba(214, 224, 199, 0.44);
}

.saved-cart-account-trigger:focus-visible {
  outline: 2px solid rgba(53, 91, 61, 0.28);
  outline-offset: -2px;
}

.saved-cart-account-trigger:active {
  transform: scale(0.995);
}

.saved-cart-account-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.saved-cart-account-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.05;
}

.saved-cart-account-count {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 42, 31, 0.06);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.saved-cart-account-meta {
  color: var(--muted);
}

.saved-cart-account-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
}

.saved-cart-account-note::after {
  content: "→";
  transition: transform 140ms ease;
}

.saved-cart-account-trigger:hover .saved-cart-account-note::after,
.saved-cart-account-trigger:focus-visible .saved-cart-account-note::after {
  transform: translateX(3px);
}

.confirm-dialog {
  width: min(460px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid rgba(53, 91, 61, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(246, 238, 224, 0.96));
  box-shadow: var(--shadow);
  color: var(--ink);
}

.confirm-dialog::backdrop {
  background: rgba(31, 42, 31, 0.28);
  backdrop-filter: blur(4px);
}

.confirm-dialog-body {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.confirm-dialog-body p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.export-dialog-body {
  min-width: min(460px, calc(100vw - 32px));
}

.export-dialog-field {
  margin-top: 16px;
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .filter-panel {
    position: static;
    max-height: none;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .results-panel {
    min-height: 58vh;
  }

  .auth-shell {
    padding: 16px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .topbar,
  .filter-panel,
  .results-panel {
    border-radius: 20px;
  }

  .selection-controls,
  .category-section-head,
  .auth-link-row,
  .admin-dataset-head,
  .admin-dataset-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .column-visibility-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .column-visibility-dropdown {
    left: 0;
    right: auto;
    min-width: min(280px, calc(100vw - 48px));
  }

  .favorite-product-card {
    grid-template-columns: 1fr;
  }

  .favorite-cart-button {
    width: 100%;
    justify-self: stretch;
  }

  .saved-cart-account-topline,
  .confirm-dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .selection-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .admin-upload-columns,
  .admin-compare-grid,
  .admin-dataset-groups,
  .admin-dataset-stats {
    grid-template-columns: 1fr;
  }

  .cart-drawer {
    inset: 8px;
    width: auto;
  }
}
