:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --line: #e2e0da;
  --accent: #2b2f3a;
  --danger: #a3262a;
  --success: #1f6b3a;
  --warning: #8a5a00;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

header.site .brand {
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

header.site nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

header.site nav a {
  color: var(--accent);
  text-decoration: none;
}

header.site nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  font-family: system-ui, sans-serif;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 1.9rem;
  margin: 0 0 1.25rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1rem;
  margin: 0.5rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 0 0 1rem;
}

.card.alert {
  border-color: var(--warning);
}

.muted {
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0.75rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 400;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  vertical-align: middle;
}

.badge-alert,
.badge-eta {
  color: var(--warning);
  border-color: var(--warning);
}

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  margin: 0 0 1rem;
}

.flash-success {
  border-color: var(--success);
  color: var(--success);
}

.flash-error {
  border-color: var(--danger);
  color: var(--danger);
}

form.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

form.narrow {
  max-width: 380px;
}

form.inline {
  display: inline;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

label.check {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}

button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--accent);
}

button.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

button.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
}

button.link.danger {
  color: var(--danger);
}

.row-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
}

.row-form input[type="text"] {
  flex: 1 1 200px;
}

.rule {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem;
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rule-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

ul.plain,
ul.rules {
  padding-left: 1.1rem;
  margin: 0.5rem 0;
}

ul.agenda {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.agenda-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 4px solid transparent;
  border-bottom: 1px solid var(--line);
}

.agenda-item:last-child {
  border-bottom: none;
}

.agenda-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.agenda-time {
  min-width: 3.2rem;
}

.agenda-item.is-past {
  color: var(--muted);
}

.agenda-item.is-soon {
  border-left-color: var(--warning);
  background: #fff8e6;
}

.agenda-item.is-soon .agenda-label {
  font-weight: 600;
}

.agenda-item.is-now {
  border-left-color: var(--danger);
  background: #fdeeee;
}

.agenda-item.is-now .agenda-label {
  font-weight: 700;
}

.agenda-item.is-now .badge-eta {
  color: var(--danger);
  border-color: var(--danger);
}

.agenda-item.is-done {
  opacity: 0.55;
}

.agenda-item.is-done .agenda-label {
  text-decoration: line-through;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.report {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}

details > summary {
  cursor: pointer;
  color: var(--accent);
  margin: 0.25rem 0 0.5rem;
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 18px 55px rgba(25, 28, 35, 0.06);
}

.auth-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--line);
  margin: -0.25rem 0 1.2rem;
}

.auth-tab {
  flex: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.75rem;
}

.auth-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.auth-message {
  margin-bottom: 1rem;
}

.auth-message:empty {
  display: none;
}

body.locked-home {
  min-height: 100vh;
  background: #f4f4f2;
}

.locked-main {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 8vw, 8rem);
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.welcome-side {
  max-width: 34rem;
  padding: 1rem 0;
}

.welcome-side .welcome-title {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  letter-spacing: -0.045em;
}

.welcome-side .welcome-copy {
  max-width: 30rem;
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.locked-panel {
  width: 100%;
  padding: 1.6rem;
  border-radius: 10px;
}

.locked-panel .stack {
  margin: 0;
}

.locked-panel .stack button {
  margin-top: 0.35rem;
  min-height: 44px;
}

.locked-panel label {
  gap: 0.4rem;
}

.locked-panel input {
  min-height: 42px;
}

.nav-logout {
  display: inline;
  margin: 0;
}

header.site nav .nav-logout button.link {
  font: inherit;
  color: var(--accent);
  text-decoration: none;
}

header.site nav .nav-logout button.link:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .locked-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    align-content: center;
    max-width: 480px;
  }

  .welcome-side {
    padding: 0;
  }

  .welcome-side .welcome-title {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .welcome-side .welcome-copy {
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 560px) {
  header.site {
    padding: 0.75rem 1rem;
  }

  .agenda-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

input,
select,
textarea {
  font-size: 16px;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font: 600 0.72rem/1.4 system-ui, sans-serif;
  letter-spacing: 0.22em;
}

.welcome-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 7vw, 2.35rem);
  line-height: 1.15;
}

.welcome-copy {
  max-width: 28rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}
