:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #edf7f5;
  --text: #172020;
  --muted: #667376;
  --border: #dfe7e8;
  --teal: #0f766e;
  --teal-strong: #0b5f59;
  --brand-green: #102524;
  --green: #15803d;
  --red: #c24150;
  --amber: #b7791f;
  --ink: #263238;
  --shadow: 0 16px 42px rgba(30, 45, 45, 0.08);
  --radius: 8px;
  --font: "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 10px 12px;
  background: #102524;
  color: #fff;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.primary-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: right;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.budget-subnav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 6px;
}

.budget-subitem {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.budget-subitem.active,
.budget-subitem:hover {
  background: #fff;
  color: var(--teal-strong);
  border-color: transparent;
}

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

.budget-page {
  display: none;
}

.budget-page.active {
  display: block;
  padding: 10px;
  border-radius: 18px;
  background: var(--brand-green);
}

.main {
  width: min(1440px, 100%);
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  background: var(--brand-green);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.topbar > div:first-child {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2vw, 2.25rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: 1.12rem;
  line-height: 1.35;
}

.month-control,
.filters,
.export-actions,
.top-actions,
.command-row,
.backup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.month-control {
  flex-wrap: nowrap;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.month-control input {
  min-width: 0;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

#currentPeriodTitle {
  color: #fff;
  font-size: clamp(1.08rem, 1.4vw, 1.58rem);
  white-space: nowrap;
}

.top-actions .primary-btn,
.top-actions .secondary-btn {
  border-color: rgba(255, 255, 255, 0.34);
  background: #fff;
  color: var(--brand-green);
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  line-height: 1;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: #edf2f2;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
}

.icon-btn:hover {
  background: #dce8e8;
}

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

input,
select {
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card .label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.kpi-card .value {
  color: var(--text);
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.kpi-card .hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.kpi-income .value {
  color: var(--green);
}

.kpi-expense .value {
  color: var(--red);
}

.chart-box {
  min-height: 320px;
  overflow: hidden;
}

.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.donut-chart {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 230px);
  gap: 18px;
  align-items: center;
  min-height: 260px;
}

.donut-svg {
  max-width: 230px;
  justify-self: center;
}

.legend-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.legend-list strong,
.legend-list small {
  display: block;
  overflow-wrap: anywhere;
}

.legend-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-row,
.category-row,
.rate-row,
.insight-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.compact-row strong,
.category-row strong {
  display: block;
  margin-bottom: 4px;
}

.compact-row small,
.category-row small,
.meta-line {
  color: var(--muted);
}

.amount-income {
  color: var(--green);
  font-weight: 900;
}

.amount-expense {
  color: var(--red);
  font-weight: 900;
}

.entry-panel {
  max-width: 1080px;
}

.budget-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

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

.compact-budget-entry {
  grid-template-columns: 1fr;
}

.compact-entry-form {
  align-content: start;
  grid-template-columns: minmax(142px, 0.72fr) minmax(0, 1fr);
  gap: 10px;
}

.input-card {
  display: grid;
  gap: 8px;
  min-height: 46px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f9fbfb;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.input-card input,
.input-card select {
  min-height: 34px;
  border-color: transparent;
  background: #fff;
  font-weight: 800;
}

.amount-card input {
  font-size: 1.16rem;
  font-weight: 900;
}

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

.amount-card span {
  flex: 0 0 auto;
}

.amount-card input {
  flex: 1 1 auto;
  min-width: 0;
}

.category-card select {
  color: var(--teal-strong);
}

.note-card {
  grid-column: span 2;
}

.hidden-fields {
  display: none;
}

.khatma-page,
.project-page {
  display: grid;
  gap: 14px;
  padding: 10px;
  border-radius: 18px;
  background: var(--brand-green);
}

.project-kpi-grid {
  margin-bottom: 0;
}

.project-entry-panel .compact-entry-form {
  margin: 0;
}

.project-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}

.project-add-form.is-hidden {
  display: none;
}

.project-add-form .input-card {
  min-height: 46px;
}

.project-add-form .primary-btn,
.project-add-form .secondary-btn {
  align-self: stretch;
  min-height: 46px;
}

.project-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: min(100%, 420px);
}

.project-select {
  min-height: 38px;
  max-width: 280px;
  border-color: rgba(16, 37, 36, 0.16);
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.project-icon-btn {
  flex: 0 0 38px;
  border: 1px solid rgba(16, 37, 36, 0.14);
  background: #fff;
  color: var(--brand-green);
}

.project-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.project-icon-btn.danger {
  border-color: #f0c7ce;
  background: #fff6f7;
  color: var(--red);
}

.khatma-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.khatma-metric {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fbfb;
}

.khatma-metric span,
.khatma-entry time {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.khatma-metric strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.khatma-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.khatma-note-card {
  min-height: 58px;
}

.khatma-timeline {
  display: grid;
  gap: 8px;
}

.khatma-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.khatma-entry:last-child {
  border-bottom: 0;
}

.khatma-entry strong {
  color: var(--text);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.khatma-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.mode-tabs,
.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f3f6f6;
}

.mode-tab,
.segmented span {
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.mode-tab.active,
.segmented input:checked + span {
  background: #fff;
  color: var(--teal-strong);
  box-shadow: 0 1px 8px rgba(12, 36, 34, 0.09);
}

.mode-panel {
  display: none;
}

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

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

.entry-form label,
.category-form label,
.command-box label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.segmented {
  grid-column: span 2;
  width: max-content;
  margin: 0;
  border: 1px solid var(--border);
}

.compact-entry-form .type-card {
  grid-column: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 5px;
}

.compact-entry-form .amount-card {
  grid-column: auto;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  width: 1px;
  min-height: 0;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.span-2 {
  grid-column: span 2;
}

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

.conversion-preview {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.file-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 7px;
  font-weight: 900;
  white-space: nowrap;
}

.primary-btn {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-btn:hover {
  background: var(--teal-strong);
}

.secondary-btn,
.file-btn span {
  border: 1px solid rgba(15, 118, 110, 0.28);
  background: var(--surface-soft);
  color: var(--teal-strong);
}

.ghost-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
}

.command-box {
  display: grid;
  gap: 12px;
}

.preview-card {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f9fbfb;
  color: var(--muted);
}

.preview-card.ready {
  background: #f0faf7;
  color: var(--text);
  border-color: rgba(15, 118, 110, 0.25);
}

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

.chips button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

.voice-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.voice-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  border: 0;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.22);
}

.voice-btn svg {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.voice-btn.floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: 64px;
  height: 64px;
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.3);
  touch-action: none;
}

.voice-btn.dragging {
  cursor: grabbing;
}

.voice-btn.is-hidden {
  display: none;
}

.voice-btn.compact {
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
}

.voice-btn.compact .voice-ring {
  inset: 9px;
}

.voice-btn strong {
  position: relative;
  z-index: 1;
}

.voice-ring {
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

.voice-btn.listening .voice-ring {
  animation: pulse 1.1s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

.voice-content {
  display: grid;
  gap: 10px;
}

.voice-status {
  min-height: 24px;
  color: var(--muted);
  font-weight: 800;
}

.table-wrap {
  overflow-x: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.tx-date,
.tx-time {
  display: block;
  white-space: nowrap;
}

.tx-date {
  color: var(--text);
  font-weight: 900;
}

.tx-time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tx-main-amount,
.tx-original {
  display: block;
  white-space: nowrap;
}

.tx-original {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.pill.expense {
  background: #fff1f3;
  color: var(--red);
}

.pill.income {
  background: #edf9f0;
  color: var(--green);
}

.delete-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f0c7ce;
  border-radius: 7px;
  background: #fff6f7;
  color: var(--red);
  font-weight: 900;
}

#transactionsPanel,
#projectTransactionsPanel {
  padding: 14px;
}

#transactionsPanel .panel-head,
#projectTransactionsPanel .panel-head {
  margin-bottom: 10px;
}

#transactionsPanel table,
#projectTransactionsPanel table {
  font-size: 0.76rem;
}

#transactionsPanel th,
#transactionsPanel td,
#projectTransactionsPanel th,
#projectTransactionsPanel td {
  padding: 8px 5px;
}

#transactionsPanel th:nth-child(3),
#transactionsPanel td:nth-child(3),
#projectTransactionsPanel th:nth-child(3),
#projectTransactionsPanel td:nth-child(3) {
  padding-inline: 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#transactionsPanel .tx-col-date,
#projectTransactionsPanel .tx-col-date {
  width: 28%;
}

#transactionsPanel .tx-col-value,
#projectTransactionsPanel .tx-col-value {
  width: 27%;
}

#transactionsPanel .tx-col-note,
#projectTransactionsPanel .tx-col-note {
  width: auto;
}

