:root {
  color-scheme: light;
  --ink: #27111f;
  --muted: #735f6c;
  --pink: #f13582;
  --pink-dark: #c51d63;
  --pink-soft: #ffe3ef;
  --blush: #fff6fa;
  --plum: #321125;
  --line: #eadce4;
  --white: #ffffff;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 4%, rgba(241, 53, 130, 0.16), transparent 26rem),
    linear-gradient(180deg, #fffafd 0%, #f8f3f7 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.65; }
[hidden] { display: none !important; }

.centre-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
}

.auth-card {
  width: min(590px, 100%);
  padding: clamp(28px, 6vw, 54px);
  border: 1px solid rgba(50, 17, 37, 0.1);
  border-radius: 34px 34px 34px 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 80px rgba(50, 17, 37, 0.13);
  backdrop-filter: blur(18px);
}

.compact-card { display: flex; align-items: center; gap: 16px; width: auto; padding: 24px 28px; }
.compact-card p { margin: 0; color: var(--muted); font-weight: 700; }
.auth-brand { margin-bottom: 54px; }
.auth-title { margin-bottom: 18px; font-size: clamp(2.8rem, 10vw, 5.2rem); }
.auth-copy { margin-bottom: 30px; color: var(--muted); }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.outline-button {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e6bed0;
  border-radius: 12px;
  background: white;
  color: var(--pink-dark);
  font-weight: 800;
}
.outline-button:hover { border-color: var(--pink); background: var(--pink-soft); }

.light-status {
  padding: 12px 14px;
  margin-top: 16px;
  border-radius: 11px;
  background: var(--pink-soft);
  color: var(--pink-dark);
  font-size: 0.9rem;
}
.light-status.error { background: #fff0f1; color: var(--danger); }

.household-card { width: min(840px, 100%); }
.household-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.household-option { padding: 24px; border: 1px solid var(--line); border-radius: 20px; }
.household-option p { color: var(--muted); font-size: 0.9rem; }
.household-option .save-button, .household-option .outline-button { margin-top: 16px; }
.option-number { color: var(--pink); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; }
.household-card > .text-button { display: block; margin: 18px auto 0; }

.app-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 28px 28px 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(50, 17, 37, 0.1);
}

.app-nav {
  display: flex;
  gap: 6px;
  padding-top: 18px;
}
.app-nav button {
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}
.app-nav button:hover { background: var(--pink-soft); color: var(--pink-dark); }
.app-nav button.active { background: var(--plum); color: white; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px 11px 11px 3px;
  background: var(--pink);
  color: white;
  box-shadow: 0 8px 22px rgba(241, 53, 130, 0.3);
}

.privacy-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.account-area { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.household-chip { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; }
.household-chip > span { font-weight: 750; color: var(--ink); }
.household-chip button, .small-button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--muted);
  font-size: 0.76rem;
}
.household-chip button:hover, .household-chip button.copied, .small-button:hover { border-color: #f1a5c4; color: var(--pink-dark); }
.user-email { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }

.intro {
  max-width: 760px;
  padding: 64px 0 44px;
}

.eyebrow, .step-label {
  margin: 0 0 8px;
  color: var(--pink-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 820px;
  margin-bottom: 20px;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

h1 span { color: var(--pink); }

.intro-copy {
  max-width: 600px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 5px;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
  gap: 22px;
  align-items: start;
}

.composer-column { display: grid; gap: 22px; }

.capture-panel {
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  border-radius: 30px 30px 30px 8px;
  background: var(--plum);
  color: white;
  box-shadow: 0 24px 70px rgba(50, 17, 37, 0.2);
}

.panel-heading, .tasks-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.capture-panel .step-label { color: #ff8dba; }

.capture-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 0;
  margin: 0 0 24px;
  border: 0;
}
.capture-mode legend { width: 100%; margin-bottom: 8px; color: #f6c5da; font-size: 0.82rem; font-weight: 750; }
.capture-mode label { position: relative; margin: 0; cursor: pointer; }
.capture-mode input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.capture-mode label > span {
  display: grid;
  min-height: 76px;
  align-content: center;
  gap: 2px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}
.capture-mode label > span small { color: rgba(255, 255, 255, 0.5); font-size: 0.72rem; font-weight: 500; }
.capture-mode input:checked + span { border-color: #ff8dba; background: rgba(241, 53, 130, 0.2); box-shadow: inset 0 0 0 1px #ff8dba; }
.capture-mode input:focus-visible + span { outline: 3px solid rgba(241, 53, 130, 0.35); outline-offset: 2px; }

.ai-label {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #ffc0d9;
  font-size: 0.72rem;
  font-weight: 800;
}

.field { margin-bottom: 20px; }
label { display: block; margin-bottom: 7px; font-size: 0.9rem; font-weight: 700; }

textarea, input, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
}

textarea { min-height: 160px; resize: vertical; }

.capture-panel textarea {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.09);
  color: white;
}

.capture-panel textarea::placeholder { color: rgba(255, 255, 255, 0.48); }

textarea:focus, input:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(241, 53, 130, 0.28);
  outline-offset: 2px;
  border-color: var(--pink);
}

.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-row.dragging, .upload-row.has-file { border-color: #ff8dba; background: rgba(241, 53, 130, 0.12); }

.upload-copy { display: grid; gap: 2px; }
.upload-copy span { color: rgba(255, 255, 255, 0.55); font-size: 0.78rem; }

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

.upload-controls { display: flex; align-items: center; gap: 8px; }

.file-picker, .remove-file-button {
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
  color: white;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.file-picker:hover { background: rgba(255, 255, 255, 0.2); }
.remove-file-button { background: transparent; color: #ffc0d9; }
.file-summary { display: flex; width: 100%; align-items: center; gap: 11px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.file-summary > div { display: grid; min-width: 0; }
.file-summary strong { overflow: hidden; font-size: 0.9rem; text-overflow: ellipsis; white-space: nowrap; }
.file-summary span:last-child { color: rgba(255, 255, 255, 0.55); font-size: 0.76rem; }
.file-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--pink); }

.analyse-button, .save-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border: 0;
  border-radius: 12px;
  background: var(--pink);
  color: white;
  font-weight: 800;
}

.analyse-button:hover, .save-button:hover { background: #ff4a94; }
.analyse-button:disabled { background: #755167; color: #d7bdcb; cursor: wait; }

.manual-task-button {
  width: 100%;
  padding: 12px 14px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: transparent;
  color: #f6c5da;
  font-size: 0.86rem;
  font-weight: 750;
}
.manual-task-button:hover { border-color: rgba(255, 255, 255, 0.32); color: white; }

.status {
  padding: 12px 14px;
  margin-top: 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffe0ec;
  font-size: 0.9rem;
}

.status.error { border-color: rgba(255, 139, 139, 0.35); color: #ffb7b7; }

.result-panel {
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid #f1bed3;
  border-radius: 8px 30px 30px 30px;
  background: var(--blush);
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 20px;
  color: var(--pink-dark);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.section-divider::after { content: ""; height: 1px; flex: 1; background: #efc9d9; }
.document-fields { padding-bottom: 10px; }
.summary-input { min-height: 90px; background: white; }
.ocr-note { margin: -8px 0 24px; color: var(--muted); font-size: 0.78rem; }

.result-dot {
  width: 11px;
  height: 11px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 7px var(--pink-soft);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-actions { display: flex; align-items: center; gap: 10px; }
.form-actions .save-button { flex: 1; }

.text-button {
  padding: 13px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.text-button:hover { color: var(--ink); }

.tasks-panel {
  position: sticky;
  top: 22px;
  min-height: 410px;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid rgba(50, 17, 37, 0.1);
  border-radius: 30px 8px 30px 30px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 55px rgba(50, 17, 37, 0.08);
  backdrop-filter: blur(18px);
}

.count-badge, .badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--pink-dark);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.tasks-header-actions { display: flex; align-items: center; gap: 7px; }
.icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--pink-dark);
  font-size: 1rem;
}
.icon-button:hover { border-color: #f1a5c4; background: var(--pink-soft); }

.task-tools { display: grid; gap: 10px; margin: -8px 0 22px; }
.task-tools input { padding: 10px 12px; border-radius: 10px; font-size: 0.86rem; }
.filter-buttons { display: flex; gap: 6px; }
.filter-buttons button {
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: #f5edf2;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}
.filter-buttons button.active { background: var(--plum); color: white; }

.task { padding: 19px 0; border-top: 1px solid var(--line); }
.task:first-child { padding-top: 0; border-top: 0; }
.task p { margin: 0; color: var(--muted); font-size: 0.91rem; }
.task.completed h3, .task.completed .task-description { text-decoration: line-through; opacity: 0.48; }
.task-details { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.task-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.task-actions button {
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: #f5edf2;
  color: #684c5d;
  font-size: 0.78rem;
  font-weight: 700;
}
.task-actions button:hover { background: var(--pink-soft); color: var(--pink-dark); }
.task-actions .danger-button { background: transparent; color: #9c5365; }
.task-actions .danger-button:hover { background: #fff0f1; color: var(--danger); }

.deadline-summary {
  padding: 10px 12px;
  margin: -10px 0 15px;
  border-radius: 10px;
  background: #fff4df;
  color: #795410;
  font-size: 0.78rem;
  font-weight: 750;
}
.task.deadline-overdue, .task.deadline-today, .task.deadline-soon { padding-left: 12px; border-left: 3px solid; }
.task.deadline-overdue { border-left-color: #d92d20; }
.task.deadline-today { border-left-color: var(--pink); }
.task.deadline-soon { border-left-color: #e9a400; }
.badge.due-badge.overdue { background: #ffebe9; color: #b42318; }
.badge.due-badge.today { background: #ffe0ed; color: #b81758; }
.badge.due-badge.soon { background: #fff1cf; color: #805b0b; }

.empty-state {
  display: grid;
  min-height: 260px;
  place-content: center;
  justify-items: center;
  text-align: center;
}
.empty-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--pink);
  font-size: 1.35rem;
  font-weight: 800;
}
.empty-state p { margin-bottom: 2px; color: var(--ink); font-weight: 750; }
.empty-state > span:last-child { color: var(--muted); font-size: 0.86rem; }

.archive-page { padding: 58px 0 30px; }
.archive-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 34px;
  align-items: end;
  margin-bottom: 52px;
}
.archive-hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.archive-search-card {
  padding: 25px;
  border: 1px solid #f1bed3;
  border-radius: 26px 26px 26px 8px;
  background: var(--blush);
  box-shadow: 0 18px 48px rgba(50, 17, 37, 0.08);
}
.archive-search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.archive-search-row .save-button { width: auto; }
.archive-search-card > select { padding-block: 10px; }
.archive-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.document-card {
  display: flex;
  min-height: 255px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px 22px 22px 7px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 36px rgba(50, 17, 37, 0.06);
}
.document-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.document-type-badge { padding: 5px 9px; border-radius: 999px; background: var(--pink-soft); color: var(--pink-dark); font-size: 0.72rem; font-weight: 800; }
.document-date { color: var(--muted); font-size: 0.74rem; }
.document-card h3 { font-size: 1.1rem; }
.document-card > p { display: -webkit-box; overflow: hidden; margin-bottom: 18px; color: var(--muted); font-size: 0.86rem; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.document-meta { overflow: hidden; margin-top: auto; color: #92798a; font-size: 0.73rem; text-overflow: ellipsis; white-space: nowrap; }
.document-actions { display: flex; gap: 7px; margin-top: 14px; }
.document-actions button { padding: 8px 10px; border: 0; border-radius: 9px; font-size: 0.78rem; font-weight: 750; }
.document-open-button { flex: 1; background: var(--plum); color: white; }
.document-open-button:hover { background: #541d3e; }
.document-delete-button { background: #fff0f1; color: var(--danger); }
.archive-empty { display: grid; min-height: 300px; place-content: center; justify-items: center; text-align: center; }
.archive-empty p { margin-bottom: 2px; font-weight: 750; }
.archive-empty > span:last-child { color: var(--muted); font-size: 0.86rem; }

@media (max-width: 820px) {
  .app-shell { padding-inline: 18px; }
  .intro { padding: 48px 0 34px; }
  .workspace { grid-template-columns: 1fr; }
  .tasks-panel { position: static; }
  .topbar { align-items: flex-start; }
  .account-area { align-items: flex-end; flex-direction: column; }
  .user-email { display: none; }
  .archive-hero { grid-template-columns: 1fr; align-items: start; }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .app-shell { padding: 20px 14px 50px; }
  .privacy-note { display: none; }
  .intro { padding-top: 40px; }
  .capture-panel, .result-panel, .tasks-panel { padding: 21px; border-radius: 22px; }
  .upload-row { align-items: flex-start; flex-direction: column; }
  .upload-controls { width: 100%; }
  .file-picker { flex: 1; text-align: center; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .task-actions button { flex: 1; }
  .auth-card { padding: 28px 21px; border-radius: 24px; }
  .auth-brand { margin-bottom: 38px; }
  .auth-actions, .household-options { grid-template-columns: 1fr; }
  .household-chip { align-items: flex-end; flex-direction: column; gap: 4px; }
  .household-chip > span { display: none; }
  .capture-mode { grid-template-columns: 1fr; }
  .app-nav { overflow-x: auto; }
  .archive-page { padding-top: 40px; }
  .archive-search-row, .document-grid { grid-template-columns: 1fr; }
  .archive-search-row .save-button { width: 100%; }
}
