:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f1f5f9; }
a { color: inherit; }
.shell { width: min(100% - 28px, 720px); margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 0 44px; }
.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.eyebrow { margin: 0 0 3px; color: #64748b; font-size: .73rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0; color: #0f172a; font-size: clamp(1.8rem, 7vw, 2.5rem); letter-spacing: -.04em; }
h2 { margin: 0; font-size: 1.12rem; letter-spacing: -.015em; }
p { line-height: 1.55; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #dbeafe; color: #1d4ed8; cursor: pointer; font-size: 1.5rem; }
.icon-button:active { transform: scale(.96); }
.text-button { border: 0; background: transparent; color: #1d4ed8; cursor: pointer; font-weight: 700; }
.list-heading { display: flex; justify-content: space-between; align-items: baseline; margin: 0 3px 12px; }
.list-heading > span { color: #64748b; font-size: .82rem; }
.note-list { display: grid; gap: 12px; }
.note-card, .detail-card, .loading-card, .empty-card, .error-card { border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .05); }
.note-card { display: block; padding: 17px 17px 16px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.note-card:active { transform: scale(.99); }
.note-card p { display: -webkit-box; overflow: hidden; margin: 8px 0 0; color: #475569; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; color: #64748b; font-size: .78rem; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.status-complete { background: #dcfce7; color: #166534; }
.status-processing, .status-uploaded { background: #fef3c7; color: #92400e; }
.status-failed { background: #fee2e2; color: #991b1b; }
.loading-card, .empty-card, .error-card { padding: 32px 22px; text-align: center; }
.auth-card { border: 1px solid #bfdbfe; border-radius: 18px; background: #fff; padding: 30px 22px; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); }
.auth-card h2 { margin-bottom: 8px; }
.auth-card > p { margin: 0 0 20px; color: #475569; }
.lock-icon { margin-bottom: 12px; color: #1d4ed8; font-size: 2rem; }
.auth-card label { display: block; margin-bottom: 6px; color: #334155; font-size: .88rem; font-weight: 700; }
.auth-card input { display: block; width: 100%; min-height: 46px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px; font: inherit; }
.primary-button { width: 100%; min-height: 46px; margin-top: 12px; border: 0; border-radius: 10px; background: #1d4ed8; color: #fff; cursor: pointer; font: inherit; font-weight: 700; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.form-error { min-height: 1.4em; margin: 9px 0 0 !important; color: #b91c1c !important; font-size: .9rem; }
.loading-card { color: #475569; }
.empty-icon { margin-bottom: 8px; color: #94a3b8; font-size: 3rem; }
.empty-card p, .error-card p { margin: 8px auto 0; max-width: 430px; color: #64748b; }
.error-card h2 { color: #991b1b; }
.button-link, .back-link { display: inline-block; margin-top: 18px; color: #1d4ed8; font-weight: 700; text-decoration: none; }
.back-link { margin: 0 0 14px 3px; font-size: .9rem; }
.detail-card { padding: 18px; }
.detail-card > h2 { margin-bottom: 18px; font-size: clamp(1.45rem, 6vw, 2rem); }
.audio-section, .detail-section { border-top: 1px solid #e2e8f0; margin-top: 22px; padding-top: 18px; }
.audio-section h2, .detail-section h2 { margin-bottom: 9px; color: #334155; font-size: .95rem; }
audio { display: block; width: 100%; }
.detail-section p { margin: 0; color: #334155; white-space: pre-wrap; }
.transcript { color: #1e293b !important; line-height: 1.7; }
.detail-section ul { margin: 0; padding-left: 22px; color: #334155; line-height: 1.6; }
.processing-message, .failure-message { margin: 0 0 18px; border-radius: 12px; padding: 13px 14px; line-height: 1.45; }
.processing-message { background: #fffbeb; color: #92400e; }
.failure-message { background: #fef2f2; color: #991b1b; }
.processing-message p, .failure-message p { margin: 4px 0 0; }

@media (min-width: 600px) {
  .shell { padding-top: 40px; }
  .note-card:hover { box-shadow: 0 12px 30px rgba(15, 23, 42, .10); transform: translateY(-1px); }
}
