:root {
  color-scheme: light;
  --bg: #f3f7f3;
  --bg-strong: #e8f0eb;
  --surface: #ffffff;
  --surface-soft: #f7faf7;
  --surface-tint: #eef6ef;
  --text: #122019;
  --muted: #64746a;
  --line: #d9e4dc;
  --line-strong: #c7d6cc;
  --accent: #26795a;
  --accent-dark: #155940;
  --amber: #b8751b;
  --danger: #a4443f;
  --shadow: 0 18px 44px rgba(19, 48, 32, 0.08);
  --shadow-soft: 0 10px 28px rgba(19, 48, 32, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(38, 121, 90, 0.09), transparent 32rem),
    linear-gradient(135deg, #f6f9f6 0%, #eef5ef 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
}

.sidebar {
  display: none;
}

.main-shell {
  min-width: 0;
}

.topbar,
.top-actions,
.section-heading,
.section-subtitle,
.entry-form-row,
.time-block,
.brand,
.side-nav button {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.date-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.date-input {
  width: min(252px, calc(100vw - 104px));
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 24px;
  font-weight: 760;
  line-height: 1.1;
}

.top-actions {
  gap: 10px;
}

.icon-button,
.mini-icon-button,
.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.icon-button,
.mini-icon-button {
  display: inline-grid;
  place-items: center;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.secondary-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  gap: 8px;
  font-size: 14px;
  font-weight: 750;
}

.secondary-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.desktop-only {
  display: none;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(232, 240, 235, 0.85);
}

.mode-tab {
  min-height: 42px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.mode-tab.is-active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(23, 33, 27, 0.08);
}

.workspace-grid {
  display: block;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.plan-card,
.record-card,
.bill-card,
.expense-card,
.field-group,
.field-grid label,
.entry-form,
.bill-preview,
.timeline-empty,
.insight-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.plan-card,
.record-card,
.bill-card,
.expense-card {
  padding: 16px;
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

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

h1 {
  font-size: 22px;
  line-height: 1.22;
}

h2 {
  font-size: 17px;
  line-height: 1.3;
}

h3 {
  margin: 18px 0 8px;
  font-size: 16px;
  line-height: 1.35;
}

.section-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff5e7;
  color: var(--amber);
  font-size: 12px;
  font-weight: 760;
}

.field-group,
.field-grid label,
.entry-form {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.priority-card {
  border-color: rgba(38, 121, 90, 0.25);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
}

.principle-card {
  background: #fffaf2;
  border-color: #edd9b7;
}

label {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfb;
  color: var(--text);
  outline: none;
}

input {
  min-height: 42px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  min-height: 86px;
  padding: 10px 11px;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: rgba(38, 121, 90, 0.58);
  box-shadow: 0 0 0 3px rgba(38, 121, 90, 0.12);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.section-subtitle {
  justify-content: space-between;
  margin: 18px 0 10px;
}

.text-button {
  min-height: 34px;
  padding: 0 6px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 780;
}

.time-block {
  gap: 8px;
  margin-bottom: 8px;
}

.time-block input[type="time"] {
  flex: 0 0 84px;
  padding: 0 8px;
}

.block-title {
  min-width: 0;
}

.mini-icon-button {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 7px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.quick-action {
  display: grid;
  gap: 7px;
  place-items: center;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.quick-action svg {
  width: 22px;
  height: 22px;
}

.quick-action.is-active {
  border-color: rgba(38, 121, 90, 0.5);
  background: var(--surface-tint);
  color: var(--accent-dark);
}

.quick-action span {
  font-size: 12px;
  font-weight: 760;
}

.entry-form-row {
  gap: 10px;
}

.entry-form-row label {
  flex: 1;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 820;
  box-shadow: 0 14px 26px rgba(38, 121, 90, 0.2);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:active {
  transform: translateY(1px);
}

.timeline {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.timeline-item {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.timeline-time {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.35;
}

.timeline-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.timeline-content-input {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  resize: none;
  overflow: hidden;
}

.timeline-content-input:hover {
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.timeline-content-input:focus {
  border-color: var(--accent);
  background: var(--input-bg);
  color: var(--text);
}

.delete-entry {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #f4f6f4;
  color: var(--muted);
}

.timeline-empty {
  padding: 22px 14px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.bill-action {
  width: auto;
  min-width: 152px;
  padding: 0 18px;
}

.bill-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.insight-card {
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.insight-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.insight-card strong {
  display: block;
  margin: 6px 0 5px;
  font-size: 22px;
  line-height: 1.1;
}

.insight-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bill-preview {
  min-height: 320px;
  padding: 16px;
  line-height: 1.65;
}

.ai-review-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.ai-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.ai-review-head span {
  display: block;
  font-size: 15px;
  font-weight: 760;
}

.ai-review-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ai-review-head .secondary-button {
  width: auto;
  min-height: 36px;
}

.ai-review-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.ai-review-tools .secondary-button,
.ai-review-tools .primary-button {
  width: auto;
  min-height: 36px;
  padding-inline: 12px;
  white-space: nowrap;
}

.ai-review-content {
  padding: 16px;
  line-height: 1.72;
}

.ai-review-content h2 {
  margin: 18px 0 10px;
}

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

.ai-review-content ul,
.ai-review-content ol {
  padding-left: 22px;
}

.bill-preview h2 {
  margin: 18px 0 10px;
}

.bill-preview h2:first-child {
  margin-top: 0;
}

.bill-preview ul,
.bill-preview ol {
  padding-left: 22px;
}

.bill-preview li {
  margin: 5px 0;
}

.bill-preview table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}

.bill-preview th,
.bill-preview td {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.bill-preview th:first-child,
.bill-preview td:first-child {
  width: 92px;
  white-space: nowrap;
}

.bill-preview th:nth-child(3),
.bill-preview td:nth-child(3) {
  width: 84px;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .app-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 22px;
    padding: 22px;
  }

  .sidebar {
    position: sticky;
    top: 22px;
    display: flex;
    flex-direction: column;
    align-self: start;
    height: calc(100vh - 44px);
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .brand {
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }

  .brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
  }

  .brand strong {
    font-size: 17px;
  }

  .side-nav {
    display: grid;
    gap: 6px;
    margin: 18px 0;
  }

  .side-nav button {
    gap: 10px;
    min-height: 42px;
    padding: 0 10px;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 760;
    text-align: left;
  }

  .side-nav button.is-active,
  .side-nav button:hover {
    background: var(--surface-tint);
    color: var(--accent-dark);
  }

  .mini-calendar {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
  }

  .calendar-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 780;
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
  }

.calendar-grid span {
    display: grid;
    place-items: center;
    min-height: 24px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 11px;
  }

  .calendar-grid button {
    display: grid;
    place-items: center;
    min-height: 24px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
  }

  .calendar-grid button:hover {
    background: #fff;
    color: var(--accent-dark);
  }

  .calendar-grid span:nth-child(-n + 7) {
    min-width: 0;
  }

  .topbar {
    min-height: 64px;
    margin-bottom: 18px;
    padding: 0 4px;
  }

  .date-input {
    width: 220px;
    font-size: 28px;
  }

  .desktop-only {
    display: inline-flex;
  }

.mobile-export {
  display: none;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 31, 27, 0.52);
  backdrop-filter: blur(4px);
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 44, 35, 0.22);
  padding: 24px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

  .login-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    font: inherit;
  }

  .login-input + .login-input {
    margin-top: 10px;
  }

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

  .mode-tabs {
    display: none;
  }

  .workspace-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.84fr) minmax(460px, 1.16fr);
    gap: 18px;
    align-items: stretch;
  }

  .panel,
  .panel.is-active {
    display: block;
  }

  .bill-card {
    grid-column: 1 / -1;
  }

  .plan-card,
  .record-card,
  .bill-card {
    padding: 20px;
  }

  .plan-card,
  .record-card {
    min-height: 0;
  }

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

  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }

  .entry-form {
    margin-bottom: 16px;
  }

  .insight-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .bill-card .section-heading {
    align-items: start;
  }

  .bill-preview {
    column-gap: 28px;
  }
}

.plain-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.plain-icon:hover {
  background: var(--surface-tint);
  color: var(--accent-dark);
}

.record-layout {
  display: grid;
  gap: 16px;
}

.compact-title {
  margin-top: 0;
}

.timeline-title-group,
.field-actions {
  display: flex;
  align-items: center;
}

.timeline-title-group {
  gap: 8px;
}

.section-collapse-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--surface-tint);
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 820;
  line-height: 1;
}

.section-collapse-button .toggle-mark {
  transform: rotate(90deg);
}

.section-collapse-button.is-collapsed .toggle-mark {
  transform: rotate(0deg);
}

.section-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.manual-time-toggle {
  justify-self: start;
  min-height: 34px;
  padding: 0 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 760;
}

.timeline-editor,
.module-editor {
  min-width: 0;
}

.module-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  padding: 2px 2px 14px;
  margin-bottom: 8px;
}

.module-shortcuts button {
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(38, 121, 90, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 243, 0.96));
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 61, 47, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.28;
  white-space: normal;
  word-break: break-word;
  text-align: center;
}

.module-shortcuts button:hover {
  border-color: rgba(38, 121, 90, 0.45);
  background: linear-gradient(180deg, #ffffff, #e8f4ee);
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.doc-module {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 18px;
}

.doc-module-head,
.field-title-row,
.module-actions {
  display: flex;
  align-items: center;
}

.doc-module-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.module-toggle {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--surface-tint);
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 820;
  line-height: 1;
}

.toggle-mark {
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.doc-module.is-open .toggle-mark {
  transform: rotate(90deg);
}

.module-title-input {
  min-height: 38px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 17px;
  font-weight: 820;
}

.module-title-input:focus {
  border: 0;
  box-shadow: none;
}

.module-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.danger-button {
  color: var(--danger);
}

.module-fields {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.doc-module:not(.is-open) .module-fields {
  display: none;
}

.module-field {
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.field-title-row {
  justify-content: space-between;
  gap: 10px;
}

.field-label-input {
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.field-label-input:focus {
  border: 0;
  box-shadow: none;
}

.field-value-input {
  min-height: 76px;
  overflow-y: hidden;
  resize: none;
}

.field-value-input.is-compact {
  min-height: 42px;
}

.field-value-input.is-medium {
  min-height: 58px;
}

.field-actions {
  gap: 4px;
}

.icon-text-action {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 720;
  line-height: 1;
}

.icon-text-action:hover {
  background: var(--surface-tint);
  color: var(--accent-dark);
}

.icon-text-action.danger-button:hover,
.remove-field:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.mini-text-button {
  min-height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.mini-text-button:hover {
  background: #f4f6f4;
  color: var(--danger);
}

@media (min-width: 1180px) {
  .workspace-grid {
    grid-template-columns: minmax(430px, 0.78fr) minmax(560px, 1.22fr);
  }

  .bill-card {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  .bill-card .section-heading {
    grid-column: 1 / 2;
    grid-row: 1;
    display: block;
    margin: 0;
  }

  .bill-action {
    width: 100%;
    margin-top: 18px;
  }

  .bill-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .insight-grid {
    grid-column: 1 / 2;
    grid-row: 2;
    grid-template-columns: 1fr;
    align-self: start;
  }

  .bill-preview {
    grid-column: 2 / 3;
    grid-row: 1;
  }

  .ai-review-panel {
    grid-column: 2 / 3;
    grid-row: 2;
    margin-top: 0;
  }
}

@media (max-width: 899px) {
  .timeline {
    max-height: min(340px, 48vh);
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
  }

  .module-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-module-head {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .module-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .bill-card .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .bill-action {
    width: 100%;
  }

  .ai-review-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-review-head .secondary-button {
    width: 100%;
  }

  .ai-review-tools {
    width: 100%;
    flex-direction: column;
  }

  .ai-review-tools .secondary-button,
  .ai-review-tools .primary-button {
    width: 100%;
    justify-content: center;
  }
}

/* Reference style pass: warm earth palette, softer elevation, and clearer navigation. */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1480px;
  --sidebar-width: 292px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3ef;
  --bg-strong: #ebe7de;
  --surface: #ffffff;
  --surface-soft: #fafaf8;
  --surface-tint: #f5f0e8;
  --text: #1a1a18;
  --muted: #5c5a55;
  --line: #e2e0da;
  --line-strong: #cfc9bd;
  --accent: #8b7355;
  --accent-dark: #6f573a;
  --amber: #c4943a;
  --danger: #c44e4e;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.05), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
  --sidebar-bg: rgba(255, 255, 255, 0.82);
  --input-bg: #f8f7f5;
  --hover-bg: #f0efeb;
  --active-bg: #e8e6e0;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1a18;
  --bg-strong: #222220;
  --surface: #2a2a27;
  --surface-soft: #222220;
  --surface-tint: #2e2a22;
  --text: #e8e6e0;
  --muted: #a8a6a0;
  --line: #3a3a37;
  --line-strong: #4a4945;
  --accent: #c4a97a;
  --accent-dark: #d4bc92;
  --amber: #d4a44a;
  --danger: #e06060;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.2);
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  --sidebar-bg: rgba(30, 30, 28, 0.85);
  --input-bg: #2e2e2b;
  --hover-bg: #32322f;
  --active-bg: #3a3a37;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  transition: background var(--transition-slow), color var(--transition-slow);
}

button,
input,
textarea {
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.app-shell {
  width: min(100%, var(--max-width));
  padding: calc(20px + env(safe-area-inset-top)) 18px calc(90px + env(safe-area-inset-bottom));
}

.plan-card,
.record-card,
.bill-card,
.field-group,
.field-grid label,
.entry-form,
.bill-preview,
.timeline-empty,
.insight-card,
.doc-module {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.plan-card,
.record-card,
.bill-card {
  padding: 20px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h1 {
  font-size: 24px;
  font-weight: 780;
  letter-spacing: 0;
}

.section-heading p,
.date-label,
.timeline-content p,
.insight-card p,
.side-nav button {
  color: var(--muted);
}

.status-pill {
  background: var(--surface-tint);
  color: var(--accent);
}

input,
textarea {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.primary-button {
  border-radius: var(--radius);
  background: var(--accent);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 22%, transparent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button,
.icon-button,
.mini-icon-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.priority-card {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  background: var(--surface-tint);
}

.principle-card {
  border-color: color-mix(in srgb, var(--amber) 28%, var(--line));
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
}

.timeline {
  gap: 8px;
  max-height: 380px;
}

.timeline-item {
  grid-template-columns: minmax(184px, 208px) 1fr auto;
  gap: 12px;
  padding: 14px;
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.timeline-item:hover {
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.timeline-time,
.field-label-input,
.module-toggle,
.plain-icon:hover {
  color: var(--accent);
}

.is-hidden {
  display: none !important;
}

.timeline-time-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 6px;
}

.timeline-time-edit input {
  width: 100%;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 4px;
}

.history-record-view {
  display: grid;
  gap: 18px;
}

.history-record-head,
.history-read-section,
.history-module-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
}

.history-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.history-record-head h2 {
  margin: 8px 0 4px;
}

.history-record-head p,
.history-field p,
.history-timeline-item p {
  color: var(--muted);
}

.history-date-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.history-read-section {
  padding: 18px;
}

.history-read-section h3,
.history-module-card h3 {
  margin-bottom: 12px;
}

.history-timeline-list,
.history-module-list {
  display: grid;
  gap: 10px;
}

.history-timeline-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}

.history-timeline-item time {
  color: var(--accent);
  font-weight: 900;
}

.history-module-card {
  padding: 14px;
}

.history-field + .history-field {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.history-field strong {
  display: block;
  margin-bottom: 6px;
}

.delete-entry,
.mini-text-button:hover {
  background: var(--hover-bg);
}

.timeline-empty {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}

.module-shortcuts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 12px;
}

.module-shortcuts button {
  min-height: 38px;
  border-color: var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--accent);
  box-shadow: none;
  font-size: 12px;
  font-weight: 720;
}

.module-shortcuts button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent-dark);
}

.doc-module {
  border-radius: var(--radius);
}

.module-toggle {
  background: var(--surface-tint);
}

.module-title-input,
.field-label-input {
  color: var(--text);
}

.login-modal {
  background: color-mix(in srgb, var(--bg) 72%, rgba(0, 0, 0, 0.5));
}

.login-card {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.theme-toggle {
  display: none;
}

.mobile-nav {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 800;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(1.2);
}

.mobile-nav button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 50px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.mobile-nav svg {
  width: 19px;
  height: 19px;
}

.mobile-nav button.is-active {
  background: var(--surface-tint);
  color: var(--accent);
}

.mode-tabs {
  display: none;
}

@media (min-width: 900px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 28px;
    padding: 28px 32px 48px;
  }

  .sidebar {
    top: 28px;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 18px;
    height: calc(100vh - 56px);
    padding: 24px;
    border-color: var(--line);
    border-radius: var(--radius-xl);
    background: var(--sidebar-bg);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 65%, transparent), var(--shadow-lg);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    overflow: hidden;
  }

  .brand {
    gap: 12px;
    padding-bottom: 20px;
    border-bottom-color: var(--line);
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  }

  .brand strong {
    font-size: 16px;
    font-weight: 780;
  }

  .side-nav {
    gap: 4px;
    margin: 0;
  }

  .side-nav button {
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    font-weight: 650;
  }

  .side-nav button:hover {
    background: var(--hover-bg);
    color: var(--text);
  }

  .side-nav button.is-active {
    background: var(--surface-tint);
    color: var(--accent);
  }

  .mini-calendar {
    padding: 14px 12px;
    border-color: var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    overflow: hidden;
  }

  .mini-calendar .calendar-grid {
    gap: 4px;
  }

  .calendar-grid button {
    min-height: 30px;
    border-radius: 8px;
    font-size: 12px;
  }

  .calendar-grid button:hover {
    background: var(--hover-bg);
    color: var(--text);
  }

  .calendar-grid button.is-today {
    background: var(--accent);
    color: #fff;
    font-weight: 780;
  }

  .calendar-grid button.is-selected:not(.is-today) {
    background: var(--surface-tint);
    color: var(--accent);
    font-weight: 780;
  }

  .theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    margin-top: 0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 680;
    text-align: left;
  }

  .theme-toggle:hover {
    background: var(--hover-bg);
    color: var(--text);
  }

  .toggle-dot {
    position: relative;
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: var(--line);
    transition: background var(--transition);
  }

  .toggle-dot::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition);
  }

  [data-theme="dark"] .toggle-dot {
    background: var(--accent);
  }

  [data-theme="dark"] .toggle-dot::after {
    transform: translateX(14px);
  }

  .workspace-grid {
    gap: 20px;
  }

  .plan-card,
  .record-card,
  .bill-card {
    padding: 24px;
  }

  .mobile-nav {
    display: none;
  }
}

@media (min-width: 1180px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* Plan layout refinements. */
.top-actions {
  align-items: center;
}

.top-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 72%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #ffffff 4%), color-mix(in srgb, var(--surface-soft) 86%, var(--accent) 14%));
  color: var(--text);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #ffffff 34%, transparent),
    0 12px 22px color-mix(in srgb, #000 12%, transparent),
    0 0 0 1px color-mix(in srgb, var(--line) 42%, transparent);
  font-size: 15px;
  font-weight: 780;
  line-height: 1;
}

.top-actions .desktop-only {
  display: none;
}

.top-actions .secondary-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.top-actions .secondary-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--accent) 8%), color-mix(in srgb, var(--surface-soft) 78%, var(--accent) 22%));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #ffffff 38%, transparent),
    0 16px 28px color-mix(in srgb, #000 14%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.top-actions .secondary-button:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 8px color-mix(in srgb, #000 10%, transparent),
    0 6px 14px color-mix(in srgb, #000 12%, transparent);
}

.plan-section-stack {
  display: grid;
  gap: 12px;
}

.plan-section-titlebar {
  margin-bottom: 0;
}

.plan-section-titlebar h2 {
  font-size: 17px;
}

.plan-sections {
  display: grid;
  gap: 14px;
}

.plan-section-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.plan-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
}

.plan-section-name {
  min-height: 38px;
  padding: 0 10px;
  font-size: 15px;
  font-weight: 780;
}

.plan-section-content {
  min-height: 66px;
}

.time-block {
  display: grid;
  grid-template-columns: 88px 88px minmax(0, 1fr) 40px;
  align-items: start;
}

.time-block .block-title {
  min-height: 42px;
  max-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

@media (max-width: 899px) {
  .time-block {
    grid-template-columns: 1fr 1fr 40px;
  }

  .time-block .block-title {
    grid-column: 1 / -1;
  }
}

@media (min-width: 900px) {
  .top-actions .desktop-only {
    display: inline-flex;
  }
}

@media (max-width: 899px) {
  .app-shell {
    padding-bottom: calc(98px + env(safe-area-inset-bottom));
  }

  .module-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== Growth marker (star highlight) ===== */
.growth-marker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.star-rating {
  display: flex;
  gap: 2px;
  align-items: center;
}

.star-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  transition: all var(--transition);
}

.star-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  transition: all var(--transition);
}

.star-btn:hover {
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
}

.star-btn:hover svg {
  stroke: var(--amber);
}

.star-btn.is-lit {
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
}

.star-btn.is-lit svg {
  fill: var(--amber);
  stroke: var(--amber);
}

#growthKeywords {
  width: 180px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--input-bg);
  font-size: 13px;
  color: var(--text);
  transition: all var(--transition);
}

#growthKeywords:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 14%, transparent);
}

@media (max-width: 899px) {
  .timeline {
    max-height: min(340px, 48vh);
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
  }

  .record-card .section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .record-card .section-heading > div:first-child {
    min-width: 0;
  }

  .record-card .section-heading h1 {
    white-space: normal;
  }

  .record-card .section-heading p {
    max-width: none;
    line-height: 1.65;
  }

  .growth-marker {
    width: 100%;
    flex-wrap: wrap;
  }

  #growthKeywords {
    width: min(100%, 280px);
    flex: 1 1 180px;
  }

  .timeline-item {
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 9px 10px;
    padding: 10px;
  }

  .timeline-time-edit {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 96px));
    gap: 8px;
  }

  .timeline-time-edit input {
    min-height: 40px;
    padding: 5px 3px;
    font-size: 12px;
  }

  .timeline-content {
    grid-column: 1;
    grid-row: 2;
  }

  .delete-entry {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
  }
}

