/*
 * Minimal shared base styles for the Tinny Planner.
 * tinny-planner.css depends on the CSS variables and handful of base
 * component classes below (a trimmed subset of clantools/web_assets/
 * styles.css) rather than defining a full page shell itself.
 */

:root {
  color-scheme: dark;
  --bg: #101317;
  --panel: #171c22;
  --line: #2b333d;
  --text: #e8edf3;
  --muted: #9aa7b5;
  --accent: #6aa6ff;
  --focus-ring: #91c3ff;
  --input: #111820;
  --tooltip: #05070a;
  --good: #42c77b;
  --bad: #ff6b5f;
  --warn: #e3b341;
  --notice-bg: #122238;
  --notice-line: #284b78;
  --error-bg: #351a1a;
  --error-line: #7a3834;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --line: #d8dde5;
  --text: #17202a;
  --muted: #5d6878;
  --accent: #1f6feb;
  --focus-ring: #0b57b7;
  --input: #ffffff;
  --tooltip: #111827;
  --good: #0f7b45;
  --bad: #b42318;
  --warn: #8a5a00;
  --notice-bg: #eef4ff;
  --notice-line: #bfd3ff;
  --error-bg: #fff1ef;
  --error-line: #ffcdc7;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}

main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px max(24px, env(safe-area-inset-right)) 48px max(24px, env(safe-area-inset-left));
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

h2 {
  margin: 28px 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

input,
select,
textarea,
button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

input {
  min-width: 0;
  color: var(--text);
  background: var(--input);
}

textarea {
  min-width: 0;
  color: var(--text);
  background: var(--input);
  resize: vertical;
}

select {
  min-width: 0;
  color: var(--text);
  background: var(--input);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  padding: 8px 10px;
  text-decoration: none;
}

.button.secondary,
button.secondary {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.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;
}

.info-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
  cursor: help;
}

.notice {
  border: 1px solid var(--notice-line);
  background: var(--notice-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.notice.error {
  border-color: var(--error-line);
  background: var(--error-bg);
  color: var(--bad);
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ranking-panel {
  max-width: 1000px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-heading-row h2 {
  margin-bottom: 0;
}

.section-heading-row > div > p {
  margin: 5px 0 0;
}

/* Page shell with title bar and theme toggle. */

.planner-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}

.planner-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.planner-brand strong {
  font-size: 16px;
}

.planner-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
  font-weight: 500;
  font-size: 12px;
  padding: 6px 10px;
}

.planner-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px max(24px, env(safe-area-inset-right)) 32px max(24px, env(safe-area-inset-left));
  color: var(--muted);
  font-size: 12px;
}

.planner-footer a {
  color: inherit;
}
