:root {
  --bg: #f4f4f6;
  --card: rgba(255,255,255,.78);
  --text: #111827;
  --muted: #6b7280;
  --accent: #0a84ff;
  --line: rgba(17,24,39,.10);
  --income: #e7f6ed;
  --expense: #fff5d8;
  --shadow: 0 18px 50px rgba(15,23,42,.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(10,132,255,.18), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(52,199,89,.15), transparent 30%),
    var(--bg);
}

.ql-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(26px, env(safe-area-inset-bottom));
}

.glass {
  background: var(--card);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: var(--shadow);
}

.hero-card, .seo-card {
  border-radius: 34px;
  padding: 28px;
  margin: 18px 0;
}

.brand-pill {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

h1 {
  margin: 18px 0 10px;
  font-size: clamp(42px, 9vw, 78px);
  letter-spacing: -0.065em;
  line-height: .92;
}

h2 {
  margin: 0 0 10px;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.lead {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.hero-actions, .install-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-btn, .ghost-btn, .install-grid button, .footer-link {
  appearance: none;
  border: 0;
  text-decoration: none;
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 750;
  font-size: 15px;
  cursor: pointer;
}

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

.ghost-btn, .install-grid button, .footer-link {
  color: var(--text);
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
}

.soft-note {
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.ql-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 4px 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15,23,42,.28);
}

.hidden { display: none; }

.modal-card {
  position: relative;
  width: min(460px, 100%);
  border-radius: 28px;
  padding: 24px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  font-size: 24px;
  cursor: pointer;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 22px;
}

.placeholder-grid div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 640px) {
  .hero-card, .seo-card { border-radius: 28px; padding: 22px; }
  .hero-actions, .install-grid { display: grid; }
  .primary-btn, .ghost-btn, .install-grid button { width: 100%; }
  .placeholder-grid { grid-template-columns: 1fr; }
}

/* === Quick Ledger Auth UI 20260503-02 === */
.auth-panel {
  margin-top: 10px;
}

.form-label {
  display: block;
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.ql-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 16px;
  background: rgba(255,255,255,.82);
  font: inherit;
  font-size: 17px;
  outline: none;
}

.ql-input:focus {
  border-color: rgba(10,132,255,.45);
  box-shadow: 0 0 0 4px rgba(10,132,255,.12);
}

.wide-btn {
  width: 100%;
  margin-top: 14px;
}

.code-block {
  margin-top: 16px;
  padding-top: 2px;
}

.code-input {
  letter-spacing: .22em;
  font-weight: 800;
  text-align: center;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: rgba(10,132,255,.14);
  color: var(--accent);
  font-weight: 900;
}

.user-name {
  font-weight: 850;
  font-size: 18px;
}

.user-email {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

/* === Quick Ledger Personal Ledger UI 20260503-03 === */
.ledger-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.glass-soft {
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 16px;
}

.result-button {
  width: 100%;
  border: 0;
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,.78);
  text-align: left;
  cursor: pointer;
}

.result-button span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.result-button strong {
  display: block;
  margin-top: 4px;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.mini-results {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

.feed-head h2,
.ledger-input-card h2 {
  margin: 0;
}

.feed-head span {
  color: var(--muted);
  font-size: 13px;
}

.ledger-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.day-divider {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(17,24,39,.06);
}

.entry-row.income {
  background: var(--income);
}

.entry-row.expense {
  background: var(--expense);
}

.entry-purpose {
  font-weight: 820;
}

.entry-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.entry-amount {
  font-weight: 900;
  white-space: nowrap;
}

.entry-edit {
  margin-top: 6px;
  border: 0;
  background: rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  cursor: pointer;
}

.day-total {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.58);
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-top: 12px;
  border-radius: 18px;
  background: rgba(120,120,128,.12);
}

.seg {
  border: 0;
  border-radius: 14px;
  padding: 11px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.seg.active {
  background: rgba(255,255,255,.92);
  color: var(--text);
  box-shadow: 0 5px 18px rgba(15,23,42,.08);
}

@media (max-width: 640px) {
  .mini-results {
    display: grid;
  }
}

/* === Quick Ledger Entry Actions 20260503-04 === */
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.entry-delete {
  border: 0;
  background: rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 6px 9px;
  color: #9a3412;
  cursor: pointer;
}

/* === Quick Ledger File Picker 20260503-05 === */
.file-picker {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 15px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px dashed rgba(10,132,255,.35);
  cursor: pointer;
}

.file-picker input {
  display: none;
}

.file-picker span {
  font-weight: 850;
  color: var(--accent);
}

.file-picker small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Quick Ledger Report UI 20260503-06 === */
.report-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.report-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(120,120,128,.12);
}

.report-tab {
  border: 0;
  border-radius: 14px;
  padding: 11px 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.report-tab.active {
  background: rgba(255,255,255,.92);
  color: var(--text);
  box-shadow: 0 5px 18px rgba(15,23,42,.08);
}

.custom-period {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.report-output {
  margin-top: 14px;
}

.report-period {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.report-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid rgba(17,24,39,.07);
}

.report-line span {
  color: var(--muted);
}

.report-line b {
  font-size: 17px;
}

.report-line.strong b {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.report-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.report-split div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.64);
  border: 1px solid var(--line);
}

.report-split span,
.report-split small {
  display: block;
  color: var(--muted);
}

.report-split b {
  display: block;
  margin: 4px 0;
  font-size: 18px;
}

@media (max-width: 640px) {
  .custom-period,
  .report-split {
    grid-template-columns: 1fr;
  }
}

/* === Quick Ledger Group UI 20260503-07 === */
.group-card {
  margin-top: 14px;
}

.group-create {
  margin-top: 14px;
}

.group-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.group-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.72);
  text-align: left;
  cursor: pointer;
}

.group-row b,
.member-row b {
  display: block;
  color: var(--text);
}

.group-row small,
.member-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.group-details {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.group-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.group-title-row h2 {
  margin: 0;
}

.invite-box,
.members-box {
  margin-top: 12px;
}

.invite-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 15px;
  padding: 10px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.member-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.member-row {
  padding: 13px;
  border-radius: 16px;
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
}

@media (max-width: 640px) {
  .share-grid {
    grid-template-columns: 1fr;
  }
}

/* === Quick Ledger Scope UI 20260503-08 === */
.scope-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255,255,255,.52);
  border: 1px solid var(--line);
}

