:root {
  --bg: #0f1419;
  --surface: #1a222c;
  --surface2: #243040;
  --text: #f2f4f7;
  --muted: #9aa7b2;
  --accent: #3dd6c6;
  --accent-dim: #2ba89a;
  --danger: #f07178;
  --border: #2e3a48;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --font: system-ui, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  --focus: 0 0 0 3px rgba(61, 214, 198, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(680px, 100% - 32px);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.wrap-wide {
  width: min(840px, 100% - 32px);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  margin-bottom: 20px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}

.brand a {
  color: var(--text);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 8px;
  line-height: 1.2;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 600;
}

.subtle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Purchase detail (purchase.html) */
.card.purchase-detail {
  padding: 22px 22px 20px;
}

.purchase-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.purchase-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px 24px;
  padding-bottom: 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 520px) {
  .purchase-hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: end;
    gap: 20px 32px;
  }

  .purchase-hero-price {
    text-align: right;
  }

  .purchase-hero-price .detail-label {
    text-align: right;
  }
}

.purchase-hero-product .detail-label,
.purchase-hero-price .detail-label {
  margin-bottom: 6px;
}

.purchase-product-name {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.purchase-price-value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.detail-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-spec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 20px;
  padding: 20px 0 8px;
}

@media (min-width: 480px) {
  .detail-spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.detail-field {
  min-width: 0;
}

.detail-field-span {
  grid-column: 1 / -1;
}

.detail-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.detail-value-multiline {
  white-space: pre-wrap;
}

.receipt-panel {
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
}

.detail-section-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.receipt-panel-summary {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.45;
}

.receipt-panel-row {
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  font-size: 0.95rem;
}

.receipt-panel-row:last-child {
  margin-bottom: 0;
}

.detail-label-inline {
  color: var(--muted);
  font-size: 0.88rem;
  flex-shrink: 0;
}

.detail-value-inline {
  color: var(--text);
  word-break: break-word;
}

.receipt-attachment-link {
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.standalone-hint {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: rgba(36, 48, 64, 0.35);
}

.same-receipt-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.same-receipt-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 8px;
}

.same-receipt-list a {
  font-weight: 600;
}

.purchase-actions-bar {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.purchase-back-link {
  display: block;
  text-align: center;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 4px 0;
}

.purchase-actions-bar .purchase-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin: 0;
  flex-direction: unset;
  align-items: stretch;
}

.purchase-action-btn {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  text-align: center;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

input[type='text'],
input[type='tel'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
}

input.input-readonly,
input.input-readonly:focus {
  cursor: default;
  color: var(--muted);
  opacity: 0.85;
  box-shadow: none;
  border-color: var(--border);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--accent-dim);
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: #0a0f12;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  border-color: #5c343b;
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.choice-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 520px) {
  .choice-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.choice {
  text-align: left;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  min-height: 100px;
}

.choice:hover {
  border-color: var(--accent-dim);
}

.choice strong {
  display: block;
  margin-bottom: 6px;
}

.choice span {
  color: var(--muted);
  font-size: 0.92rem;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border);
}

table.lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}

table.lines th,
table.lines td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table.lines th {
  color: var(--muted);
  font-weight: 600;
  background: var(--surface2);
}

table.lines tr:last-child td {
  border-bottom: none;
}

.receipt-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}

.receipt-head {
  padding: 14px 16px;
  background: var(--surface2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
}

.receipt-head strong {
  font-size: 1.02rem;
}

.receipt-items {
  padding: 10px 12px 12px;
}

.item-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-top: 1px solid var(--border);
}

.item-row:first-child {
  border-top: none;
}

.item-row a {
  font-weight: 600;
}

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.flash-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px;
  right: 12px;
  z-index: 1000;
  margin-bottom: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

@media (min-width: 768px) {
  .flash-toast {
    left: 50%;
    right: auto;
    width: min(560px, calc(100vw - 24px));
    max-width: none;
    transform: translateX(-50%);
  }
}

.flash-error {
  border-color: #5c343b;
  color: var(--danger);
  background: #24191b;
}

.flash-ok {
  border-color: #2a4d45;
  color: var(--accent);
  background: #15221f;
}

.hidden {
  display: none !important;
}

.mono-price {
  font-variant-numeric: tabular-nums;
}

