/* Business Tax Planner, agoodun.com
   Brand tokens, type stack and component shapes follow BRAND.md and the
   other agoodun.com apps (the base style.css from the brand kit, extended
   the same way Tax Planner extends it). The shell is wider than BRAND.md's
   440px because the monthly table needs the room; on a phone the table
   scrolls sideways with the label column pinned. */

:root {
  --color-primary: #ce0f69;
  --color-secondary-teal: #009ca6;
  --color-secondary-purple: #68478d;
  --color-tertiary-gold: #ffb81c;
  --color-tertiary-black: #000000;

  /* Actual figures read teal, estimates gold (darkened to hold up as
     text), money owed pink: the one thing that needs doing. */
  --state-under: var(--color-secondary-teal);
  --state-at: #b07400; /* the gold, darkened to hold up as text */
  --state-over: var(--color-primary);

  --state-under-soft: rgba(0, 156, 166, 0.1);
  --state-at-soft: rgba(255, 184, 28, 0.18);
  --state-over-soft: rgba(206, 15, 105, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Several classes below set `display`, which has equal specificity to
   the UA [hidden] rule and would silently win by source order, leaving
   "hidden" elements visible. Force it explicitly. */
[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f5f7;
  color: var(--color-tertiary-black);
}

a {
  color: inherit;
}

/* ---------------------------------------------------------------------
   App shell / nav
   --------------------------------------------------------------------- */

.app-shell {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-shell.wide {
  max-width: 900px;
}

/* The matrix earns the extra width: every person is a column, and a
   column that has to be scrolled to is a column nobody looks at. */
.app-shell.widest {
  max-width: 1180px;
}

.nav-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.nav-context {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nav-app-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: #f4f5f7;
  color: var(--color-tertiary-black);
}

.nav-link.active {
  color: var(--color-primary);
  background: rgba(206, 15, 105, 0.08);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-email {
  font-size: 0.8rem;
  color: #6b7280;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-logout:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */

.card {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.card.accent {
  border-top: 6px solid transparent;
  border-image: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary-teal),
    var(--color-secondary-purple),
    var(--color-tertiary-gold)
  );
  border-image-slice: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  margin-bottom: 4px;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.4;
}

.status {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  padding: 40px 0;
}

.status.error {
  color: var(--color-primary);
}

.section-heading {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------------
   Headline stats
   --------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 10px;
  background: #f9fafb;
  min-width: 0;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-value.positive {
  color: var(--color-secondary-teal);
}

.stat-value.negative {
  color: var(--color-primary);
}

.stat-value.warning {
  color: var(--state-at);
}

.stat-note {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.35;
}



.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill-actual {
  color: var(--state-under);
  background: var(--state-under-soft);
}

.pill-estimate {
  color: var(--state-at);
  background: var(--state-at-soft);
}

.pill-muted {
  color: #6b7280;
  background: #f4f5f7;
}

.mode-switch {
  display: inline-flex;
  background: #f4f5f7;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.mode-option {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-option:hover {
  color: var(--color-tertiary-black);
}

.mode-option.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}


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

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  color: #ffffff;
  background: var(--color-primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-primary:hover {
  box-shadow: 0 0 0 3px rgba(206, 15, 105, 0.12);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-tertiary-black);
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
}

.btn-secondary.small {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-text {
  display: inline-block;
  padding: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
  text-decoration: none;
}

.btn-text:hover {
  color: var(--color-tertiary-black);
}

.btn-text.danger:hover {
  color: var(--color-primary);
}

/* Square, quiet, and the same size as a tap target ought to be. Used for
   the role reorder arrows, where a word would be longer than the control
   it labels. */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  font-size: 0.95rem;
  font-family: inherit;
  color: #6b7280;
  background: #f9fafb;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-icon:hover:not(:disabled) {
  background: rgba(206, 15, 105, 0.1);
  color: var(--color-primary);
}

.btn-icon:disabled {
  opacity: 0.35;
  cursor: default;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-row.centred {
  justify-content: center;
  margin-top: 16px;
}

.modal-actions {
  margin-top: 20px;
  align-items: center;
}

.btn-primary.danger {
  background: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */

.input-group {
  margin-bottom: 20px;
}

.input-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}

.field-hint {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 6px;
  line-height: 1.4;
}

.text-input,
.text-select {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-tertiary-black);
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus,
.text-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(206, 15, 105, 0.12);
}

.text-select {
  cursor: pointer;
}

.form-error {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

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

/* ---------------------------------------------------------------------
   Auth gate
   --------------------------------------------------------------------- */

.auth-landing {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin: 40px auto;
}

.hero-copy {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.hero-copy h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.hero-tagline {
  font-size: 1rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 22px;
}

.hero-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.hero-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.4;
}

.hero-features li::before {
  content: "✓";
  flex-shrink: 0;
  color: var(--color-secondary-teal);
  font-weight: 700;
}

.auth-shell {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Shown when the "are you already signed in?" check didn't come back in
   time. It explains a delay rather than reporting a failure, because
   nothing has actually failed yet, the answer may still arrive. */
.auth-notice {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--state-at-soft);
}

.auth-notice p {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #374151;
}

.auth-notice .btn-text {
  padding: 6px 0 0;
  color: var(--state-at);
}

/* ---------------------------------------------------------------------
   Empty states
   --------------------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
}

.empty-state p {
  font-size: 0.9rem;
  margin-top: 6px;
}

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-card h2 {
  margin-bottom: 6px;
}

.modal-card .subtitle {
  margin-bottom: 20px;
}

/* ---------------------------------------------------------------------
   Explainer
   --------------------------------------------------------------------- */

.explainer {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.explainer summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-tertiary-black);
}

.explainer summary::-webkit-details-marker {
  display: none;
}

.explainer summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.explainer summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.explainer[open] summary::after {
  transform: rotate(-135deg);
}

.explainer[open] summary {
  border-bottom: 1px solid #f0f1f3;
}

.explainer-content {
  padding: 4px 24px 24px;
}

.explainer-content h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  margin-top: 18px;
  margin-bottom: 6px;
}

.explainer-content h2:first-child {
  margin-top: 0;
}

.explainer-content p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #374151;
}

/* ---------------------------------------------------------------------
   Powered by
   --------------------------------------------------------------------- */

.powered-by a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #6b7280;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}

.powered-by a:hover {
  color: var(--color-tertiary-black);
}

.powered-by-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

.powered-by strong {
  color: var(--color-primary);
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Narrow screens
   --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   Tax Planner: shared pieces
   --------------------------------------------------------------------- */

/* The grid page needs the most room: the grid and its live totals sit
   side by side. */
.app-shell.widest {
  max-width: 1240px;
}

.disclaimer {
  width: 100%;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #374151;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--state-at-soft);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b7280;
}

.save-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-secondary-teal);
}

.save-status.error {
  color: var(--color-primary);
}

.muted {
  color: #6b7280;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.two-up {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.two-up > .card {
  min-width: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.field-grid .input-group {
  margin-bottom: 0;
}

.field-grid .wide {
  grid-column: 1 / -1;
}

.money-input {
  position: relative;
}

.money-input::before {
  content: "£";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 0.95rem;
  pointer-events: none;
}

.money-input .text-input {
  padding-left: 26px;
  font-variant-numeric: tabular-nums;
}

.suffix-input {
  position: relative;
}

.suffix-input::after {
  content: attr(data-suffix);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 0.9rem;
  pointer-events: none;
}

.suffix-input .text-input {
  padding-right: 30px;
  font-variant-numeric: tabular-nums;
}

.text-input.invalid {
  border-color: var(--color-primary);
  background: var(--state-over-soft);
}

.subsection + .subsection {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f0f1f3;
}

.check-line {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #374151;
}

.check-line strong {
  font-variant-numeric: tabular-nums;
}

.warn-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--state-over-soft);
  font-size: 0.85rem;
  line-height: 1.5;
  color: #374151;
  margin-bottom: 18px;
}

