:root {
  --bg: #f3f1ec;
  --paper: #fffcf7;
  --ink: #1c1f24;
  --muted: #6b6f76;
  --line: #dcd8cf;
  --blue: #24468f;
  --gold: #b98d4a;
  --danger: #9b2c2c;
  --ok: #2f6b3a;
  --radius: 10px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); }
a:hover { color: #1a3570; }

code {
  font-family: ui-monospace, "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 0.9em;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 970px;
  margin: 0 auto;
  padding: 0.9rem 3vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo {
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}
.site-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.92rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }

.site-main {
  flex: 1;
  max-width: 970px;
  width: 100%;
  margin: 0 auto;
  padding: 1.8rem 3vw 2.5rem;
}
body.is-public .site-main {
  padding-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.1rem 3vw;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

body.is-public .fl-affiliate {
  margin-top: 0.5rem;
}

.page-head { margin-bottom: 1.4rem; }
.page-head h1 {
  margin: 0 0 0.25rem;
  font-size: 1.7rem;
  font-weight: 650;
}
.page-head .count,
.page-head .lede {
  color: var(--muted);
  margin: 0;
}
.lede { max-width: 42rem; }

.crumb {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
}
.crumb a { text-decoration: none; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.35rem;
  margin-bottom: 1.2rem;
}
.card h2, .card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
}
.card > p:first-of-type { margin-top: 0; }

.ticket-close-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ticket-close-card h2 { margin-bottom: 0.2rem; }
.ticket-close-card p { margin: 0; }

.muted { color: var(--muted); }
.rotator-empty { padding: 1.5rem 3vw 2.2rem; text-align: center; }

.flash {
  max-width: 970px;
  margin: 0.9rem auto 0;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  width: calc(100% - 6vw);
}
.flash-success {
  background: #e7f3ea;
  color: var(--ok);
}
.flash-error {
  background: #f8e8e8;
  color: var(--danger);
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.2rem;
  align-items: start;
}
.grid-form .span2 { grid-column: 1 / -1; }
.grid-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.92rem;
  font-weight: 550;
}
.grid-form label.checkbox,
.grid-form label.radio {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
  gap: 0.5rem;
}
.grid-form input[type="text"],
.grid-form input[type="url"],
.grid-form input[type="number"],
.grid-form input[type="password"],
.grid-form input[type="file"],
.grid-form select,
.grid-form textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.grid-form input[type="checkbox"],
.grid-form input[type="radio"] {
  width: auto;
  margin: 0;
}
.grid-form button,
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.grid-form button:hover,
.btn:hover { background: #1a3570; color: #fff; }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #e2bdbd;
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
}
.btn-danger:hover { background: #f8e8e8; }

.auth-card { max-width: 28rem; }

.admin-tips-list { display: grid; gap: 1.2rem; }
.admin-tip-item {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
.admin-tip-item:first-child {
  border-top: 0;
  padding-top: 0;
}
.admin-tip-preview-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.admin-tip-actions { margin-top: 0.4rem; }
.admin-tip-delete { margin-top: 0.7rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .span2 { grid-column: auto; }
  .ticket-close-card { flex-direction: column; align-items: flex-start; }
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 1.1rem 0 0;
}
.btn-secondary {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}
.btn-secondary:hover { background: #e8eef8; color: var(--blue); }
.otp-input {
  letter-spacing: 0.35em;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.btn-link {
  background: none;
  border: 0;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}
.muted-form { margin-top: 0.85rem; }
body.is-embed {
  min-height: 0;
  display: block;
  background: transparent;
}
body.is-embed .fl-affiliate {
  border: 0;
  padding: 0.6rem;
  background: transparent;
}