.price-check {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.price-check h2 {
  margin-bottom: 6px;
}

.price-check-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.price-check-inner .detail-label {
  margin-bottom: 0;
}

.price-check-inner .tag-soon {
  margin: 0;
}

.tag-soon {
  color: var(--muted);
  font-size: 0.95rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.dashboard-header-meta {
  display: flex;
  align-items: flex-end;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 18px 18px;
}

.dashboard-header-meta-compact {
  justify-content: flex-end;
}

.dashboard-flow {
  display: grid;
  gap: 6px;
}

.dashboard-flow h2 {
  margin: 0;
  font-size: 1.15rem;
}

.view-toggle {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
}

.view-toggle .btn.is-active {
  border-color: var(--accent);
  color: var(--text);
}

.view-icon-btn {
  min-width: 64px;
}

.view-icon {
  display: inline-block;
  width: 18px;
  height: 14px;
  position: relative;
}

.view-icon-list::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.view-icon-grid {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.view-icon-grid::before,
.view-icon-grid::after {
  content: '';
  position: absolute;
  background: currentColor;
}

.view-icon-grid::before {
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  transform: translateX(-50%);
}

.view-icon-grid::after {
  top: 50%;
  left: -2px;
  right: -2px;
  height: 2px;
  transform: translateY(-50%);
}

.row-gap {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-card {
  background: linear-gradient(145deg, rgba(61, 214, 198, 0.08), rgba(36, 48, 64, 0.9));
}

.modern-hero {
  display: grid;
  gap: 16px;
}

.dashboard-hero-cta {
  margin-top: 6px;
}

.hero-cta-hint {
  margin: 0 0 10px;
  max-width: 52ch;
}

.hero-cta-buttons {
  align-items: stretch;
}

.receipt-upload-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.receipt-upload-title {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.receipt-quick-hint {
  margin: 0;
  max-width: 58ch;
}

.receipt-upload-row {
  margin-top: 4px;
}

.hero-kicker {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(61, 214, 198, 0.35);
  background: rgba(61, 214, 198, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.hero-subtle {
  margin: 8px 0 0;
}

.hero-stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-stat {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(61, 214, 198, 0.2);
  background: rgba(10, 15, 18, 0.25);
}

.hero-stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.hero-stat strong {
  font-size: 1.2rem;
}

.hero-title,
.section-title {
  margin: 10px 0 8px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
}

.hero-copy {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.info-grid {
  display: grid;
  gap: 12px;
}

.info-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  padding: 12px;
}

.info-item strong {
  display: block;
  margin-bottom: 4px;
}

.info-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.compact-grid {
  display: grid;
  gap: 16px;
}

.compact-copy {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 720px) {
  .info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lang-picker {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.lang-flag {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.flag {
  display: inline-block;
  width: 26px;
  height: 18px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.flag-no {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Crect width='22' height='16' fill='%23BA0C2F'/%3E%3Crect x='6' width='4' height='16' fill='%23FFFFFF'/%3E%3Crect y='6' width='22' height='4' fill='%23FFFFFF'/%3E%3Crect x='7' width='2' height='16' fill='%2300205B'/%3E%3Crect y='7' width='22' height='2' fill='%2300205B'/%3E%3C/svg%3E");
}

.flag-gb {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Crect width='22' height='16' fill='%23012169'/%3E%3Cpath d='M0 0 L22 16 M22 0 L0 16' stroke='%23FFFFFF' stroke-width='3'/%3E%3Cpath d='M0 0 L22 16 M22 0 L0 16' stroke='%23C8102E' stroke-width='1.5'/%3E%3Crect x='9' width='4' height='16' fill='%23FFFFFF'/%3E%3Crect y='6' width='22' height='4' fill='%23FFFFFF'/%3E%3Crect x='9.8' width='2.4' height='16' fill='%23C8102E'/%3E%3Crect y='6.8' width='22' height='2.4' fill='%23C8102E'/%3E%3C/svg%3E");
}

.lang-flag:hover {
  transform: translateY(-1px);
  border-color: var(--accent-dim);
}

.lang-flag.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.2);
}

.lang-flag:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--accent-dim);
}

.notify-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin: 0;
}

.notify-fieldset legend {
  padding: 0 6px;
  color: var(--text);
}

.notify-options {
  display: grid;
  gap: 10px;
}

.notify-option {
  display: block;
  margin: 0;
  color: var(--text);
}

.notify-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.notify-option-ui {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.notify-option-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.notify-input:checked + .notify-option-ui {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.15);
  background: rgba(61, 214, 198, 0.08);
}

.notify-input:checked + .notify-option-ui .notify-option-icon {
  border-color: var(--accent);
  background: var(--accent);
  color: #0a0f12;
}

.notify-option:hover .notify-option-ui {
  border-color: var(--accent-dim);
}

.notify-input:focus-visible + .notify-option-ui {
  box-shadow: var(--focus);
  border-color: var(--accent-dim);
}

.dash-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-row-simple {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.dash-row-simple:first-child {
  border-top: none;
}

.dash-row-link {
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.dash-row-link:hover {
  text-decoration: none;
}

.dash-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.dash-status-pill.is-down {
  color: var(--accent);
  border-color: #2a4d45;
  background: #15221f;
}

.dash-delete {
  min-height: 36px;
  padding: 8px 12px;
}

.dash-next {
  min-height: 36px;
  padding: 8px 12px;
  position: relative;
  z-index: 1;
}

.dash-next::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.dash-saving {
  margin: 0 0 0 0;
  white-space: nowrap;
  color: var(--accent);
}

.dash-row-extra {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.purchase-actions {
  margin-top: 10px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* purchase.html uses .purchase-actions-bar .purchase-actions — grid layout above */

.report-card {
  border-color: rgba(61, 214, 198, 0.32);
  background: linear-gradient(160deg, rgba(61, 214, 198, 0.09), rgba(26, 34, 44, 0.92));
}

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 14px;
}

.report-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 12, 0.58);
}

.report-modal-card {
  position: relative;
  width: min(520px, calc(100vw - 28px));
  margin: 0;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

.report-title {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
}

.report-lead {
  margin: 0 0 2px;
}

.report-meta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
  background: rgba(10, 15, 18, 0.3);
  border: 1px solid rgba(61, 214, 198, 0.2);
  border-radius: 999px;
  padding: 7px 12px;
  width: fit-content;
}

.report-meta strong {
  color: var(--text);
  letter-spacing: 0.01em;
}

.report-meta-line {
  margin: 0 0 4px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.dash-row {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}

.dash-row:first-child {
  border-top: none;
}

.dash-row:hover {
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.dash-row.is-action {
  box-shadow: inset 3px 0 0 var(--danger);
  background: rgba(240, 113, 120, 0.08);
}

.dash-title {
  font-weight: 600;
}

.dash-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.dash-col-price,
.dash-col-diff {
  text-align: right;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.dash-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  text-decoration: none;
  display: block;
}

.dash-card:hover {
  text-decoration: none;
  border-color: var(--accent-dim);
}

.dash-card-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-decoration: none;
  color: transparent;
}

.dash-card-cover:hover {
  text-decoration: none;
}

.dash-card-inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.dash-card-actions {
  pointer-events: auto;
  margin-top: 2px;
}

.dash-card-actions .dash-next {
  width: 100%;
  justify-content: center;
  position: relative;
  z-index: 3;
}

.dash-card-link {
  display: block;
}

.dash-card.is-action {
  border-color: #704045;
  background: rgba(240, 113, 120, 0.08);
}

.dash-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.dash-fields {
  margin: 2px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.dash-field {
  margin: 0;
}

.dash-field dt {
  margin: 0 0 2px;
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-field dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
}

.dash-field-note {
  grid-column: 1 / -1;
}

.dash-note {
  color: var(--muted);
  font-weight: 400;
}

.dash-meta {
  display: grid;
  gap: 5px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 10px;
}

.dash-status {
  margin-top: 10px;
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.dash-card .dash-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
}

.dash-card .dash-actions .dash-edit,
.dash-card .dash-actions .dash-delete {
  flex: 1 1 0;
}

@media (max-width: 720px) {
  .wrap {
    width: min(680px, 100% - 24px);
    padding-top: 16px;
  }

  .wrap-wide {
    width: min(840px, 100% - 24px);
  }

  .purchase-hero {
    padding-bottom: 18px;
  }

  .purchase-product-name {
    font-size: 1.18rem;
  }

  .purchase-price-value {
    font-size: 1.28rem;
  }

  .detail-spec-grid {
    padding-top: 16px;
    gap: 14px 16px;
  }

  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand {
    text-align: left;
    font-size: 1.05rem;
  }

  .nav-actions {
    width: 100%;
    display: grid;
    gap: 8px;
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: 2;
    margin-left: 0;
  }

  .nav-actions .btn {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
  }

  .lang-picker {
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
  }

  .nav-actions .btn {
    grid-column: auto;
  }

  .lang-flag {
    width: 40px;
    height: 40px;
  }

  .flag {
    width: 22px;
    height: 15px;
  }

  .card {
    padding: 16px;
  }

  .dash-title,
  .dash-sub,
  .dash-row-link {
    overflow-wrap: anywhere;
  }

  .hero-stat-grid {
    grid-template-columns: 1fr;
  }

  .dash-row-simple {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    padding: 7px 8px;
  }

  .dash-col-main {
    min-width: 0;
  }

  .dash-title {
    font-size: 0.86rem;
    line-height: 1.15;
  }

  .dash-sub {
    margin-top: 1px;
    font-size: 0.72rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dash-fields {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dash-status-pill {
    justify-self: start;
    padding: 2px 6px;
    font-size: 0.66rem;
  }

  .dash-saving {
    justify-self: start;
    font-size: 0.72rem;
  }

  .dash-next {
    justify-self: start;
  }

  .dash-actions {
    justify-self: end;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .dash-delete {
    justify-self: start;
  }

  .dash-row-simple .dash-actions .btn {
    min-height: 22px;
    padding: 3px 6px;
    font-size: 0.7rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  .dash-row-simple .dash-actions .dash-next {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 0.69rem;
    z-index: 2;
  }

  .dash-card-actions .dash-next {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .dash-row-extra {
    margin-top: 3px;
    gap: 6px;
  }

  .dash-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .dash-col-price,
  .dash-col-diff {
    text-align: left;
    font-size: 0.92rem;
  }

  .view-toggle {
    margin-left: 0;
  }

  .dashboard-header-meta-compact {
    justify-content: flex-start;
  }
}