.site-footer {
  padding: 18px 12px 24px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

.beian-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.beian-police-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.beian-police-link img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.expense-card {
  grid-column: 1 / -1;
}

.expense-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.expense-section {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.expense-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.expense-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

.expense-table th,
.expense-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

.expense-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.expense-input {
  width: 100%;
  min-width: 86px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 8px;
}

.pending-item,
.pending-note {
  min-width: 150px;
}

.pending-amount {
  min-width: 86px;
}

.expense-empty,
.expense-empty-cell {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.expense-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.expense-empty.is-hidden {
  display: none;
}

.expense-empty-cell {
  text-align: center;
  padding: 18px 8px;
}

.expense-category-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.expense-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.expense-category-item span {
  color: var(--muted);
  font-size: 13px;
}

.expense-category-item strong {
  font-size: 15px;
}

@media (min-width: 900px) {
  .expense-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .expense-card {
    padding: 24px;
  }

  .expense-category-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.site-footer a:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ===== Calendar data dot & highlight star ===== */
.calendar-grid button {
  position: relative;
}

.calendar-grid button.has-data::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.calendar-grid button.stars-1::before,
.calendar-grid button.stars-2::before,
.calendar-grid button.stars-3::before {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  color: var(--amber);
  line-height: 1;
  pointer-events: none;
  letter-spacing: 0;
}

.calendar-grid button.stars-1::before { content: "★"; }
.calendar-grid button.stars-2::before { content: "★★"; }
.calendar-grid button.stars-3::before { content: "★★★"; }

.calendar-grid button.is-today.stars-1::before,
.calendar-grid button.is-today.stars-2::before,
.calendar-grid button.is-today.stars-3::before {
  color: #fff;
}

/* Bigger calendar day labels */
.calendar-grid .calendar-week {
  font-size: 11px;
  min-height: 26px;
}

/* ===== Modal (export / import) ===== */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 72%, rgba(0, 0, 0, 0.5));
  backdrop-filter: blur(4px);
}

.app-modal .modal-card {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.app-modal .modal-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 780;
}

.app-modal .modal-card .modal-desc {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.app-modal .modal-field {
  margin-bottom: 16px;
}

.app-modal .modal-field label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: all var(--transition);
}

.app-modal .modal-field label:hover {
  border-color: var(--accent);
  background: var(--surface-tint);
}

.app-modal .modal-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: var(--accent);
}

.app-modal .modal-field input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: var(--accent);
}

.app-modal .modal-field .radio-group {
  display: flex;
  gap: 12px;
}

.app-modal .modal-field .radio-group label {
  flex: 1;
  justify-content: center;
}

.app-modal .modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.app-modal .primary-button,
.app-modal .secondary-button {
  width: 100%;
  justify-content: center;
}

.app-modal .import-textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-family: monospace;
  line-height: 1.5;
  resize: vertical;
}

.app-modal .import-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.app-modal .file-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  color: var(--muted);
}

.app-modal .file-upload:hover {
  border-color: var(--accent);
  background: var(--surface-tint);
  color: var(--accent);
}

.app-modal .file-upload svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
