/* ---------- Base ---------- */

:root {
  color-scheme: dark;
  --bg: #090909;
  --bg-deep: #060606;
  --surface: #131312;
  --surface-raised: #1a1917;
  --line: #292825;
  --line-strong: #3b3832;
  --text: #f4f1ea;
  --muted: #a39d92;
  --muted-2: #8b857a;
  --accent: #e3cfac;
  --accent-strong: #f1e2c8;
  --accent-ink: #17130d;
  --accent-soft: rgba(227, 207, 172, 0.1);
  --danger: #e5a096;
  --danger-soft: rgba(229, 160, 150, 0.11);
  --success: #b9d6b2;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.58);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse 90% 46% at 50% -8%, rgba(227, 207, 172, 0.075), transparent 72%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  height: 118px;
  background: linear-gradient(transparent, var(--bg) 72%);
  pointer-events: none;
  content: "";
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  overflow: hidden;
  width: 0;
  height: 0;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* ---------- Layout ---------- */

.app {
  width: min(100% - 32px, 780px);
  margin-inline: auto;
  padding-bottom: 142px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: none;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(145deg, #1a1815, #0c0c0b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--accent);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-tagline {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.icon-button {
  display: grid;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

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

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease,
    transform 160ms ease;
}

.primary-button {
  padding: 11px 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 650;
}

.primary-button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.98);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
}

.secondary-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.secondary-button svg {
  width: 16px;
  height: 16px;
}

.danger-button {
  padding: 10px 16px;
  border: 1px solid rgba(229, 160, 150, 0.35);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 650;
}

.danger-button:hover {
  border-color: rgba(229, 160, 150, 0.6);
  background: rgba(229, 160, 150, 0.17);
}

.text-button {
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
}

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

/* ---------- Privacy + search ---------- */

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.privacy-note svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--accent);
}

.privacy-note p {
  margin: 0;
}

.privacy-note strong {
  color: var(--text);
  font-weight: 600;
}

.search-wrap {
  margin: 22px 0 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 180ms ease, background 180ms ease,
    box-shadow 180ms ease;
}