.group-scope-select {
  margin-top: 10px;
}

/* === Quick Ledger Category UI 20260503-09 === */
#ledgerSection {
  margin-bottom: 2px;
}


/* === Quick Ledger Sections UI 20260503-10 === */
.section-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.section-create-row .ghost-btn {
  white-space: nowrap;
  margin: 0;
}

.section-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .section-create-row {
    grid-template-columns: 1fr;
  }
}

/* === Quick Ledger Report By Sections 20260503-12 === */
.section-report {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.section-report h3 {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.section-report-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.62);
  border: 1px solid var(--line);
  margin-top: 8px;
}

.section-report-row small,
.section-report-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.section-report-row strong {
  display: block;
  margin-top: 3px;
  text-align: right;
  font-size: 17px;
}

@media (max-width: 640px) {
  .section-report-row {
    grid-template-columns: 1fr;
  }

  .section-report-row strong {
    text-align: left;
  }
}

/* === Quick Ledger Group Report UI 20260503-13 === */
.report-title {
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 4px;
}

.members-report h3 {
  margin-top: 4px;
}

/* === Quick Ledger Group Messages UI 20260503-14 === */
.messages-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.message-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.message-row {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
}

.message-row.unread {
  box-shadow: 0 0 0 3px rgba(10,132,255,.10);
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.message-head b {
  color: var(--text);
}

.message-text {
  margin-top: 6px;
  line-height: 1.35;
}

.message-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.message-compose .primary-btn {
  margin: 0;
  min-width: 84px;
}

@media (max-width: 640px) {
  .message-compose {
    grid-template-columns: 1fr;
  }

  .message-compose .primary-btn {
    width: 100%;
  }
}

/* === Quick Ledger Unread Message Modal 20260503-17 === */
.message-modal-card {
  max-width: 460px;
  text-align: left;
}

.message-modal-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(10,132,255,.12);
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 12px;
}

