:root {
  --font-ui: "Segoe UI Variable", "Inter", "Helvetica Neue", Arial, ui-sans-serif, system-ui, sans-serif;
  --page-max: 1180px;
  --canvas: #f4f4f1;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #5f6168;
  --quiet: #777a82;
  --line: #dedfe3;
  --line-strong: #b9bbc2;
  --blue: #1555d8;
  --petrol: #087c78;
  --red: #f04424;
  --yellow: #d69e00;
  --navy: #17243a;
  --green: #27865d;
  --focus: #1555d8;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

.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;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner,
.page {
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 154px;
  padding: 18px 0;
}

.brand {
  display: inline-grid;
  grid-template-columns: 112px minmax(0, max-content);
  gap: 18px;
  align-items: center;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-symbol {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-title {
  font-size: clamp(1.75rem, 3vw, 2.55rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.98rem;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
}

.submit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 720;
  text-decoration: none;
  transition: background-color 140ms ease-out, color 140ms ease-out;
  white-space: nowrap;
}

.submit-link:hover {
  background: var(--ink);
  color: var(--paper);
}

.page {
  padding: 24px 0 72px;
}

.finder {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 18px 18px 0;
  border: 1px solid var(--line);
  background: var(--paper);
}

.finder::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -4px;
  bottom: -4px;
  left: 4px;
  height: 100%;
  border-right: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  pointer-events: none;
}

.finder-search {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.finder-search > img {
  width: 24px;
  height: 24px;
  margin-left: 16px;
}

.finder-search input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 0 16px 0 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.02rem;
}

.finder-search input::placeholder {
  color: #858890;
}

.finder-search:focus-within {
  border-color: var(--focus);
}

.finder-controls {
  display: none;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: var(--quiet);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

select,
.reset-button {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--paper);
}

.reset-button {
  cursor: pointer;
  font-weight: 680;
}

.category-rail {
  display: flex;
  justify-content: space-between;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
}

.category-rail::-webkit-scrollbar {
  display: none;
}

.shelf-filter {
  --category-color: var(--ink);
  position: relative;
  flex: 0 0 auto;
  width: auto;
  min-height: 49px;
  padding: 7px 15px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 670;
  white-space: nowrap;
}

.shelf-filter::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: -1px;
  left: 15px;
  height: 3px;
  background: var(--category-color);
  opacity: 0.46;
  transform: scaleX(0.28);
  transform-origin: left;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}

.shelf-filter:hover,
.shelf-filter[aria-pressed="true"] {
  color: var(--ink);
}

.shelf-filter:hover::after,
.shelf-filter[aria-pressed="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

[data-category-key="kleine-helferlein"] {
  --category-color: var(--blue);
}

[data-category-key="grosse-anschaffungen"] {
  --category-color: var(--petrol);
}

[data-category-key="medien-entertainment"] {
  --category-color: var(--red);
}

[data-category-key="alltags-hacks-organisation"] {
  --category-color: var(--yellow);
}

[data-category-key="unterwegs-reisen"] {
  --category-color: var(--navy);
}

[data-category-key="orte-erlebnisse"] {
  --category-color: var(--green);
}

[data-category-key="sonstiges"] {
  --category-color: #666666;
}

.collection {
  margin-top: 18px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  background: var(--paper);
}

.collection-head {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line-strong);
}

.collection-head h2 {
  margin: 0;
  font-size: 0.79rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.collection-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: flex-end;
}

.result-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 640;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: flex-end;
}

.active-filter {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 680;
}

.active-filter + .active-filter::before {
  content: "·";
  margin-right: 12px;
  color: var(--quiet);
}

.register-list {
  display: grid;
  grid-template-columns: 1fr;
}

.register-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(120px, 220px);
  gap: 22px;
  align-items: center;
  min-height: 102px;
  padding: 19px 8px;
  border-bottom: 1px solid var(--line);
  transition: background-color 140ms ease-out, transform 140ms ease-out;
}

.register-item::before {
  content: "";
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: -1px;
  width: 3px;
  background: var(--category-color);
  opacity: 0;
  transition: opacity 140ms ease-out;
}

.register-item:hover {
  background: color-mix(in srgb, var(--category-color) 4%, var(--paper));
  transform: translateX(3px);
}

.register-item:hover::before {
  opacity: 1;
}

.register-item--expanded {
  min-height: 126px;
  align-items: start;
  padding-top: 22px;
  padding-bottom: 22px;
}

