:root {
  --ink: #1A2B22;
  --muted: #5C6E62;
  --paper: #FFFEFB;
  --cream: #F3F6F0;
  --line: #D3E0D4;
  --brand: #1E6B45;
  --deep: #123D28;
  --end: #B4332A;
  --gold: #E4C56A;
  color-scheme: light;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--deep);
  color: var(--ink);
}

body {
  min-height: 100dvh;
}

button, input, select { font: inherit; }

.app {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.panel[hidden] { display: none; }

.panel {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}

.signin, .phone {
  background: #EFEEE9;
}

.signin {
  justify-content: flex-start;
  overflow: auto;
}

.line-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  font-weight: 650;
  font-size: 16px;
}

.line .badge {
  width: 52px;
  height: 36px;
  border-radius: 8px;
}

.line.on {
  border-color: var(--brand);
  background: #E7F2EA;
}

.logo {
  width: 112px;
  height: auto;
  align-self: center;
  margin: 0 auto 4px;
}

.logo-sm {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: none;
}

h1 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 650;
}

.lead, .note {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.note a { color: var(--brand); }

.secret {
  position: relative;
  display: block;
}

.secret input { width: 100%; padding-right: 48px; }

#peek {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

#peek svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#peek .eye-shut { display: none; }
#peek.on .eye-open { display: none; }
#peek.on .eye-shut { display: block; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

input, select {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

.check {
  flex-direction: row;
  align-items: center;
  font-weight: 500;
  color: var(--ink);
}

.check input { width: 18px; height: 18px; }

button.primary, button.ghost, button.text, button.chip, button.round {
  border: 0;
  cursor: pointer;
}

button.primary {
  margin-top: 16px;
  height: 52px;
  border-radius: 14px;
  background: var(--brand);
  color: white;
  font-size: 17px;
  font-weight: 650;
}

button.primary:disabled { opacity: 0.55; }

.error {
  color: var(--end);
  font-size: 15px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.top h1 {
  flex: 1;
  margin: 0;
  font-size: 20px;
}

button.text {
  background: transparent;
  color: var(--brand);
  font-weight: 650;
  padding: 8px 0;
  white-space: nowrap;
  flex: none;
}

.status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tools { margin-top: 12px; }

.chips { display: flex; gap: 8px; margin-top: 10px; }

.chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
}

.chip.on { background: var(--brand); color: white; }

.list {
  margin-top: 12px;
  overflow: auto;
  flex: 1;
}

.row {
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.badge {
  width: 52px;
  height: 40px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--deep);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.name { font-weight: 650; }

.place, .when { color: var(--muted); font-size: 13px; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.dot.on { background: var(--brand); }
.dot.busy { background: var(--gold); }

.pad { margin-top: 8px; }

.digits {
  min-height: 42px;
  margin: 0;
  text-align: center;
  font-size: 32px;
  letter-spacing: 0.08em;
}

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

.key {
  height: 58px;
  border: 0;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  font-size: 22px;
  font-weight: 650;
}

.pad-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }

button.ghost {
  margin-top: 16px;
  height: 52px;
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 650;
}

.call {
  background: var(--deep);
  color: white;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.call-state, .call-number, .call-time { color: #D7E8D8; }

.call h2 { margin: 8px 0 0; font-size: 36px; font-weight: 650; }

.call-time { min-height: 24px; font-variant-numeric: tabular-nums; }

.call-actions { display: flex; gap: 28px; margin-top: 36px; }

.round {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #24553A;
  color: white;
  font-weight: 650;
}

.round.end { background: var(--end); }
.round.go { background: var(--brand); }
.round.on { outline: 3px solid var(--gold); }

@media (min-width: 900px) {
  body { display: grid; place-items: center; }
  .app {
    min-height: 760px;
    height: 760px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  }
  .panel { min-height: 760px; }
}