.message-modal-card h3 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.message-modal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.message-modal-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

/* === Quick Ledger Business Desk UI 20260503-18 === */
.business-card {
  margin-top: 14px;
}

.business-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  margin-top: 14px;
  border-radius: 18px;
  background: rgba(120,120,128,.12);
}

.business-tab {
  border: 0;
  border-radius: 14px;
  padding: 11px 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.business-tab.active {
  background: rgba(255,255,255,.92);
  color: var(--text);
  box-shadow: 0 5px 18px rgba(15,23,42,.08);
}

.business-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.business-panel h3 {
  margin: 0;
  font-size: 18px;
}

.business-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.business-grid-3 {
  display: grid;
  grid-template-columns: .7fr .7fr 1fr;
  gap: 8px;
}

.business-textarea {
  min-height: 90px;
  padding-top: 14px;
  resize: vertical;
}

.business-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.business-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
}

.business-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.business-row strong {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .business-grid-2,
  .business-grid-3,
  .business-row {
    grid-template-columns: 1fr;
  }
}

/* === Quick Ledger Business Desk Clarity 20260503-19 === */
.business-panel-note {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.bd-field {
  display: grid;
  gap: 5px;
}

.bd-field > span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

/* === Quick Ledger Proforma View / Print 20260503-20 === */
.business-row-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.small-btn {
  min-height: 34px;
  padding: 7px 12px;
  margin: 0;
}

.proforma-preview {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.proforma-preview-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.proforma-preview-actions .primary-btn,
.proforma-preview-actions .ghost-btn {
  margin: 0;
}

.proforma-document {
  background: #fff;
  color: #111827;
  border-radius: 18px;
  padding: 24px;
  border: 1px solid var(--line);
}

.pf-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  border-bottom: 2px solid #111827;
  padding-bottom: 18px;
}

.pf-kicker {
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .18em;
  color: #6b7280;
}

.pf-head h1 {
  margin: 4px 0;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.pf-head p,
.pf-parties p,
.pf-note p {
  margin: 3px 0;
  color: #4b5563;
}

.pf-meta {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.pf-meta div,
.pf-totals div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.pf-meta span,
.pf-totals span {
  color: #6b7280;
}

.pf-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

.pf-parties h3,
.pf-note h3 {
  margin: 0 0 8px;
  color: #6b7280;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: 13px;
}

.pf-table th {
  text-align: left;
  color: #6b7280;
  border-bottom: 1px solid #d1d5db;
  padding: 10px 8px;
}

.pf-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 8px;
  vertical-align: top;
}

.pf-table small {
  display: block;
  color: #6b7280;
  margin-top: 4px;
}

.pf-totals {
  max-width: 360px;
  margin: 20px 0 0 auto;
  display: grid;
  gap: 8px;
}

.pf-total {
  border-top: 2px solid #111827;
  padding-top: 10px;
  font-size: 20px;
}

.pf-note {
  margin-top: 22px;
}

.pf-fiscal-note {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #d1d5db;
  color: #6b7280;
  font-size: 12px;
}

@media print {
  body * {
    visibility: hidden !important;
  }

  #proformaDocument,
  #proformaDocument * {
    visibility: visible !important;
  }

  #proformaDocument {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 18mm;
  }
}

@media (max-width: 640px) {
  .pf-head,
  .pf-parties {
    grid-template-columns: 1fr;
  }

  .proforma-document {
    padding: 16px;
  }

  .proforma-preview-actions {
    display: grid;
  }
}

/* === Quick Ledger Proforma Print / Logo Slot 20260503-21 === */
.print-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.pf-brand-block {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
}

.pf-logo-slot {
  width: 96px;
  height: 72px;
  border-radius: 14px;
  border: 1px dashed #9ca3af;
  display: grid;
  place-items: center;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  background: #f9fafb;
}

@media print {
  .print-hint,
  .proforma-preview-actions {
    display: none !important;
  }

  .pf-logo-slot {
    background: #fff;
  }
}

@media (max-width: 640px) {
  .pf-brand-block {
    grid-template-columns: 1fr;
  }
}
