/* ============================
   CSS Custom Properties
   ============================ */
:root {
  --max-width: 430px;
  --accent: #1a73e8;
  --accent-dark: #1557b0;
  --accent-light: #e8f0fe;
  --danger: #d93025;
  --danger-light: #fce8e6;
  --success: #1e8e3e;
  --success-light: #e6f4ea;
  --surface: #ffffff;
  --bg: #f1f3f4;
  --card-bg: #ffffff;
  --text: #202124;
  --subtext: #5f6368;
  --border: #dadce0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --bar-height: 56px;
}

/* ============================
   Reset & Base
   ============================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Noto Sans CJK SC', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Prevent zoom on input focus (iOS Safari) */
input, select, textarea, button {
  font-size: 16px;
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================
   App Bar
   ============================ */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--bar-height);
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.app-bar h1 {
  flex: 1;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.app-bar-right {
  width: 40px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.15s;
  flex-shrink: 0;
}

.icon-btn:active {
  background: var(--bg);
}

/* ============================
   Main Content
   ============================ */
#app {
  padding: 0;
  min-height: calc(100vh - var(--bar-height));
}

/* ============================
   Views
   ============================ */

/* Home View */
.home-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--bar-height));
  padding: 32px 24px;
  gap: 16px;
}

.home-logo {
  font-size: 56px;
  margin-bottom: 8px;
}

.home-tagline {
  font-size: 15px;
  color: var(--subtext);
  text-align: center;
  margin-bottom: 24px;
}

.home-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 340px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
  transition: box-shadow 0.15s, transform 0.1s;
  color: var(--text);
}

.home-btn:active {
  transform: scale(0.98);
  box-shadow: none;
}

.home-btn-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.home-btn-text strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

.home-btn-text span {
  font-size: 13px;
  color: var(--subtext);
}

/* Record View */
.view-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* Photo Upload Area */
.photo-row {
  display: flex;
  gap: 12px;
}

.photo-slot {
  flex: 1;
  position: relative;
}

.photo-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 140px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
  position: relative;
}

.photo-label:active,
.photo-label.has-image {
  border-style: solid;
  border-color: var(--accent);
}

.photo-label.has-image {
  height: auto;
  min-height: 0;
  justify-content: flex-start;
}

.photo-label--compare {
  height: 200px;
}

.photo-label--compare.has-image {
  height: auto;
}

.photo-label input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Choose camera vs album: tap area then sheet */
.photo-open-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 120px;
  padding: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.photo-open-sheet:active {
  opacity: 0.85;
}

.photo-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Bottom sheet: 拍照 / 相簿 */
.photo-source-sheet {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.photo-source-sheet[hidden] {
  display: none !important;
}

.photo-source-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.photo-source-dialog {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-md);
}

.photo-source-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--subtext);
  text-align: center;
  margin-bottom: 12px;
}

.photo-source-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.photo-source-btn-camera {
  background: var(--accent);
  color: #fff;
}

.photo-source-btn-camera:active {
  background: var(--accent-dark);
}

.photo-source-btn-album {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.photo-source-btn-cancel {
  background: transparent;
  color: var(--subtext);
  margin-bottom: 0;
  font-weight: 500;
}

.photo-icon {
  font-size: 28px;
}

.photo-hint {
  font-size: 12px;
  color: var(--subtext);
  text-align: center;
  padding: 0 8px;
}

.photo-preview {
  display: block;
  position: relative;
  width: 100%;
  height: auto;
  max-height: min(70vh, 420px);
  object-fit: contain;
  object-position: center;
  border-radius: calc(var(--radius) - 2px);
  background: var(--bg);
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  line-height: 1;
}

/* Store Picker */
.store-select-wrap {
  width: 100%;
}

.store-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.store-select:focus {
  outline: none;
  border-color: var(--accent);
}

.store-select option[value=""] {
  color: var(--subtext);
}

/* Submit Button */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:active {
  background: var(--accent-dark);
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--subtext);
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s;
}

.btn-secondary:active {
  background: var(--accent-light);
}

.btn-secondary:disabled {
  opacity: 0.45;
  pointer-events: none;
  border-color: var(--border);
  color: var(--subtext);
}

.record-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.analyze-preview {
  margin-top: 16px;
}

.analyze-preview-inner {
  margin-top: 8px;
}

.analyze-preview-thumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.analyze-preview-thumbs img {
  width: auto;
  height: auto;
  max-width: min(100%, 160px);
  max-height: 160px;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.analyze-preview-card {
  margin-top: 0;
}

.analyze-preview-unit-note {
  font-size: 13px;
  color: var(--subtext);
  margin-top: 10px;
  line-height: 1.35;
}

.analyze-preview-store {
  font-size: 13px;
  color: var(--subtext);
  margin-top: 10px;
}

/* Inline edit (分析結果: ✎ / ✓ / ✕) */
.inline-edit-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}

.inline-edit-row:last-child {
  margin-bottom: 0;
}