#transactionsPanel .tx-col-action,
#projectTransactionsPanel .tx-col-action {
  width: 40px;
}

#transactionsPanel th:last-child,
#transactionsPanel td:last-child,
#projectTransactionsPanel th:last-child,
#projectTransactionsPanel td:last-child {
  padding-inline: 3px;
  text-align: center;
  overflow: visible;
}

#transactionsPanel .tx-date,
#transactionsPanel .tx-time,
#transactionsPanel .tx-main-amount,
#transactionsPanel .tx-original,
#projectTransactionsPanel .tx-date,
#projectTransactionsPanel .tx-time,
#projectTransactionsPanel .tx-main-amount,
#projectTransactionsPanel .tx-original {
  font-size: 0.72rem;
}

#transactionsPanel .delete-btn,
#projectTransactionsPanel .delete-btn {
  margin-inline: auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.category-form {
  grid-template-columns: 1fr;
}

.inline-category-form {
  margin-bottom: 14px;
}

.category-list,
.rates-list,
.insight-grid {
  display: grid;
  gap: 10px;
}

.category-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.category-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.category-main div {
  min-width: 0;
}

.category-main strong,
.category-main small {
  overflow-wrap: anywhere;
}

.rate-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 180px);
}

.report-chart {
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

.compact-chart {
  min-height: 240px;
}

.printable-only {
  display: none;
}

.insight-card {
  align-items: flex-start;
}

.schema-note {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f9fbfb;
}

.schema-note p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.file-btn input {
  display: none;
}

.notice {
  display: none;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius);
  background: #ecfdf7;
  color: var(--teal-strong);
  font-weight: 800;
}

