:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #fbf9f4;
  --border: #e4dfd4;
  --text: #1f2328;
  --muted: #5b6169;
  --accent: #2f6b4f;
  --accent-2: #e9f3ee;
  --amber: #c27a1a;
  --amber-2: #fff4e2;
  --red: #b33a2f;
  --red-2: #fde7e5;
  --green: #2f6b4f;
  --green-2: #e9f3ee;
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.04), 0 8px 24px rgba(31, 35, 40, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-text h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.01em;
}
.tagline {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--accent); }
.site-nav .ext-link {
  color: var(--accent);
  font-weight: 500;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-top: 32px;
  margin-bottom: 24px;
}
.hero-copy h2 {
  font-size: 34px;
  line-height: 1.15;
  margin: 6px 0 12px;
  letter-spacing: -0.02em;
}
.hero-copy p {
  color: var(--muted);
  margin: 0 0 18px;
}
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.hero-stats > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.hero-stats strong {
  display: block;
  font-size: 22px;
  color: var(--accent);
}
.hero-stats span {
  font-size: 12px;
  color: var(--muted);
}
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.hero-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.example-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.example-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }
.dot-green { background: var(--green); }
.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.panel-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.panel-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: var(--surface-2); border-color: #cdc6b8; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn.primary:hover { background: #265940; border-color: #265940; }
.btn.ghost { background: transparent; }
.btn.danger {
  color: var(--red);
  border-color: #e6c0bc;
  background: #fff;
}
.btn.danger:hover { background: var(--red-2); border-color: #c9817a; }

.add-form {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.8fr 1fr 1fr 1.3fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.field input, .field select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: 1 / -1;
  align-items: flex-start;
}
.presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.sub-table th, .sub-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sub-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.sub-table tbody tr:hover { background: var(--surface-2); }
.sub-table .row-amber { background: var(--amber-2); }
.sub-table .row-red { background: var(--red-2); }
.sub-table .row-cancelled { opacity: 0.55; text-decoration: line-through; }
.col-actions { text-align: right; white-space: nowrap; }
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.status-active { background: var(--green-2); color: var(--green); }
.status-soon { background: var(--amber-2); color: var(--amber); }
.status-trial { background: var(--red-2); color: var(--red); }
.status-cancelled { background: #eee; color: var(--muted); }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-head {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 6px;
  font-weight: 600;
}
.cal-cell {
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: var(--surface-2);
  font-size: 12px;
  position: relative;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-date {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text);
}
.cal-event {
  display: block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.amber { background: var(--amber-2); color: var(--amber); }
.cal-event.red { background: var(--red-2); color: var(--red); }
.cal-event.green { background: var(--green-2); color: var(--green); }
.cal-month-label {
  font-weight: 600;
  min-width: 140px;
  text-align: center;
}
.cal-legend {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.cal-legend li { display: flex; align-items: center; gap: 8px; }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.guide-grid article {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.guide-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.guide-grid p, .guide-grid li {
  font-size: 14px;
  color: var(--muted);
}
.guide-grid ul { padding-left: 18px; margin: 0; }

.tips {
  background: var(--accent-2);
  border-color: #cfe4d8;
}
.tips h2 { margin-top: 0; color: var(--accent); }
.tips ul { padding-left: 18px; margin: 0; }
.tips li { margin-bottom: 6px; color: #244a36; }

.site-footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 16px;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  font-size: 12px;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .add-form { grid-template-columns: 1fr 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-meta { text-align: center; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .add-form { grid-template-columns: 1fr; }
  .hero-copy h2 { font-size: 26px; }
  .panel-head { flex-direction: column; }
  .cal-cell { min-height: 64px; }
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .panel-actions, .add-form, .cal-legend, .tips, .hero-card { display: none; }
  .panel { box-shadow: none; border: none; padding: 0; }
  .sub-table .row-cancelled { display: none; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
