:root {
  color-scheme: light;
  --line: #06c755;
  --line-dark: #00a645;
  --bg: #f5f7f6;
  --panel: #ffffff;
  --text: #17201b;
  --muted: #66746c;
  --border: #dde5e0;
  --danger: #c93f2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

.app-header {
  min-height: 70px;
  padding: 14px 14px 10px;
  background: var(--line);
  color: #fff;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.header-kicker {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: .08em;
  opacity: .82;
}

h1,
h2,
p {
  margin: 0;
}

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

h2 {
  font-size: 22px;
  line-height: 1.35;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

.progress-area {
  padding: 10px 16px 8px;
  background: #e9f8ef;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #bce9ce;
}

.progress-fill {
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: var(--line);
  transition: width .2s ease;
}

.progress-area p {
  margin-top: 5px;
  color: var(--line-dark);
  font-size: 11px;
  text-align: right;
}

.screen {
  display: none;
  flex: 1;
  min-height: 0;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.screen-body {
  flex: 1;
  min-height: 0;
  padding: 24px 18px 16px;
  overflow: auto;
}

.screen-body.compact {
  padding-top: 20px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--line-dark);
  font-size: 12px;
  font-weight: 700;
}

.lead {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.field-group {
  margin-top: 24px;
}

.field-group label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.year-picker {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
}

.year-picker button {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--line-dark);
  font-size: 22px;
  font-weight: 800;
}

.year-picker button:disabled {
  color: #b8c2bc;
}

.year-picker strong {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

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

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

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

.segmented button,
.quick-values button {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.segmented button.selected {
  border-color: var(--line);
  background: #e9f8ef;
  color: var(--line-dark);
  font-weight: 700;
}

.grade-preview {
  margin-top: 18px;
  border: 1px solid #bce9ce;
  border-radius: 8px;
  background: #e9f8ef;
  color: var(--line-dark);
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
}

.number-card {
  margin-top: 26px;
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 66px 1fr 66px;
}

.number-button {
  min-height: 82px;
  border: 0;
  background: #e9f8ef;
  color: var(--line-dark);
  font-size: 32px;
  font-weight: 700;
}

#valueInput {
  width: 100%;
  min-width: 0;
  border: 0;
  text-align: center;
  font-size: 40px;
  font-weight: 800;
  outline: 0;
}

.unit-text {
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.range-text {
  margin-top: 4px;
  color: #8b9991;
  text-align: center;
  font-size: 12px;
}

.quick-values {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.confirm-list {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.confirm-row {
  min-height: 50px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
}

.confirm-name {
  color: var(--muted);
  font-size: 14px;
}

.confirm-value {
  font-size: 17px;
  font-weight: 800;
}

.edit-button {
  border: 1px solid #bce9ce;
  border-radius: 999px;
  background: #e9f8ef;
  color: var(--line-dark);
  font-size: 12px;
  padding: 4px 10px;
}

.screen-footer {
  padding: 12px 16px 18px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  border-radius: 10px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--line);
  color: #fff;
}

.primary-button:disabled {
  background: #b8c2bc;
}

.secondary-button {
  margin-top: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
}

.done-body {
  flex: 1;
  padding: 40px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.done-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--line);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 800;
}

.done-body p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.mock-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f5f3;
  font-size: 13px;
}

.error-text {
  min-height: 22px;
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}