.record-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
}

.record-icon img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.record-main {
  min-width: 0;
}

.record-main h3 {
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.38rem);
  font-weight: 740;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.record-category {
  display: block;
  margin-top: 5px;
  color: var(--category-color);
  font-size: 0.82rem;
  font-weight: 720;
}

.record-notes-copy,
.record-notes {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.record-notes ul {
  margin: 0;
  padding-left: 1.1rem;
}

.record-notes li + li {
  margin-top: 4px;
}

.record-details {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

.record-details summary {
  display: grid;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}

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

.record-details[open] .record-note-preview,
.record-details[open] .record-more-label--closed,
.record-more-label--open {
  display: none;
}

.record-details[open] .record-more-label--open {
  display: inline;
}

.record-more-label {
  width: fit-content;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 760;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.record-details .record-notes-copy,
.record-details .record-notes {
  margin-top: 10px;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin-top: 12px;
  color: var(--quiet);
  font-size: 0.78rem;
}

.record-meta span + span::before {
  content: "·";
  margin: 0 8px;
}

.record-side {
  display: flex;
  min-width: 0;
  align-self: center;
  justify-content: flex-end;
}

.register-item--expanded .record-side {
  align-self: start;
  padding-top: 2px;
}

.record-link {
  max-width: 100%;
  overflow: hidden;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 720;
  text-overflow: ellipsis;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  white-space: nowrap;
}

.record-link:hover {
  color: var(--red);
}

.empty-state {
  margin: 0;
  padding: 32px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

input:focus,
select:focus,
button:focus-visible,
.submit-link:focus-visible,
.record-link:focus-visible,
.record-details summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 30%, transparent);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .header-inner,
  .page {
    width: min(var(--page-max), calc(100% - 32px));
  }

  .header-inner {
    min-height: 128px;
  }

  .brand {
    grid-template-columns: 88px minmax(0, max-content);
    gap: 14px;
  }

  .brand-symbol {
    width: 88px;
    height: 88px;
  }

  .brand-subtitle {
    max-width: 310px;
    font-size: 0.9rem;
  }

  .register-item {
    grid-template-columns: 60px minmax(0, 1fr) minmax(90px, 160px);
    gap: 16px;
  }

  .record-icon {
    width: 48px;
    height: 48px;
  }

  .record-icon img {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 680px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 12px 0 16px;
  }

  .brand {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 11px;
  }

  .brand-symbol {
    width: 72px;
    height: 72px;
  }

  .brand-title {
    font-size: 1.52rem;
  }

  .brand-subtitle {
    font-size: 0.82rem;
  }

  .header-actions {
    justify-content: flex-start;
    padding-left: 83px;
  }

  .submit-link {
    min-height: 38px;
    padding: 6px 11px;
    font-size: 0.82rem;
  }

  .page {
    padding-top: 18px;
  }

  .finder {
    padding: 12px 12px 0;
  }

  .finder {
    gap: 12px;
  }

  .finder-search {
    min-height: 52px;
  }

  .finder-search input {
    min-height: 50px;
    font-size: 0.94rem;
  }

  .category-rail {
    margin: 0;
  }

  .shelf-filter {
    min-height: 44px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: 0.78rem;
  }

  .shelf-filter::after {
    right: 12px;
    left: 12px;
  }

  .collection {
    margin-top: 15px;
    padding: 0 12px;
  }

  .collection-head {
    align-items: flex-start;
  }

  .collection-status {
    display: grid;
    justify-items: end;
  }

  .register-item,
  .register-item--expanded {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    padding: 17px 0;
  }

  .record-icon {
    width: 42px;
    height: 42px;
  }

  .record-icon img {
    width: 40px;
    height: 40px;
  }

  .record-main h3 {
    font-size: 1.08rem;
  }

  .record-side {
    grid-column: 2;
    justify-content: flex-start;
    padding-top: 0;
  }
}

@media (max-width: 430px) {
  .header-inner,
  .page {
    width: min(var(--page-max), calc(100% - 24px));
  }

  .brand {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .brand-symbol {
    width: 64px;
    height: 64px;
  }

  .brand-title {
    font-size: 1.35rem;
  }

  .header-actions {
    padding-left: 75px;
  }

  .collection-head {
    display: grid;
    gap: 6px;
  }

  .collection-status {
    justify-items: start;
  }

  .active-filters {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
