:root {
  color: #17281f;
  background: #f6f7f2;
  font-family: system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body { margin: 0; }
#root[data-keyboard-open] { height: var(--ledger-visible-height); }
#root[data-keyboard-open] :has(> [role=tablist]) { display: none; }
#recovery {
  position: fixed;
  z-index: 999;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  left: calc(1rem + env(safe-area-inset-left));
  background: white;
  padding: 12px;
}
#recovery a { display: inline-flex; align-items: center; min-height: 44px; }

.ledger-gate-scroll {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: calc(16px + env(safe-area-inset-top)) env(safe-area-inset-right)
    calc(20px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}
.ledger-gate {
  box-sizing: border-box;
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 0 20px;
}
.ledger-gate h1 { margin: 0 0 16px; font-size: 32px; line-height: 1.25; }
.ledger-gate-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dbe3d9;
  border-radius: 20px;
  background: #fff;
}
.ledger-gate-card p, .ledger-release p { margin: 0; line-height: 1.5; }
.ledger-gate-card label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.ledger-gate-card input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid #a9b8ac;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}
.ledger-gate button, .ledger-backup button, .ledger-download {
  min-height: 44px;
  border: 1px solid #dbe3d9;
  border-radius: 14px;
  background: #f0f3ec;
  color: #255640;
  padding: 8px 12px;
  font: 600 15px/1.4 system-ui, sans-serif;
  cursor: pointer;
}
.ledger-gate button.ledger-primary, .ledger-backup button.ledger-primary { min-height: 49px; border-color: #255640; background: #255640; color: #fff; }
.ledger-gate button:disabled, .ledger-backup button:disabled { opacity: .52; cursor: default; }
.ledger-gate button:enabled:active, .ledger-backup button:enabled:active, .ledger-download:active { opacity: .76; }
.ledger-gate :focus-visible, .ledger-backup :focus-visible { outline: 2px solid #255640; outline-offset: 2px; }
.ledger-gate [role=alert] { color: #9c3b2f; }
.ledger-gate-note, .ledger-release { font-size: 14px; line-height: 1.5; color: #4e6559; }
.ledger-gate-note { margin: 14px 0 18px; }
.ledger-release { display: grid; gap: 8px; border-top: 1px solid #dbe3d9; padding-top: 12px; }
.ledger-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ledger-backup h2 { margin: 0; font-size: 18px; }
.ledger-download { box-sizing: border-box; display: inline-flex; align-items: center; text-decoration: none; }

.plan-form { display: grid; gap: 12px; }
.plan-form p { margin: 0; }
.plan-form fieldset { min-width: 0; border: 1px solid #d5ded5; border-radius: 10px; display: grid; gap: 10px; }
.plan-form label { display: grid; gap: 5px; font-size: 14px; }
.plan-form label:has(input[type=checkbox]) { display: flex; align-items: center; min-height: 44px; }
.plan-form input:not([type=checkbox]), .plan-form select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px;
  font: inherit;
  font-size: 16px;
  background: white;
  color: #194438;
  border: 1px solid #a9b8ac;
  border-radius: 8px;
}
.plan-form button, .plan-calendar button, .plan-calendar-controls button {
  font: inherit;
  min-height: 44px;
  border: 1px solid #cbd6cb;
  border-radius: 8px;
  background: #edf5ec;
  color: #194438;
  padding: 6px;
}
.plan-form button:enabled:active, .plan-calendar button:enabled:active, .plan-calendar-controls button:enabled:active { opacity: .76; }
.plan-calendar-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.plan-calendar button { min-width: 0; padding-inline: 0; }
.plan-calendar button[aria-pressed=true] { background: #194438; color: white; }