.notice.show {
  display: block;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .sidebar {
    position: sticky;
    z-index: 5;
    top: 0;
    align-self: start;
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 10px 12px;
    overflow-x: hidden;
  }

  .nav-list {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
  }

  .nav-item {
    justify-content: center;
  }

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

@media (max-width: 780px) {
  .main {
    padding: 16px;
  }

  .panel-head,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
  }

  #currentPeriodTitle {
    font-size: 1.25rem;
  }

  .top-actions .primary-btn,
  .top-actions .secondary-btn {
    min-width: 52px;
    min-height: 30px;
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .month-control {
    align-self: stretch;
  }

  .grid-two,
  .entry-form,
  .quick-entry-form,
  .budget-entry-grid,
  .khatma-summary,
  .khatma-form,
  .voice-layout {
    grid-template-columns: 1fr;
  }

  .project-toolbar {
    width: 100%;
    min-width: 0;
  }

  .project-select {
    flex: 1 1 auto;
    max-width: none;
  }

  .project-add-form {
    grid-template-columns: 1fr;
  }

  .compact-entry-form {
    grid-template-columns: minmax(132px, 0.72fr) minmax(0, 1fr);
  }

  .span-2,
  .segmented {
    grid-column: auto;
  }

  .compact-entry-form .type-card,
  .compact-entry-form .amount-card {
    grid-column: auto;
  }

  .compact-entry-form .note-card,
  .compact-entry-form .form-actions {
    grid-column: span 2;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    min-height: 104px;
    padding: 12px;
  }

  .kpi-card .value {
    font-size: 1.25rem;
  }

  .donut-chart {
    grid-template-columns: 1fr;
  }

  .voice-btn {
    width: 132px;
    height: 132px;
  }

  .voice-btn.compact {
    width: 76px;
    height: 76px;
  }

  .voice-btn.floating {
    width: 58px;
    height: 58px;
    right: 16px;
    bottom: 16px;
  }

  .voice-btn svg {
    width: 26px;
    height: 26px;
  }

  .nav-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav-item {
    min-height: 48px;
    padding: 8px 6px;
    gap: 4px;
    flex-direction: column;
    font-size: 0.78rem;
  }

  .nav-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .notice,
  .voice-btn.floating,
  .quick-panel,
  .chart-panel,
  #transactionsPanel,
  #categoriesPanel,
  .settings-grid,
  .top-actions,
  .export-actions {
    display: none !important;
  }

  .app-shell,
  .main {
    display: block;
    padding: 0;
  }

  #budgetView,
  #printableReport {
    display: block !important;
  }

  .panel,
  .kpi-card,
  .report-chart,
  .insight-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