.inline-edit-view {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

/* `hidden` must win over `display: flex` (otherwise inputs show before ✎ is pressed) */
.inline-edit-view[hidden] {
  display: none !important;
}

.inline-edit-view .product-name,
.inline-edit-view .preview-brand {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inline-edit-view--price {
  align-items: center;
}

.analyze-price-block {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.inline-edit-icon-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(30, 142, 62, 0.12);
  color: var(--success);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.1s;
}

.inline-edit-icon-btn:active {
  transform: scale(0.96);
}

.inline-edit-pencil {
  color: var(--subtext);
  background: rgba(95, 99, 104, 0.12);
}

.inline-edit-ok {
  color: var(--success);
  background: var(--success-light);
}

.inline-edit-cancel {
  color: var(--subtext);
  background: rgba(95, 99, 104, 0.1);
}

.inline-edit-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.inline-edit-edit[hidden] {
  display: none !important;
}

.inline-edit-input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

.inline-edit-input:focus {
  outline: none;
  border-color: var(--accent);
}

.inline-edit-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.inline-edit-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.inline-edit-price-row .price-currency {
  font-size: 18px;
  font-weight: 600;
  color: var(--success);
}

.inline-edit-input--price {
  flex: 1 1 100px;
  min-width: 0;
  max-width: 100%;
  font-weight: 600;
  font-size: 18px;
}

.inline-edit-edit--price {
  margin-top: 8px;
}

.btn-danger {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1.5px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

/* Result Card */
.result-card {
  background: var(--success-light);
  border: 1px solid var(--success);
  border-radius: var(--radius);
  padding: 20px;
}

.result-card .product-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-card .brand-name {
  font-size: 14px;
  color: var(--subtext);
  margin-bottom: 12px;
}

.result-card .price-big {
  font-size: 36px;
  font-weight: 700;
  color: var(--success);
  line-height: 1;
  margin-bottom: 8px;
}

.result-card .price-currency {
  font-size: 20px;
  vertical-align: super;
  font-weight: 600;
}

.result-card .meta {
  font-size: 13px;
  color: var(--subtext);
}

/* List View */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
}

.list-count {
  font-size: 13px;
  color: var(--subtext);
}

.list-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.list-filter::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--subtext);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.filter-pill.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
}

.record-card {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  align-items: flex-start;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* List: tap row → lightbox with same inline-edit as 分析結果 */
.record-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.record-detail-overlay[hidden] {
  display: none !important;
}

.record-detail-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.record-detail-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: min(92vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.record-detail-head {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 8px 8px 0;
}

.record-detail-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--subtext);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.record-detail-close:active {
  background: rgba(0, 0, 0, 0.06);
}

.record-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 12px;
  -webkit-overflow-scrolling: touch;
}

.record-detail-inner .analyze-preview-thumbs {
  margin-bottom: 8px;
}

.record-detail-store-wrap {
  margin-top: 12px;
}

.record-detail-store-wrap .store-select {
  width: 100%;
}

.record-detail-time {
  font-size: 13px;
  color: var(--subtext);
  margin-top: 12px;
  margin-bottom: 0;
}

.record-detail-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

@media (min-width: 520px) {
  .record-detail-overlay {
    align-items: center;
    padding: 24px;
  }

  .record-detail-panel {
    border-radius: var(--radius);
    max-height: min(88vh, 680px);
  }
}

/* Delete confirmation (above detail sheet) */
.record-delete-confirm {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.record-delete-confirm[hidden] {
  display: none !important;
}

.record-delete-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.record-delete-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.record-delete-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin: 0 0 8px;
  line-height: 1.35;
}

.record-delete-desc {
  font-size: 14px;
  color: var(--subtext);
  text-align: center;
  margin: 0 0 20px;
  line-height: 1.45;
}

.record-delete-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-delete-actions .btn-secondary,
.record-delete-actions .btn-danger {
  margin: 0;
}

@media (min-width: 520px) {
  .record-delete-confirm {
    align-items: center;
    padding: 24px;
  }

  .record-delete-dialog {
    border-radius: var(--radius);
    padding: 24px 20px 20px;
  }
}

.record-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.record-thumb-placeholder {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.record-info {
  flex: 1;
  min-width: 0;
}

.record-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-bottom: 2px;
}

.record-brand {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 4px;
}

.record-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.record-store-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.record-date {
  font-size: 11px;
  color: var(--subtext);
}

.record-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  text-align: right;
}

.record-price-currency {
  font-size: 13px;
  font-weight: 600;
}

.record-delete-btn {
  position: absolute;
  right: 12px;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--subtext);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.record-card:active .record-delete-btn,
.record-card.show-delete .record-delete-btn {
  opacity: 1;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  gap: 12px;
  text-align: center;
  color: var(--subtext);
}

.empty-icon {
  font-size: 56px;
  opacity: 0.5;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.empty-desc {
  font-size: 14px;
}

/* Compare / Search Result */
.identified-banner {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.identified-banner .label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.identified-banner .product {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.price-history-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.price-history-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg);
  gap: 12px;
}

.price-history-row:last-child {
  border-bottom: none;
}

.phi-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.phi-info {
  flex: 1;
  min-width: 0;
}

.phi-store {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.phi-date {
  font-size: 12px;
  color: var(--subtext);
}

.phi-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.phi-price .currency {
  font-size: 13px;
  font-weight: 600;
}

/* Load more button */
.load-more-btn {
  width: 100%;
  padding: 16px;
  text-align: center;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ============================
   Loading Overlay
   ============================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 999;
  backdrop-filter: blur(2px);
}

.loading-overlay[hidden] {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay p {
  font-size: 15px;
  color: var(--subtext);
}

/* ============================
   Toast Notification
   ============================ */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #323232;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 998;
  pointer-events: none;
  max-width: calc(var(--max-width) - 48px);
  white-space: normal;
  text-align: center;
}

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

.toast.error {
  background: var(--danger);
}

/* ============================
   Utility
   ============================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0 -16px;
}

.text-subtext {
  color: var(--subtext);
  font-size: 13px;
}