.search-field:focus-within {
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-field > svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--muted-2);
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.search-field input::placeholder {
  color: var(--muted-2);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: grid;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.search-clear svg {
  width: 14px;
  height: 14px;
}

/* ---------- Filters ---------- */

.filter-bar {
  margin-bottom: 26px;
}

.group-tabs,
.subcategory-tabs {
  display: flex;
  overflow-x: auto;
  gap: 7px;
  padding: 2px 2px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.group-tabs::-webkit-scrollbar,
.subcategory-tabs::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex: none;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.filter-pill:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.filter-pill[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}

.subcategory-tabs {
  margin-top: 1px;
  padding-bottom: 2px;
}

.subcategory-pill {
  flex: none;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-2);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.subcategory-pill:hover {
  color: var(--text);
}

.subcategory-pill[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

/* ---------- List ---------- */

.list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 12px;
}

.list-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.result-count {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-align: right;
  text-transform: uppercase;
}

.item-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.item-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(
    158deg,
    rgba(255, 255, 255, 0.032),
    rgba(255, 255, 255, 0.008)
  );
  transition: border-color 180ms ease, background 180ms ease,
    transform 180ms ease;
}

.item-card:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

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

.item-name {
  margin: 0 0 3px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.item-path {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
}

.item-path .dot {
  padding: 0 4px;
  opacity: 0.7;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.item-tag {
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.item-note {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 0;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.item-actions {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 2px;
  margin: -4px -4px 0 0;
}

.item-actions .icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  color: var(--muted-2);
}

.item-actions .icon-button svg {
  width: 16px;
  height: 16px;
}

.item-actions .icon-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.item-actions .delete-button:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Empty state ---------- */

.empty-state {
  padding: 58px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

.empty-state h3 {
  margin: 16px 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.empty-state p {
  max-width: 42ch;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- Floating add button ---------- */

.add-button {
  position: fixed;
  z-index: 30;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transform: translateX(-50%);
  transition: background 160ms ease, transform 160ms ease;
}

.add-button:hover {
  background: var(--accent-strong);
  transform: translateX(-50%) translateY(-1px);
}

.add-button:active {
  transform: translateX(-50%) scale(0.98);
}

.add-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}

/* ---------- Dialogs ---------- */

dialog {
  width: min(560px, calc(100% - 32px));
  max-height: min(88dvh, 780px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-deep);
  box-shadow: var(--shadow);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(5px);
}

dialog[open]::backdrop {
  animation: fade-in 180ms ease-out;
}

dialog[open] {
  animation: dialog-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.992);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.sheet-form {
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, 780px);
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.sheet-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.sheet-body {
  display: flex;
  overflow-y: auto;
  flex-direction: column;
  gap: 20px;
  padding: 20px 22px;
  overscroll-behavior: contain;
}

.sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 22px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.manage-footer {
  align-items: center;
}

/* ---------- Form fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field label,
.details-fieldset legend {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.field input,
.field select,
.field textarea,
.mini-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  transition: border-color 160ms ease, background 160ms ease,
    box-shadow 160ms ease;
}

.field textarea {
  min-height: 68px;
  resize: vertical;
}

.field select {
  padding-right: 34px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

.field input::placeholder,
.field textarea::placeholder,
.mini-form input::placeholder,
.inline-form input::placeholder {
  color: var(--muted-2);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.mini-form input:focus,
.inline-form input:focus {
  border-color: var(--accent);
  background-color: var(--surface-raised);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 11.5px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.details-fieldset {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.details-fieldset legend {
  padding: 0;
}

.details-fieldset legend span {
  color: var(--muted-2);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Manage dialog ---------- */

.manage-privacy {
  padding: 16px;
  border: 1px solid rgba(227, 207, 172, 0.16);
  border-radius: 16px;
  background: linear-gradient(
    150deg,
    rgba(227, 207, 172, 0.075),
    rgba(255, 255, 255, 0.012)
  );
}

.manage-privacy-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--accent);
}

.manage-privacy-head svg {
  width: 15px;
  height: 15px;
}

.manage-privacy h3 {
  margin: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.manage-privacy p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.manage-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manage-section + .manage-section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

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

.section-heading h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 600;
}

.section-heading p {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.manage-groups {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.manage-group {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.014);
}

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

.manage-group h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.manage-group .item-count {
  margin: 2px 0 0;
  color: var(--muted-2);
  font-size: 11px;
}

.manage-group-actions {
  display: flex;
  flex: none;
  gap: 1px;
  margin: -4px -4px 0 0;
}

.tiny-icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
}

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

.tiny-icon-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.tiny-icon-button.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.manage-subcategories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.manage-subcat {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px 2px 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
}

.manage-subcat > span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-subcat .tiny-icon-button {
  width: 24px;
  height: 24px;
}

.manage-subcat .tiny-icon-button svg {
  width: 11px;
  height: 11px;
}

.manage-empty {
  margin: 0;
  color: var(--muted-2);
  font-size: 11.5px;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.add-sub-form {
  margin-top: 1px;
}

.add-sub-form input {
  padding-block: 8px;
  font-size: 13px;
}

.add-sub-form .secondary-button {
  padding: 8px 12px;
  font-size: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.install-hint {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.manage-status {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.4;
}

.manage-status[data-tone="success"] {
  color: var(--success);
}

.manage-status[data-tone="error"] {
  color: var(--danger);
}

/* ---------- Mini dialogs ---------- */

.mini-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
}

.mini-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 22px;
}

.mini-form h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 60;
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: var(--text);
  box-shadow: var(--shadow);
  color: #111;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(7px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 100;
  padding: 14px;
  border: 1px solid var(--danger);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .item-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sheet-footer .text-button {
    padding-left: 0;
  }
}

@media (max-width: 639px) {
  .app {
    width: min(100% - 28px, 780px);
  }

  .app-header {
    padding-top: 20px;
  }

  .brand-name {
    font-size: 23px;
  }

  dialog.sheet {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  .sheet-form {
    max-height: 92dvh;
  }

  .sheet-header {
    padding: 20px 18px 14px;
  }

  .sheet-header h2 {
    font-size: 22px;
  }

  .sheet-body {
    padding: 18px;
  }

  .sheet-footer {
    padding: 13px 18px calc(13px + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .manage-status {
    font-size: 10.5px;
  }
}

@media (max-width: 380px) {
  .brand-tagline {
    display: none;
  }

  .privacy-note {
    font-size: 11.5px;
  }

  .result-count {
    font-size: 9.5px;
  }
}

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