:root {
  color-scheme: light;
  --bg: #f7f3ee;
  --ink: #202124;
  --muted: #64615d;
  --panel: #fffaf3;
  --line: #ded6ca;
  --accent: #187767;
  --accent-dark: #0f554a;
  --warm: #c95f36;
  --soft: #edf4ef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(160deg, rgba(24, 119, 103, 0.16), transparent 36%),
    linear-gradient(20deg, rgba(201, 95, 54, 0.14), transparent 42%),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
}

.calculator {
  width: min(100%, 460px);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px 18px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(24, 119, 103, 0.28);
  border-radius: 8px;
  background: linear-gradient(145deg, #fffefa, #dfeee7);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 26px rgba(31, 66, 57, 0.12);
}

.brand-mark span {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 7px solid var(--accent);
  border-right-color: var(--warm);
  display: block;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

.form-panel,
.result-panel {
  border: 1px solid rgba(113, 102, 88, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.92);
  box-shadow: 0 18px 48px rgba(84, 71, 55, 0.12);
}

.form-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 119, 103, 0.12);
}

.unit-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unit-input input {
  flex: 1;
}

.unit-input b {
  min-width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--accent-dark);
}

.primary-action,
.ghost-action {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.primary-action {
  min-height: 52px;
  margin-top: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(24, 119, 103, 0.22);
}

.primary-action:active,
.ghost-action:active {
  transform: translateY(1px);
}

.error-message {
  margin: 0;
  color: #a33d24;
  font-size: 13px;
  font-weight: 700;
}

.result-panel {
  margin-top: 14px;
  padding: 14px;
}

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

.result-head p {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
}

.ghost-action {
  min-width: 64px;
  height: 36px;
  color: var(--accent-dark);
  background: #e7f1eb;
  font-weight: 750;
}

.schedule-card {
  border-radius: 8px;
  background: #24312e;
  color: #fff;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 760;
  margin-bottom: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-card {
  min-height: 92px;
  border: 1px solid rgba(222, 214, 202, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  align-content: space-between;
}

.result-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-card strong {
  color: var(--warm);
  font-size: 25px;
  letter-spacing: 0;
}

.detail-list {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-list div {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-list span {
  color: var(--muted);
}

.detail-list b {
  color: var(--ink);
}

.notice {
  margin: 12px 0 0;
  color: #766c61;
  font-size: 12px;
  line-height: 1.6;
}

@media (min-width: 720px) {
  .app-shell {
    align-items: center;
    padding-block: 40px;
  }
}