.warn-box strong {
  color: var(--color-primary);
}

.source-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  word-break: break-all;
}

.source-list a {
  color: var(--color-secondary-teal);
}

textarea.text-input {
  resize: vertical;
  min-height: 70px;
  line-height: 1.45;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

/* ---------------------------------------------------------------------
   Results
   --------------------------------------------------------------------- */

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.result-head h2 {
  margin: 0;
}

.figure-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.figure-table th,
.figure-table td {
  padding: 8px 0;
  border-bottom: 1px solid #f0f1f3;
  vertical-align: top;
}

.figure-table th {
  font-weight: 600;
  text-align: left;
  color: #374151;
}

.figure-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  padding-top: 0;
}

.figure-table td + td,
.figure-table th + th {
  padding-left: 12px;
}

.figure-table .num {
  text-align: right;
}

.figure-table .sub th {
  font-weight: 400;
  padding-left: 12px;
  color: #6b7280;
}

.figure-table .total th,
.figure-table .total td {
  font-weight: 700;
  border-bottom: none;
  border-top: 2px solid #e5e7eb;
}

.figure-table .owed td {
  color: var(--color-primary);
}

.figure-table + .section-heading,
.figure-table + .check-line + .section-heading {
  margin-top: 22px;
}

.source-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.source-tag.estimated {
  color: var(--state-at);
}

