:root {
  color-scheme: light;
  --bg: #f3f0e8;
  --panel: #fffdf8;
  --ink: #17211f;
  --muted: #68726f;
  --line: #d9d2c4;
  --brand: #184e4a;
  --brand-2: #cf5f38;
  --focus: #0d8b7e;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  min-height: 44px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 25px;
}

h2 {
  font-size: 21px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 24px;
}

.step-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(44, 38, 27, 0.08);
}

.hidden {
  display: none;
}

.template-list,
.result-actions {
  display: grid;
  gap: 12px;
}

.template-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.template-title {
  display: block;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 7px;
}

.template-meta,
.hint,
.result-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.form-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.field-grid {
  display: grid;
  gap: 12px;
}

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

label,
legend {
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

.time-selects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 12px;
}

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

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

.choice-card {
  position: relative;
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card span {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 11px;
  font-weight: 700;
}

.choice-card small {
  color: var(--muted);
  font-weight: 400;
}

.choice-card input:checked + span {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.person-grid {
  display: grid;
  gap: 9px;
}

.day-row {
  display: grid;
  grid-template-columns: 86px 1fr 1fr;
  gap: 7px;
  align-items: end;
}

.day-name {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.primary-button {
  background: var(--brand);
  color: #fff;
  margin-top: 16px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.copy-hours-button {
  margin: -2px 0 6px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 65%);
  outline-offset: 2px;
}

.preview-canvas {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  background: #fff;
  display: block;
}

@media (min-width: 700px) {
  body {
    min-height: 100vh;
    display: grid;
    place-items: start center;
    padding: 28px 0;
    background:
      linear-gradient(90deg, rgba(24, 78, 74, 0.08) 1px, transparent 1px),
      linear-gradient(0deg, rgba(24, 78, 74, 0.08) 1px, transparent 1px),
      var(--bg);
    background-size: 28px 28px;
  }

  .app-shell {
    width: 390px;
    min-height: 844px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    border: 10px solid #161a19;
    border-radius: 34px;
    background: var(--bg);
    box-shadow: 0 24px 70px rgba(23, 33, 31, 0.26);
    scrollbar-width: thin;
  }
}
