:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e2ec;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --warn: #b45309;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: #e6f0ef;
  color: #0b4f49;
}

button.danger {
  background: #fee4e2;
  color: var(--danger);
}

button:disabled {
  cursor: wait;
  opacity: .6;
}

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

textarea {
  resize: vertical;
}

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

.login-panel {
  width: min(420px, 100%);
  margin: 12vh auto 0;
}

.login-panel h1,
.topbar h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.notice,
.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.login-form {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.login-form label,
.toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.topbar,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
  padding: 12px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.schedule-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.day-band {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.day-band h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

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

.event-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
}

.event-time {
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.event-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.event-target,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 12px 0;
}

.admin-panel {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 2px solid var(--line);
}

.section-header h2 {
  margin: 0;
  font-size: 22px;
}

.manual-send,
.nudge-form {
  display: grid;
  grid-template-columns: 110px 110px auto auto;
  gap: 8px;
  align-items: start;
}

.nudge-form {
  grid-template-columns: 110px 110px minmax(180px, 1fr) auto;
  margin-bottom: 14px;
}

.nudge-list {
  display: grid;
  gap: 10px;
}

.nudge-row {
  display: grid;
  grid-template-columns: 110px 110px minmax(180px, 1fr) 82px 82px;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.chat-status {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

dialog {
  width: min(620px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

dialog::backdrop {
  background: rgba(15, 23, 42, .38);
}

dialog article {
  padding: 18px;
}

dialog header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

dialog h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #eef2f6;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 14px;
  margin: 18px 0 0;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: calc(100% - 28px);
  border-radius: 7px;
  background: #17202a;
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .manual-send,
  .nudge-form,
  .nudge-row {
    grid-template-columns: 1fr;
  }

  .event-item {
    grid-template-columns: 1fr;
  }
}

