:root {
  color-scheme: light;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --ink: #172026;
  --muted: #65727d;
  --line: #dce4e9;
  --accent: #116a70;
  --accent-strong: #0b4d53;
  --accent-soft: #d8f2ef;
  --warning: #8a5a00;
  --warning-bg: #fff4cf;
  --danger: #9b1c1c;
  --danger-bg: #ffe2e2;
  --ok: #256d3d;
  --ok-bg: #def5e4;
  --shadow: 0 18px 44px rgba(26, 38, 49, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(17, 106, 112, 0.12), transparent 36%),
    var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 18px 14px 34px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 13ch;
  font-size: clamp(1.9rem, 8vw, 3.2rem);
}

h2 {
  font-size: 1.15rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.step-panel {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.step-panel.is-muted {
  background: rgba(255, 255, 255, 0.8);
}

.step-panel.is-disabled {
  opacity: 0.58;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

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

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 106, 112, 0.16);
}

.primary-action {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.primary-action:disabled {
  background: #aebbc2;
  cursor: not-allowed;
}

.icon-action {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
}

.message,
.summary-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.message.is-error {
  color: var(--danger);
}

.message.is-ok {
  color: var(--ok);
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.slot-card {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 12px;
  text-align: left;
}

.slot-card strong {
  font-size: 1.35rem;
}

.slot-card span,
.slot-card small {
  color: var(--muted);
  line-height: 1.25;
}

.slot-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(17, 106, 112, 0.14);
}

.slot-card.is-special {
  border-color: #dfbd6a;
  background: var(--warning-bg);
}

.chosen-slot {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.agenda-list {
  display: grid;
  gap: 8px;
}

.agenda-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.agenda-item-operator {
  align-items: start;
}

.agenda-time {
  color: var(--accent-strong);
  font-weight: 800;
}

.agenda-main {
  display: grid;
  gap: 3px;
}

.agenda-main strong {
  line-height: 1.2;
}

.agenda-main span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.operation-steps {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.operation-step {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  text-align: left;
}

button.operation-step {
  cursor: pointer;
}

.operation-step span {
  color: var(--muted);
}

.operation-step strong {
  color: var(--accent-strong);
}

.operation-step.is-done {
  border-color: #b9dfc3;
  background: var(--ok-bg);
}

.operation-step:disabled {
  background: #f1f4f6;
  color: #8b98a1;
  cursor: not-allowed;
}

.operation-step:disabled strong {
  color: #8b98a1;
}

.empty-state {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 34px;
  }

  h1 {
    max-width: none;
  }

  .form-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
  }

  .form-grid .primary-action,
  .chosen-slot {
    grid-column: 1 / -1;
  }

  .form-grid-compact {
    grid-template-columns: 1fr auto;
  }

  .form-grid-compact .primary-action {
    grid-column: auto;
    min-width: 180px;
  }

  .slots-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .operation-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