.source-tag.confirmed,
.source-tag.entered {
  color: var(--state-under);
}

.empty-note {
  font-size: 0.88rem;
  color: #6b7280;
  line-height: 1.5;
  padding: 12px 0;
}

/* ---------------------------------------------------------------------
   Monthly grid
   --------------------------------------------------------------------- */


@media (max-width: 1100px) {
  .grid-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  .card {
    padding: 22px;
  }

  .grid-card {
    padding: 14px;
  }

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

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

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-email {
    display: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Payments
   --------------------------------------------------------------------- */

.date-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* ---------------------------------------------------------------------
   Business Tax Planner
   --------------------------------------------------------------------- */

/* The monthly tables want the full width on a desktop. */
.app-shell.wide {
  max-width: 1180px;
}

.disclaimer a,
.warn-box a,
.check-line a {
  color: var(--color-primary);
  font-weight: 600;
}

.narrow-input {
  max-width: 120px;
}

/* Wide tables: months run across, labels stay pinned on the left while
   the rest scrolls sideways on a phone. */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f1f3;
  vertical-align: middle;
  background: #ffffff;
}

.data-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
}

.data-table thead th.num {
  text-align: right;
}

.data-table tbody th {
  text-align: left;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.data-table .total th,
.data-table .total td {
  font-weight: 700;
  border-top: 2px solid #e5e7eb;
}

.data-table .sub th {
  font-weight: 400;
  color: #6b7280;
}

.data-table .total-col {
  background: #f9fafb;
}

.table-scroll.pinned .data-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1px 0 0 #f0f1f3;
}

.data-table .pill {
  margin-top: 4px;
  padding: 3px 8px;
  font-size: 0.68rem;
  letter-spacing: 0;
  text-transform: none;
}

.btn-text.tiny {
  padding: 2px 0;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}

.acct-name {
  display: block;
  min-width: 140px;
  max-width: 260px;
  white-space: normal;
}

.acct-from {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: #6b7280;
}

.text-select.compact {
  width: auto;
  min-width: 130px;
  padding: 7px 10px;
  font-size: 0.85rem;
}

.lines-table tr.needs-choice th,
.lines-table tr.needs-choice td {
  background: var(--state-over-soft);
}

.diff {
  color: var(--color-primary);
  font-weight: 700;
}

.ok-line {
  background: var(--state-under-soft);
  margin: 0 0 14px;
}

#mismatch .warn-box,
#mismatch .check-line {
  margin-top: 0;
}

