/* Guidus policy & probability pages */

:root {
  --bg: #f0f2f5;
  --page: #ffffff;
  --text: #1a1d21;
  --text-secondary: #5c6370;
  --border: #c5cad3;
  --border-light: #e2e5eb;
  --header-bg: #2d3748;
  --header-text: #ffffff;
  --row-alt: #f7f8fa;
  --row-hover: #eef2f7;
  --accent: #3b6cf4;
  --accent-soft: #e8efff;
  --note-bg: #fffbeb;
  --note-border: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans TC", sans-serif;
  --topbar-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --page: #161b22;
    --text: #e6edf3;
    --text-secondary: #8b949e;
    --border: #30363d;
    --border-light: #21262d;
    --header-bg: #21262d;
    --header-text: #e6edf3;
    --row-alt: #1c2128;
    --row-hover: #262c36;
    --accent: #58a6ff;
    --accent-soft: #1c2d4a;
    --note-bg: #2d2410;
    --note-border: #d29922;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: calc(var(--topbar-h) + 24px) 16px 48px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

/* ── Language bar ── */
.policy-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.policy-topbar label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.policy-topbar select {
  min-width: 140px;
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235c6370' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.policy-topbar select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ── Page shell ── */
.page {
  max-width: 820px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
}

.page-meta {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Legacy: h1/p directly under body without .page */
body > h1 {
  max-width: 820px;
  margin: 0 auto 8px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
}

body > p:first-of-type {
  max-width: 820px;
  margin: 0 auto 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

body > .policy-card,
body > section.policy-card {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Cards ── */
.policy-card {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.policy-card > h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.policy-card > h3 {
  margin: 28px 0 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent);
}

.policy-card > h3:first-of-type {
  margin-top: 8px;
}

/* ── Tables ── */
.table-wrap {
  margin: 0 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  margin: 0;
  font-size: 14px;
  background: var(--page);
}

thead th {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  color: var(--header-text);
  background: var(--header-bg);
  border: 1px solid var(--header-bg);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border: 1px solid var(--border-light);
  vertical-align: middle;
}

tbody tr:nth-child(even) td {
  background: var(--row-alt);
}

tbody tr:hover td {
  background: var(--row-hover);
}

/* Probability column — always last */
table th:last-child,
table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  min-width: 72px;
}

thead th:last-child {
  text-align: right;
}

/* Category column grouping */
td.cat {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--accent-soft) !important;
  vertical-align: top;
  border-right: 1px solid var(--border) !important;
}

tbody tr:hover td.cat {
  background: var(--accent-soft) !important;
}

.table-note,
.note {
  margin: 12px 0 0;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--note-bg);
  border-left: 3px solid var(--note-border);
  border-radius: 0 6px 6px 0;
}

/* ── Policy text pages ── */
.policy-card h2 + p,
.policy-card > p {
  margin: 0 0 12px;
}

.policy-card ul {
  margin: 0 0 16px;
  padding-left: 1.25rem;
}

.policy-card li {
  margin-bottom: 6px;
}

.policy-card li::marker {
  color: var(--accent);
}

/* ── Support form ── */
.support-form {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.support-form label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.support-form textarea {
  resize: vertical;
  min-height: 150px;
}

.support-form button,
.support-mail-link {
  display: inline-block;
  margin-top: 4px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  width: fit-content;
}

.support-form button:hover,
.support-mail-link:hover {
  filter: brightness(0.96);
}

.support-form button:focus-visible,
.support-mail-link:focus-visible,
.support-form input:focus-visible,
.support-form select:focus-visible,
.support-form textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.support-form input:focus-visible,
.support-form select:focus-visible,
.support-form textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.support-botcheck {
  display: none;
}

/* Redirect landing */
.lang-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.lang-list a {
  display: block;
  padding: 14px 18px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.lang-list a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 600px) {
  body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .policy-card {
    padding: 18px 16px;
  }

  .support-form button,
  .support-mail-link {
    width: 100%;
    text-align: center;
  }

  thead th,
  tbody td {
    padding: 10px 10px;
    font-size: 13px;
  }
}