/* Import */
.guide-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #374151;
  margin: 8px 0 20px;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 28px 20px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone .muted {
  font-size: 0.82rem;
  max-width: 460px;
  line-height: 1.45;
}

.drop-zone label.btn-primary {
  margin: 6px 0 0;
  color: #ffffff;
  font-size: 0.9rem;
}

.drop-zone.dragging-over {
  border-color: var(--color-primary);
  background: var(--state-over-soft);
}

.file-error {
  margin: 16px 0 0;
}

.month-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.month-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.month-choice input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.month-choice .pill {
  padding: 3px 8px;
  font-size: 0.7rem;
}

#warnings .check-line {
  margin: 0 0 14px;
}

.saved-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #374151;
}

/* Settings: the rules table */
.rates-table {
  min-width: 760px;
}

.rates-table th,
.rates-table td {
  padding: 6px 6px;
  vertical-align: middle;
}

.rates-table tbody th {
  white-space: nowrap;
  padding-right: 12px;
}

.rates-table .text-input {
  padding: 8px 10px;
  font-size: 0.85rem;
  min-width: 0;
}

.rates-table .money-input .text-input {
  padding-left: 22px;
}

.rates-table .money-input::before {
  left: 9px;
  font-size: 0.85rem;
}

.rates-table .suffix-input .text-input {
  padding-right: 24px;
}

.fy-head {
  white-space: nowrap;
}

.fy-span {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #6b7280;
}

.fy-head .pill {
  margin-top: 4px;
  padding: 3px 8px;
  font-size: 0.68rem;
  text-transform: none;
  letter-spacing: 0;
}

.pair-input {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #6b7280;
}

.pair-input .text-input {
  width: 48px;
  text-align: center;
}

.rate-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.rate-detail {
  border: 1px solid #f0f1f3;
  border-radius: 10px;
  padding: 12px 14px;
}

.rate-detail summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}

.rate-detail[open] summary {
  margin-bottom: 12px;
}

.rate-detail .source-list {
  margin-top: 8px;
}

.rate-detail .pill {
  padding: 3px 8px;
  font-size: 0.7rem;
}

.accounts-table .save-status {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .data-table th,
  .data-table td {
    padding: 7px 8px;
  }

  .acct-name {
    min-width: 110px;
    max-width: 150px;
  }

  .text-select.compact {
    min-width: 110px;
  }
}

/* Estimate */
.stat-grid {
  margin-top: 6px;
}

.forecast-grid .cell-input {
  width: 92px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--color-tertiary-black);
  background: var(--state-at-soft);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.forecast-grid .cell-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(206, 15, 105, 0.12);
}

.forecast-grid .cell-input.invalid,
.working-table .text-input.invalid {
  border-color: var(--color-primary);
  background: var(--state-over-soft);
}

.start-point {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.start-point label {
  margin: 0;
}

.compare-box {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f9fafb;
}

.compare-table th,
.compare-table td {
  padding: 6px 0;
}

.compare-box .btn-text {
  padding: 8px 0 0;
}

.delta {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta.up {
  color: var(--color-primary);
}

.delta.down {
  color: var(--color-secondary-teal);
}

.delta.neutral {
  color: #6b7280;
  font-weight: 600;
}

#warnings .warn-box {
  margin: 14px 0 0;
}

.working-table th {
  font-weight: 600;
}

.working-table td {
  width: 170px;
  vertical-align: middle;
}

.working-table label {
  display: inline;
  margin: 0;
  font-size: inherit;
}

.row-hint {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.4;
}

.working-table .text-input {
  padding: 8px 10px;
  font-size: 0.88rem;
  text-align: right;
}

.working-table .money-input .text-input {
  padding-left: 24px;
}

.working-table .note-input {
  margin-top: 6px;
  max-width: 320px;
  text-align: left;
  font-weight: 400;
}

@media (max-width: 720px) {
  .working-table td {
    width: 130px;
  }

  .forecast-grid .cell-input {
    width: 80px;
  }
}
