:root {
  /* Color tokens */
  --color-bg: #eef3f8;
  --color-bg-soft: #f7f9fc;
  --color-page-gradient: #eaf2fb;
  --color-surface: #ffffff;
  --color-surface-muted: #f8fafc;
  --color-surface-raised: #ffffff;
  --color-text: #172033;
  --color-text-strong: #10213b;
  --color-text-muted: #667085;
  --color-border: #d7dfeb;
  --color-border-strong: #b9c7d8;
  --color-border-hover: #c8d7eb;
  --color-primary: #155bb5;
  --color-primary-hover: #0b3f88;
  --color-primary-soft: #e7f0ff;
  --color-primary-border: #bdd0ea;
  --color-on-primary: #ffffff;
  --color-danger: #c73535;
  --color-danger-hover: #9f2424;
  --color-danger-soft: #fff0f0;
  --color-success: #137333;
  --color-warning: #d97706;
  --color-warning-soft: #fff7e6;
  --color-hot: #be123c;
  --color-hot-soft: #fff1f3;
  --color-input-bg: #ffffff;
  --color-focus-ring: rgba(21, 91, 181, 0.14);

  /* Effect tokens */
  --shadow-xs: 0 4px 12px rgba(20, 48, 86, 0.08);
  --shadow-sm: 0 8px 18px rgba(20, 48, 86, 0.08);
  --shadow-md: 0 10px 28px rgba(20, 48, 86, 0.08);
  --shadow-lg: 0 14px 34px rgba(20, 48, 86, 0.14);
  --shadow-primary: 0 14px 28px rgba(21, 91, 181, 0.24);
  --shadow-danger: 0 10px 22px rgba(199, 53, 53, 0.22);

  /* Layout tokens */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --motion-fast: 160ms ease;
  --motion-base: 200ms ease;
  --motion-slow: 240ms ease;

  /* Legacy aliases kept for existing selectors */
  --bg: var(--color-bg);
  --bg-soft: var(--color-bg-soft);
  --surface: var(--color-surface);
  --surface-soft: var(--color-surface-muted);
  --surface-muted: var(--color-surface-muted);
  --surface-raised: var(--color-surface-raised);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --line-strong: var(--color-border-strong);
  --primary: var(--color-primary);
  --primary-dark: var(--color-primary-hover);
  --primary-soft: var(--color-primary-soft);
  --danger: var(--color-danger);
  --danger-soft: var(--color-danger-soft);
  --success: var(--color-success);
  --shadow: var(--shadow-md);
  --shadow-hover: var(--shadow-lg);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #101827;
  --color-bg-soft: #151f31;
  --color-page-gradient: #16233a;
  --color-surface: #182236;
  --color-surface-muted: #1f2b42;
  --color-surface-raised: #1d2a42;
  --color-text: #edf3fb;
  --color-text-strong: #f3f7ff;
  --color-text-muted: #aab7ca;
  --color-border: #324158;
  --color-border-strong: #4a5d79;
  --color-border-hover: #516989;
  --color-primary: #5b9dff;
  --color-primary-hover: #8ab9ff;
  --color-primary-soft: #17345c;
  --color-primary-border: #455d7d;
  --color-on-primary: #081322;
  --color-danger: #ff6b6b;
  --color-danger-hover: #ff9c9c;
  --color-danger-soft: #3a1f25;
  --color-success: #5bd184;
  --color-warning: #ffd58a;
  --color-warning-soft: #3a2b13;
  --color-hot: #ffadc1;
  --color-hot-soft: #3a1f2e;
  --color-input-bg: #111b2d;
  --color-focus-ring: rgba(91, 157, 255, 0.2);
  --shadow-xs: 0 4px 12px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.36);
  --shadow-primary: 0 14px 28px rgba(91, 157, 255, 0.24);
  --shadow-danger: 0 10px 22px rgba(255, 107, 107, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, var(--color-page-gradient) 0, var(--color-bg) 240px),
    var(--color-bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

html[data-theme="dark"] body {
  background:
    linear-gradient(180deg, var(--color-page-gradient) 0, var(--color-bg) 240px),
    var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--motion-fast), text-decoration-color var(--motion-fast);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 14px var(--space-8);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 98%, transparent), color-mix(in srgb, var(--bg-soft) 94%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

html[data-theme="dark"] .site-header {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 88%, transparent), color-mix(in srgb, var(--bg) 94%, transparent));
  border-bottom-color: color-mix(in srgb, var(--line-strong) 72%, transparent);
  box-shadow: var(--shadow-lg);
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  border-radius: var(--radius-pill);
  color: var(--color-text-strong);
  font-size: 20px;
  letter-spacing: 0;
  padding: 6px 10px 6px 7px;
  white-space: nowrap;
  transition:
    background-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.brand:hover {
  background: color-mix(in srgb, var(--primary-soft) 78%, transparent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

html[data-theme="dark"] .brand {
  color: var(--color-text-strong);
}

html[data-theme="dark"] .brand:hover {
  background: color-mix(in srgb, var(--primary-soft) 70%, transparent);
  box-shadow: var(--shadow-md);
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, var(--color-on-primary) 0 11%, transparent 12%),
    linear-gradient(135deg, var(--primary-dark), var(--primary) 58%, #82b9ff);
  box-shadow:
    0 0 0 4px var(--primary-soft),
    var(--shadow-sm);
}

.brand-mark::after {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-on-primary);
  content: "";
  opacity: 0.94;
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.brand-kicker {
  color: var(--primary-dark);
  font-weight: 900;
}

.brand-name {
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  font-weight: 700;
}

html[data-theme="dark"] .brand-mark {
  background:
    radial-gradient(circle at 35% 35%, #ffffff 0 11%, transparent 12%),
    linear-gradient(135deg, var(--primary), #2467c9 58%, #10284d);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent),
    var(--shadow-md);
}

html[data-theme="dark"] .brand-kicker {
  color: var(--primary-dark);
}

html[data-theme="dark"] .brand-name {
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px;
}

.nav-links a,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-weight: 700;
  line-height: 1;
  padding: 9px 12px;
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.portal-link {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
  background:
    linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--primary-soft) 70%, var(--surface)));
  box-shadow: var(--shadow-sm);
  color: var(--primary-dark) !important;
  white-space: nowrap;
}

.portal-link:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-primary);
  color: var(--primary-dark) !important;
}

.theme-toggle {
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.nav-links a:hover,
.link-button:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .link-button {
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
}

html[data-theme="dark"] .portal-link {
  background:
    linear-gradient(135deg, var(--surface-muted), var(--surface));
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  color: #dbeafe !important;
}

html[data-theme="dark"] .portal-link:hover {
  background: color-mix(in srgb, var(--primary-soft) 82%, var(--surface));
  border-color: var(--primary);
  color: #ffffff !important;
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .link-button:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
  background: var(--primary-soft);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .theme-toggle {
  background: var(--surface-muted);
  border-color: var(--line-strong);
  color: #dbeafe;
}

.button-link,
button {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--color-on-primary);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.button-link:hover,
button:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-primary);
  transform: translateY(-2px);
}

html[data-theme="dark"] .button-link:hover,
html[data-theme="dark"] button:hover {
  box-shadow: var(--shadow-primary);
}

button:active,
.button-link:active {
  box-shadow: var(--shadow-xs);
  transform: translateY(1px);
}

button:disabled {
  background: color-mix(in srgb, var(--muted) 36%, var(--line));
  box-shadow: none;
  cursor: not-allowed;
}

html[data-theme="dark"] button:disabled {
  background: #4b5567;
  color: #c8d2e0;
}

button:disabled:hover {
  box-shadow: none;
  transform: none;
}

.link-button {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
}

.link-button.theme-toggle {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.button-link {
  border: 1px solid var(--color-primary-border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--primary-dark);
}

.button-link:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

html[data-theme="dark"] .button-link {
  background: var(--surface-raised);
  border-color: var(--color-primary-border);
  color: #dbeafe;
}

html[data-theme="dark"] .button-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #081322;
}

html[data-theme="dark"] .link-button.theme-toggle {
  background: #22314b;
  border-color: #557093;
  color: #dbeafe;
}

.danger-link,
#delete-post-button {
  color: var(--danger);
}

.nav-links .danger-link {
  border-color: color-mix(in srgb, var(--danger) 22%, transparent);
  background: color-mix(in srgb, var(--danger-soft) 72%, transparent);
}

.danger-link:hover,
#delete-post-button:hover {
  background: var(--danger-soft);
  color: var(--color-danger-hover);
  box-shadow: var(--shadow-danger);
}

#delete-post-button {
  background: var(--danger);
  color: var(--color-on-primary);
}

#delete-post-button:hover {
  background: var(--color-danger-hover);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-danger);
}

html[data-theme="dark"] .danger-link:hover {
  background: var(--danger-soft);
  color: #ff9c9c;
}

html[data-theme="dark"] .nav-links .danger-link {
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  background: color-mix(in srgb, var(--danger-soft) 70%, transparent);
  color: #ff9c9c;
}

html[data-theme="dark"] #delete-post-button {
  background: var(--danger);
  color: #ffffff;
}

html[data-theme="dark"] #delete-post-button:hover {
  background: var(--color-danger-hover);
  box-shadow: var(--shadow-danger);
}

.auth-status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.page.narrow {
  width: min(520px, calc(100% - 32px));
}

.page-title {
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0 0 8px;
  color: var(--color-text-strong);
  font-size: 30px;
  line-height: 1.25;
}

html[data-theme="dark"] .page-title h1,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .shortcut-group h2 {
  color: var(--color-text-strong);
}

.page-title p,
.meta {
  margin: 0;
  color: var(--muted);
}

.current-board {
  display: inline-flex;
  margin-top: 12px !important;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--primary-dark) !important;
  font-weight: 800;
  padding: 7px 12px;
}

.help-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  margin-left: 8px;
  border: 1px solid color-mix(in srgb, var(--color-warning) 62%, #ffffff);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(135deg, #fff8d6 0%, #ffd66b 54%, #f59e0b 100%);
  box-shadow:
    0 12px 24px rgba(217, 119, 6, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  color: #5f3800;
  font-weight: 900;
  padding-inline: 16px;
}

.help-button::before {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #8a5200;
  content: "?";
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.help-button:hover,
.help-button:focus-visible {
  border-color: color-mix(in srgb, var(--color-warning) 78%, #ffffff);
  background:
    linear-gradient(135deg, #fffbe8 0%, #ffe08a 52%, #f6ad1b 100%);
  box-shadow:
    0 16px 30px rgba(217, 119, 6, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  color: #4f2f00;
  transform: translateY(-1px);
}

.floating-write-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  min-height: 52px;
  border: 1px solid color-mix(in srgb, var(--primary) 74%, var(--line));
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: var(--shadow-primary);
  color: var(--color-on-primary);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 13px 18px;
}

.floating-write-button:hover,
.floating-write-button:focus-visible {
  border-color: color-mix(in srgb, var(--primary-hover) 80%, var(--color-on-primary));
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary) 34%, transparent);
  color: var(--color-on-primary);
  transform: translateY(-2px);
}

.floating-write-button:active {
  transform: translateY(0);
}

.floating-write-button.is-loading {
  cursor: wait;
  opacity: 0.9;
}

html[data-theme="dark"] .floating-write-button {
  border-color: color-mix(in srgb, var(--primary) 64%, var(--line-strong));
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary-soft) 70%, #020617));
  color: var(--color-on-primary);
}

html[data-theme="dark"] .current-board {
  background: var(--surface-raised);
  border-color: var(--color-primary-border);
  color: #dbeafe !important;
}

html[data-theme="dark"] .help-button {
  background:
    linear-gradient(135deg, #4f3a12 0%, #d59620 58%, #ffcf68 100%);
  border-color: color-mix(in srgb, var(--color-warning) 60%, var(--line-strong));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 213, 138, 0.12);
  color: #fff4cf;
}

html[data-theme="dark"] .help-button::before {
  background: rgba(16, 24, 39, 0.56);
  color: #ffe7a3;
}

html[data-theme="dark"] .help-button:hover,
html[data-theme="dark"] .help-button:focus-visible {
  background:
    linear-gradient(135deg, #5c4517 0%, #e1a12a 58%, #ffdb81 100%);
  border-color: var(--color-warning);
  color: #ffffff;
}

.community-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: stretch;
  gap: 18px;
  margin-bottom: 18px;
}

.community-hero-copy,
.metric-card,
.preview-panel,
.recent-viewed-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.community-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 240px;
  padding: 28px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 72%, transparent), transparent 46%),
    var(--surface);
}

.community-hero-copy h1 {
  margin: 0 0 10px;
  color: var(--color-text-strong);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.16;
}

.community-hero-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions .current-board,
.hero-actions .help-button {
  margin: 0 !important;
}

.community-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 114px;
  padding: 18px;
}

.metric-label {
  color: color-mix(in srgb, var(--color-text-strong) 86%, var(--primary));
  font-size: 14px;
  letter-spacing: 0;
}

.metric-label,
.metric-helper {
  font-weight: 800;
}

.metric-helper {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.metric-card strong {
  color: var(--color-text-strong);
  font-size: 32px;
  line-height: 1.1;
}

html[data-theme="dark"] .community-hero-copy,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .preview-panel,
html[data-theme="dark"] .recent-viewed-panel {
  border-color: var(--line-strong);
  background: var(--surface);
}

.board-shortcuts {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  margin-bottom: 18px;
}

.shortcut-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  transition:
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    transform var(--motion-base);
}

.shortcut-group:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

html[data-theme="dark"] .shortcut-group:hover,
html[data-theme="dark"] .toolbar:hover,
html[data-theme="dark"] .panel:hover,
html[data-theme="dark"] .form-panel:hover,
html[data-theme="dark"] .comment-item:hover,
html[data-theme="dark"] .activity-item:hover,
html[data-theme="dark"] .profile-list div:hover {
  border-color: var(--color-border-hover);
}

.shortcut-group h2 {
  margin: 0 0 12px;
  color: var(--color-text-strong);
  font-size: 16px;
}

.shortcut-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.board-shortcut {
  display: grid;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 72%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  font-weight: 800;
  min-height: 76px;
  padding: 12px;
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.shortcut-title {
  color: inherit;
  font-size: 14px;
  line-height: 1.25;
}

.shortcut-desc {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

html[data-theme="dark"] .board-shortcut {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: #d6e4f7;
}

html[data-theme="dark"] .board-shortcut[data-board-link="all"] .shortcut-desc {
  color: #dbeafe;
}

.board-shortcut:hover,
.board-shortcut.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--color-on-primary);
}

.board-shortcut:hover .shortcut-desc,
.board-shortcut.active .shortcut-desc {
  color: color-mix(in srgb, var(--color-on-primary) 82%, transparent);
}

.board-shortcut:hover {
  box-shadow: var(--shadow-primary);
  transform: translateY(-2px);
}

.board-shortcut.active {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 8px 18px rgba(21, 91, 181, 0.18);
}

html[data-theme="dark"] .board-shortcut[data-board-link="all"].active .shortcut-desc,
html[data-theme="dark"] .board-shortcut[data-board-link="all"]:hover .shortcut-desc {
  color: #07111f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
}

.board-shortcut.hot {
  background: var(--color-hot-soft);
  border-color: color-mix(in srgb, var(--color-hot) 28%, var(--color-hot-soft));
  color: var(--color-hot);
}

html[data-theme="dark"] .board-shortcut.hot {
  background: var(--color-hot-soft);
  border-color: color-mix(in srgb, var(--color-hot) 38%, var(--line));
  color: var(--color-hot);
}

.board-shortcut.hot:hover,
.board-shortcut.hot.active {
  background: var(--color-hot);
  border-color: var(--color-hot);
  color: var(--color-on-primary);
}

.board-shortcut.hot.active {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    0 8px 18px rgba(190, 18, 60, 0.2);
}

.board-shortcut.notice {
  background: var(--color-warning-soft);
  border-color: color-mix(in srgb, var(--color-warning) 38%, var(--color-warning-soft));
  color: color-mix(in srgb, var(--color-warning) 80%, #422006);
}

html[data-theme="dark"] .board-shortcut.notice {
  background: var(--color-warning-soft);
  border-color: color-mix(in srgb, var(--color-warning) 42%, var(--line));
  color: var(--color-warning);
}

.board-shortcut.notice:hover,
.board-shortcut.notice.active {
  background: var(--color-warning);
  border-color: var(--color-warning);
  color: var(--color-on-primary);
}

.board-shortcut.notice.active {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    0 8px 18px rgba(217, 119, 6, 0.2);
}

.board-shortcut[data-category-link] {
  --shortcut-accent: var(--primary);
  --shortcut-accent-soft: var(--primary-soft);
  --shortcut-accent-text: var(--primary-dark);

  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--shortcut-accent) 28%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--shortcut-accent-soft) 54%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface-soft) 76%, var(--surface));
  color: var(--shortcut-accent-text);
}

.board-shortcut[data-category-link]::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--shortcut-accent);
  content: "";
  opacity: 0.86;
}

.board-shortcut[data-category-link] .shortcut-desc {
  color: color-mix(in srgb, var(--shortcut-accent-text) 58%, var(--muted));
}

.board-shortcut[data-category-link]:hover,
.board-shortcut[data-category-link].active {
  border-color: var(--shortcut-accent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--shortcut-accent-soft) 72%, transparent), transparent 74%),
    var(--surface);
  color: var(--shortcut-accent-text);
  box-shadow: 0 14px 26px color-mix(in srgb, var(--shortcut-accent) 18%, transparent);
}

.board-shortcut[data-category-link]:hover .shortcut-desc,
.board-shortcut[data-category-link].active .shortcut-desc {
  color: color-mix(in srgb, var(--shortcut-accent-text) 70%, var(--muted));
}

.board-shortcut[data-category-link].active {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--shortcut-accent) 30%, transparent),
    0 10px 22px color-mix(in srgb, var(--shortcut-accent) 20%, transparent);
}

.board-shortcut[data-category-link="free"] {
  --shortcut-accent: var(--primary);
  --shortcut-accent-soft: var(--primary-soft);
  --shortcut-accent-text: var(--primary-dark);
}

.board-shortcut[data-category-link="study"] {
  --shortcut-accent: #15803d;
  --shortcut-accent-soft: #e8f7ef;
  --shortcut-accent-text: #166534;
}

.board-shortcut[data-category-link="question"] {
  --shortcut-accent: #d97706;
  --shortcut-accent-soft: #fff5df;
  --shortcut-accent-text: #965f00;
}

.board-shortcut[data-category-link="info"] {
  --shortcut-accent: #0284c7;
  --shortcut-accent-soft: #e9f7ff;
  --shortcut-accent-text: #075985;
}

.board-shortcut[data-category-link="market"] {
  --shortcut-accent: #7c3aed;
  --shortcut-accent-soft: #f3edff;
  --shortcut-accent-text: #5b35a8;
}

.board-shortcut[data-category-link="lost"] {
  --shortcut-accent: #dc2626;
  --shortcut-accent-soft: #fff0f0;
  --shortcut-accent-text: #b42318;
}

html[data-theme="dark"] .board-shortcut[data-category-link] {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--shortcut-accent-soft) 68%, transparent), transparent 72%),
    var(--surface-soft);
  border-color: color-mix(in srgb, var(--shortcut-accent) 38%, var(--line-strong));
  color: var(--shortcut-accent-text);
}

html[data-theme="dark"] .board-shortcut[data-category-link]:hover,
html[data-theme="dark"] .board-shortcut[data-category-link].active {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--shortcut-accent-soft) 80%, transparent), transparent 74%),
    var(--surface);
  border-color: color-mix(in srgb, var(--shortcut-accent) 58%, var(--line-strong));
  color: var(--shortcut-accent-text);
}

html[data-theme="dark"] .board-shortcut[data-category-link="free"] {
  --shortcut-accent: var(--primary);
  --shortcut-accent-soft: #17345c;
  --shortcut-accent-text: #dbeafe;
}

html[data-theme="dark"] .board-shortcut[data-category-link="study"] {
  --shortcut-accent: #5bd184;
  --shortcut-accent-soft: #183524;
  --shortcut-accent-text: #a9edc1;
}

html[data-theme="dark"] .board-shortcut[data-category-link="question"] {
  --shortcut-accent: #ffd58a;
  --shortcut-accent-soft: #3b2d15;
  --shortcut-accent-text: #f6d78f;
}

html[data-theme="dark"] .board-shortcut[data-category-link="info"] {
  --shortcut-accent: #67d4ff;
  --shortcut-accent-soft: #133142;
  --shortcut-accent-text: #abe4ff;
}

html[data-theme="dark"] .board-shortcut[data-category-link="market"] {
  --shortcut-accent: #b69cff;
  --shortcut-accent-soft: #2c2445;
  --shortcut-accent-text: #d8c8ff;
}

html[data-theme="dark"] .board-shortcut[data-category-link="lost"] {
  --shortcut-accent: #ff8f98;
  --shortcut-accent-soft: #3b2024;
  --shortcut-accent-text: #ffb4bb;
}

.dashboard-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-preview-grid .preview-panel {
  --preview-accent: var(--primary);
  --preview-accent-soft: var(--primary-soft);
  --preview-accent-text: var(--primary-dark);
  --preview-panel-tint: color-mix(in srgb, var(--preview-accent-soft) 72%, #ffffff);
  --preview-item-tint: color-mix(in srgb, var(--preview-accent-soft) 66%, #ffffff);
  --preview-item-hover-tint: color-mix(in srgb, var(--preview-accent-soft) 78%, #ffffff);
  --preview-item-border: color-mix(in srgb, var(--preview-accent) 22%, var(--line));
  --preview-left-bar: var(--preview-accent);
  --preview-label-bg: color-mix(in srgb, var(--preview-accent-soft) 76%, var(--surface));
  --preview-label-border: color-mix(in srgb, var(--preview-accent) 34%, var(--preview-accent-soft));
  --preview-shadow-color: color-mix(in srgb, var(--preview-accent) 18%, transparent);
  --preview-rank-start: #be123c;
  --preview-rank-mid: #e11d48;
  --preview-rank-end: #fb7185;

  position: relative;
  overflow: hidden;
  border-color: var(--line);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--preview-panel-tint) 92%, transparent), transparent 48%),
    linear-gradient(180deg, color-mix(in srgb, var(--preview-panel-tint) 82%, transparent), transparent 78%),
    var(--surface);
  transition:
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    transform var(--motion-base);
}

.dashboard-preview-grid .preview-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--preview-left-bar), color-mix(in srgb, var(--preview-left-bar) 52%, transparent));
  content: "";
}

.dashboard-preview-grid .preview-panel:hover {
  border-color: color-mix(in srgb, var(--preview-accent) 52%, var(--line));
  box-shadow: 0 16px 32px var(--preview-shadow-color);
  transform: translateY(-2px);
}

.dashboard-preview-grid .preview-panel.preview-panel-hot {
  --preview-accent: #e11d48;
  --preview-accent-soft: #fff1f5;
  --preview-accent-text: #9f1239;
  --preview-panel-tint: #ffd6e1;
  --preview-item-tint: #ffe9f0;
  --preview-item-hover-tint: #ffdbe7;
  --preview-item-border: #fda4af;
  --preview-left-bar: #e11d48;
  --preview-label-bg: #ffdbe7;
  --preview-label-border: #fb7185;
  --preview-shadow-color: rgba(225, 29, 72, 0.24);
  --preview-rank-start: #be123c;
  --preview-rank-mid: #e11d48;
  --preview-rank-end: #fb7185;
}

.dashboard-preview-grid .preview-panel.preview-panel-notice {
  --preview-accent: #f59e0b;
  --preview-accent-soft: #fff7e6;
  --preview-accent-text: #9a5b00;
  --preview-panel-tint: #ffe6a3;
  --preview-item-tint: #fff3d6;
  --preview-item-hover-tint: #ffe9b8;
  --preview-item-border: #eebf55;
  --preview-left-bar: #f59e0b;
  --preview-label-bg: #ffe9b8;
  --preview-label-border: #e9ac35;
  --preview-shadow-color: rgba(217, 119, 6, 0.24);
}

.dashboard-preview-grid .preview-panel.preview-panel-latest {
  --preview-accent: #0284c7;
  --preview-accent-soft: #e0f7ff;
  --preview-accent-text: #075985;
  --preview-panel-tint: #c9efff;
  --preview-item-tint: #e3f8ff;
  --preview-item-hover-tint: #cff0ff;
  --preview-item-border: #83d4f6;
  --preview-left-bar: #0ea5e9;
  --preview-label-bg: #cff0ff;
  --preview-label-border: #67c9ef;
  --preview-shadow-color: rgba(14, 165, 233, 0.22);
}

.preview-panel,
.recent-viewed-panel {
  padding: 18px;
}

.preview-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-panel-header h2,
.preview-panel h3 {
  margin: 0;
  color: var(--color-text-strong);
  font-size: 18px;
}

.dashboard-preview-grid .preview-panel-header {
  position: relative;
  align-items: center;
  border-bottom: 1px solid color-mix(in srgb, var(--preview-accent) 22%, transparent);
  padding-bottom: 12px;
}

.dashboard-preview-grid .dashboard-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--preview-label-border);
  border-radius: var(--radius-pill);
  background: var(--preview-label-bg);
  color: var(--preview-accent-text);
  font-size: 11px;
  font-weight: 900;
  padding: 4px 9px;
}

.dashboard-preview-grid .preview-panel-header h2 {
  margin-top: 6px;
  font-size: 19px;
  letter-spacing: 0;
}

.preview-panel h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.preview-list {
  display: grid;
  gap: 8px;
}

.preview-item {
  position: relative;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 12px;
  transition:
    border-color var(--motion-fast),
    background-color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.dashboard-preview-grid .preview-item {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px 10px;
  overflow: hidden;
  border-color: var(--preview-item-border);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--preview-item-tint) 86%, transparent), transparent 58%),
    var(--surface-soft);
  padding: 13px 13px 13px 15px;
}

.dashboard-preview-grid .preview-item::before {
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--preview-left-bar);
  content: "";
  opacity: 0.96;
}

.dashboard-preview-grid .preview-item.has-rank {
  grid-template-columns: auto minmax(0, 1fr);
}

.preview-item:hover,
.preview-item:focus-visible {
  border-color: var(--color-border-hover);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  outline: none;
  transform: translateY(-1px);
}

.dashboard-preview-grid .preview-item:hover,
.dashboard-preview-grid .preview-item:focus-visible {
  border-color: color-mix(in srgb, var(--preview-accent) 48%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--preview-item-hover-tint) 92%, transparent), transparent 62%),
    var(--surface);
  box-shadow: 0 12px 24px var(--preview-shadow-color);
}

.preview-item strong {
  color: var(--color-text-strong);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.preview-item span,
.preview-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-preview-grid .preview-item-title {
  grid-column: 2;
  color: var(--color-text-strong);
  font-size: 14px;
  font-weight: 900;
}

.dashboard-preview-grid .preview-item-meta {
  grid-column: 2;
  color: color-mix(in srgb, var(--preview-accent-text) 62%, var(--muted));
  font-weight: 800;
  line-height: 1.35;
}

.dashboard-preview-grid .preview-item:not(.has-rank) .preview-item-title,
.dashboard-preview-grid .preview-item:not(.has-rank) .preview-item-meta {
  grid-column: 1;
}

.dashboard-preview-grid .skeleton-preview-item {
  grid-template-columns: minmax(0, 1fr);
}

.preview-item-rank {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--preview-rank-mid) 46%, var(--preview-accent-soft));
  border-radius: var(--radius-pill);
  background:
    linear-gradient(135deg, var(--preview-rank-start) 0%, var(--preview-rank-mid) 54%, var(--preview-rank-end) 100%);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--preview-rank-mid) 20%, transparent);
  color: var(--color-on-primary) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1;
}

.preview-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px;
}

.preview-list-compact {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.preview-panel-compact {
  padding: 14px;
  box-shadow: var(--shadow-xs);
}

html[data-theme="dark"] .preview-item,
html[data-theme="dark"] .preview-empty {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

html[data-theme="dark"] .dashboard-preview-grid .preview-panel {
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--preview-panel-tint) 82%, transparent), transparent 46%),
    linear-gradient(180deg, color-mix(in srgb, var(--preview-panel-tint) 68%, transparent), transparent 74%),
    var(--surface);
  border-color: var(--line-strong);
}

html[data-theme="dark"] .dashboard-preview-grid .preview-panel.preview-panel-hot {
  --preview-accent: #fb7185;
  --preview-accent-soft: #3a1f2e;
  --preview-accent-text: #ffccd8;
  --preview-panel-tint: #3f1729;
  --preview-item-tint: #311b28;
  --preview-item-hover-tint: #421f31;
  --preview-item-border: #7f3041;
  --preview-left-bar: #fb7185;
  --preview-label-bg: #3f1729;
  --preview-label-border: #8f4152;
  --preview-shadow-color: rgba(251, 113, 133, 0.2);
  --preview-rank-start: #be123c;
  --preview-rank-mid: #f43f5e;
  --preview-rank-end: #fda4af;
}

html[data-theme="dark"] .dashboard-preview-grid .preview-panel.preview-panel-notice {
  --preview-accent: #fbbf24;
  --preview-accent-soft: #3a2b13;
  --preview-accent-text: #ffe4a8;
  --preview-panel-tint: #3e2a0c;
  --preview-item-tint: #332712;
  --preview-item-hover-tint: #47310f;
  --preview-item-border: #816025;
  --preview-left-bar: #fbbf24;
  --preview-label-bg: #3e2a0c;
  --preview-label-border: #8f6820;
  --preview-shadow-color: rgba(251, 191, 36, 0.18);
}

html[data-theme="dark"] .dashboard-preview-grid .preview-panel.preview-panel-latest {
  --preview-accent: #38bdf8;
  --preview-accent-soft: #123142;
  --preview-accent-text: #c7f0ff;
  --preview-panel-tint: #0f3248;
  --preview-item-tint: #132f42;
  --preview-item-hover-tint: #163c56;
  --preview-item-border: #326b86;
  --preview-left-bar: #38bdf8;
  --preview-label-bg: #0f3248;
  --preview-label-border: #397b99;
  --preview-shadow-color: rgba(56, 189, 248, 0.18);
}

html[data-theme="dark"] .dashboard-preview-grid .preview-item {
  border-color: var(--preview-item-border);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--preview-item-tint) 88%, transparent), transparent 58%),
    var(--surface-soft);
}

html[data-theme="dark"] .dashboard-preview-grid .dashboard-eyebrow {
  background: var(--preview-label-bg);
  border-color: var(--preview-label-border);
  color: var(--preview-accent-text);
}

html[data-theme="dark"] .dashboard-preview-grid .preview-item-meta {
  color: color-mix(in srgb, var(--preview-accent-text) 68%, var(--muted));
}

html[data-theme="dark"] .preview-item:hover,
html[data-theme="dark"] .preview-item:focus-visible {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--preview-item-hover-tint) 90%, transparent), transparent 62%),
    var(--surface-raised);
}

.toolbar,
.panel,
.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  transition:
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    transform var(--motion-base);
}

html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .form-panel,
html[data-theme="dark"] .shortcut-group {
  background: var(--surface);
  border-color: var(--line);
}

.toolbar:hover,
.panel:hover,
.form-panel:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
}

.toolbar form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding-top: 2px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-field input {
  padding-right: 42px;
}

.search-field input[type="search"]::-webkit-search-cancel-button,
.search-field input[type="search"]::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-field input[type="search"]::-ms-clear,
.search-field input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.search-clear-button {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 28px;
  min-height: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  transform: translateY(-50%);
}

.search-clear-button:hover,
.search-clear-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  box-shadow: none;
  color: var(--primary-dark);
  transform: translateY(-50%);
}

.recent-searches {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
}

.recent-search-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.recent-search-chip,
.recent-search-clear {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  box-shadow: none;
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.recent-search-chip:hover,
.recent-search-chip:focus-visible,
.recent-search-clear:hover,
.recent-search-clear:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
  background: var(--primary-soft);
  box-shadow: none;
  color: var(--primary-dark);
  transform: none;
}

.recent-search-clear {
  color: var(--muted);
}

.search-highlight {
  border: 1px solid color-mix(in srgb, var(--color-warning) 46%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--color-warning-soft) 62%, #facc15);
  color: color-mix(in srgb, var(--color-text-strong) 82%, #92400e);
  font-weight: 900;
  padding: 0 2px;
}

.list-summary-bar {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 7px 10px;
}

.filter-chip-board,
.filter-chip-search {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.list-summary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

.result-summary {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.view-mode-toggle {
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  padding: 4px;
}

.view-mode-button {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  padding: 7px 11px;
}

.view-mode-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: none;
  color: var(--primary-dark);
  transform: none;
}

.view-mode-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 26%, transparent);
  outline-offset: 2px;
}

.view-mode-button.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--color-on-primary);
}

html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .recent-search-chip,
html[data-theme="dark"] .recent-search-clear,
html[data-theme="dark"] .view-mode-toggle {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

html[data-theme="dark"] .filter-chip-board,
html[data-theme="dark"] .filter-chip-search {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface));
  color: #dbeafe;
}

html[data-theme="dark"] .view-mode-button:hover {
  background: var(--surface-raised);
  color: #dbeafe;
}

html[data-theme="dark"] .search-clear-button:hover,
html[data-theme="dark"] .search-clear-button:focus-visible,
html[data-theme="dark"] .recent-search-chip:hover,
html[data-theme="dark"] .recent-search-chip:focus-visible,
html[data-theme="dark"] .recent-search-clear:hover,
html[data-theme="dark"] .recent-search-clear:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface));
  color: #dbeafe;
}

html[data-theme="dark"] .search-highlight {
  border-color: color-mix(in srgb, var(--color-warning) 28%, transparent);
  background: color-mix(in srgb, var(--color-warning) 30%, var(--surface-raised));
  color: #fff7d6;
}

.panel {
  margin-bottom: 20px;
  overflow-x: auto;
  padding: 22px;
}

.panel h2 {
  margin: 0 0 14px;
  color: var(--color-text-strong);
  font-size: 20px;
}

.form-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.form-message {
  margin: 0;
  min-height: 24px;
  color: var(--muted);
  font-weight: 700;
}

.form-message[data-type="success"] {
  color: var(--success);
}

.form-message[data-type="error"] {
  color: var(--danger);
}

.write-panel {
  gap: 18px;
}

.write-tabs {
  display: inline-flex;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
}

.write-tab {
  min-width: 96px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.write-tab:hover {
  transform: none;
  background: var(--surface-raised);
  color: var(--primary);
}

.write-tab.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.write-guide-card,
.draft-box,
.preview-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 42%, transparent), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.write-guide-card h2,
.preview-title {
  margin: 0;
  color: var(--color-text-strong);
}

.write-guide-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  font-weight: 700;
  line-height: 1.6;
}

.write-field-label {
  position: relative;
}

.character-counter {
  justify-self: end;
  margin-top: -2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.character-counter.is-warning {
  color: var(--warning);
}

.write-panel.is-previewing > label {
  display: none;
}

.preview-shell {
  display: grid;
  gap: 12px;
}

.preview-category {
  width: fit-content;
}

.preview-title {
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.25;
}

.preview-title.is-empty,
.preview-body.is-empty {
  color: var(--muted);
}

.preview-meta {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.preview-body {
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.draft-box {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: var(--surface-soft);
}

.draft-status {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.draft-status[data-type="success"] {
  color: var(--success);
}

.draft-status[data-type="warning"] {
  color: var(--warning);
}

.draft-status[data-type="error"] {
  color: var(--danger);
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

html[data-theme="dark"] .write-guide-card,
html[data-theme="dark"] .draft-box,
html[data-theme="dark"] .preview-panel,
html[data-theme="dark"] .preview-body,
html[data-theme="dark"] .write-tabs {
  border-color: var(--line-strong);
  background-color: var(--surface-soft);
}

.loading-inline,
.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.loading-spinner,
.button-spinner {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  border: 2px solid color-mix(in srgb, currentColor 24%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: loading-spin 720ms linear infinite;
}

.loading-spinner {
  color: var(--primary);
}

.button-spinner {
  color: currentColor;
}

button.is-loading,
.button-link.is-loading,
.link-button.is-loading {
  cursor: wait;
  opacity: 0.86;
}

button.is-loading:hover,
.button-link.is-loading:hover,
.link-button.is-loading:hover {
  transform: none;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  --skeleton-width: 100%;
  position: relative;
  display: block;
  width: var(--skeleton-width);
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--line-strong) 42%, var(--surface-muted)) 0%,
    color-mix(in srgb, var(--primary-soft) 64%, var(--surface-raised)) 48%,
    color-mix(in srgb, var(--line-strong) 42%, var(--surface-muted)) 100%
  );
  color: transparent;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 64%, transparent), transparent);
  content: "";
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
}

.metric-card .skeleton,
.preview-item .skeleton,
.post-card.skeleton-card .skeleton,
.skeleton-row .skeleton {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line-strong) 36%, transparent);
}

.skeleton-title {
  height: 20px;
  border-radius: var(--radius-sm);
}

.skeleton-title-lg {
  height: 36px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
}

.skeleton-meta {
  height: 13px;
}

.skeleton-chip,
.skeleton-pill {
  height: 28px;
}

.skeleton-counter {
  height: 34px;
  border-radius: var(--radius-sm);
}

.skeleton-block {
  height: 120px;
  margin-top: 12px;
  border-radius: var(--radius-md);
}

.skeleton-card {
  border-color: color-mix(in srgb, var(--line-strong) 76%, var(--primary-soft));
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-muted));
  pointer-events: none;
}

.skeleton-preview-item {
  border-color: color-mix(in srgb, var(--line-strong) 70%, var(--primary-soft));
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-muted));
  cursor: default;
}

.skeleton-row td {
  background: color-mix(in srgb, var(--surface-muted) 62%, var(--surface));
  vertical-align: middle;
}

.skeleton-row.is-optional {
  opacity: 0.72;
}

.post-detail-actions.is-skeleton > :not([data-detail-actions-skeleton]) {
  visibility: hidden;
}

.skeleton-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

html[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--surface-muted) 76%, #020617) 0%,
    color-mix(in srgb, var(--surface-raised) 74%, var(--primary-soft)) 48%,
    color-mix(in srgb, var(--surface-muted) 76%, #020617) 100%
  );
}

html[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, #dbeafe 16%, transparent), transparent);
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

label {
  display: grid;
  gap: 8px;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-weight: 800;
}

html[data-theme="dark"] label,
html[data-theme="dark"] .comment-header strong,
html[data-theme="dark"] .profile-list dd {
  color: var(--color-text-strong);
}

.checkbox-label {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-self: start;
}

.checkbox-label input {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--color-input-bg);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--color-input-bg);
  border-color: var(--line-strong);
  color: var(--text);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, var(--text));
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  outline: none;
}

textarea {
  resize: vertical;
  max-width: 100%;
}

.password-toggle {
  justify-self: start;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  color: var(--primary);
  padding: 8px 12px;
}

html[data-theme="dark"] .password-toggle {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: #dbeafe;
}

.password-toggle:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.post-table {
  min-width: 920px;
  width: 100%;
  border-collapse: collapse;
}

.post-table th,
.post-table td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
}

.post-table th {
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--primary-soft));
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

html[data-theme="dark"] .post-table th {
  background: color-mix(in srgb, var(--surface-soft) 88%, var(--primary-soft));
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.post-table td {
  background: var(--surface);
  transition: background-color var(--motion-fast);
}

html[data-theme="dark"] .post-table td {
  background: var(--surface);
}

.post-table tbody tr:hover td {
  background: color-mix(in srgb, var(--primary-soft) 34%, var(--surface));
}

html[data-theme="dark"] .post-table tbody tr:hover td {
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
}

.post-table a {
  color: var(--primary);
  font-weight: 800;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.post-table a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.responsive-table {
  overflow-x: auto;
}

.post-card-list {
  display: none;
}

.post-list-panel.is-card-view {
  overflow-x: visible;
}

.post-list-panel.is-card-view .post-table {
  display: none;
}

.post-list-panel.is-card-view .post-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.post-list-panel.is-table-view .post-card-list {
  display: none;
}

.post-card {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  cursor: pointer;
  padding: 16px;
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.post-card:hover,
.post-card:focus-visible {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-sm);
  outline: none;
  transform: translateY(-1px);
}

html[data-theme="dark"] .post-card {
  background: var(--surface);
  border-color: var(--line-strong);
}

.post-card-header,
.post-card-stats {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-card-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.post-card-title a {
  color: var(--color-text-strong);
  display: -webkit-box;
  font-weight: 900;
  overflow: hidden;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-card-title a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.post-card-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

html[data-theme="dark"] .post-card-stat {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
}

.post-card-empty {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  padding: 22px 16px;
  text-align: center;
}

html[data-theme="dark"] .post-card-empty {
  border-color: var(--line-strong);
  background: var(--surface);
}

.category-chip,
.category-badge,
.anonymous-badge,
.reply-badge,
.edited-badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 9px;
  white-space: nowrap;
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.category-chip:hover,
.category-badge:hover,
.anonymous-badge:hover,
.reply-badge:hover,
.edited-badge:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.category-badge {
  margin: 0 0 10px;
}

.anonymous-badge {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
  margin-left: 6px;
}

.reply-badge {
  background: #eef6ff;
  border-color: #bfdcff;
  color: #0b5cab;
  margin-left: 6px;
}

.edited-badge {
  background: #f4f0ff;
  border-color: #d8ccff;
  color: #5b35a8;
  margin-left: 6px;
}

.category-chip[data-category="notice"],
.category-badge[data-category="notice"] {
  background: #eaf1ff;
  border-color: #a9c5ff;
  color: #123f8c;
}

html[data-theme="dark"] .category-chip[data-category="notice"],
html[data-theme="dark"] .category-badge[data-category="notice"] {
  background: #1f355d;
  border-color: #5f83c3;
  color: #cfe0ff;
}

.category-chip[data-category="study"],
.category-badge[data-category="study"] {
  background: #e8f7ef;
  border-color: #bde6cd;
  color: #166534;
}

html[data-theme="dark"] .category-chip[data-category="study"],
html[data-theme="dark"] .category-badge[data-category="study"] {
  background: #183524;
  border-color: #47795b;
  color: #a9edc1;
}

.category-chip[data-category="question"],
.category-badge[data-category="question"] {
  background: #fff5df;
  border-color: #f0d08a;
  color: #965f00;
}

html[data-theme="dark"] .category-chip[data-category="question"],
html[data-theme="dark"] .category-badge[data-category="question"] {
  background: #3b2d15;
  border-color: #8b6d2b;
  color: #f6d78f;
}

.category-chip[data-category="info"],
.category-badge[data-category="info"] {
  background: #e9f7ff;
  border-color: #b6e1f7;
  color: #075985;
}

html[data-theme="dark"] .category-chip[data-category="info"],
html[data-theme="dark"] .category-badge[data-category="info"] {
  background: #133142;
  border-color: #427895;
  color: #abe4ff;
}

.category-chip[data-category="market"],
.category-badge[data-category="market"] {
  background: #f3edff;
  border-color: #d6c4ff;
  color: #5b35a8;
}

html[data-theme="dark"] .category-chip[data-category="market"],
html[data-theme="dark"] .category-badge[data-category="market"] {
  background: #2c2445;
  border-color: #745ba8;
  color: #d8c8ff;
}

.category-chip[data-category="lost"],
.category-badge[data-category="lost"] {
  background: #fff0f0;
  border-color: #f3b6b6;
  color: #b42318;
}

html[data-theme="dark"] .category-chip[data-category="lost"],
html[data-theme="dark"] .category-badge[data-category="lost"] {
  background: #3b2024;
  border-color: #8e4a52;
  color: #ffb4bb;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.pagination span {
  color: var(--muted);
  font-weight: 800;
}

.pagination button:disabled {
  background: color-mix(in srgb, var(--muted) 30%, var(--line));
  cursor: not-allowed;
}

.post-detail-card {
  display: grid;
  gap: 18px;
}

.reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 950;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), #83bfff);
  box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 32%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--motion-fast);
}

.post-detail-header {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.post-detail-title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.post-detail-meta {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.post-detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.post-detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.post-detail-meta-row.is-profile .post-detail-meta-item {
  min-height: 0;
  border-color: transparent;
  background: transparent;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  padding: 0;
}

.post-detail-meta-row.is-stats .post-detail-meta-item {
  border-color: color-mix(in srgb, var(--primary) 18%, var(--line));
}

.post-detail-meta-item strong {
  color: var(--muted);
  font-weight: 900;
}

html[data-theme="dark"] .post-detail-meta-item {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

html[data-theme="dark"] .post-detail-meta-row.is-profile .post-detail-meta-item {
  background: transparent;
  border-color: transparent;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

html[data-theme="dark"] .post-detail-meta-row.is-stats .post-detail-meta-item {
  border-color: var(--line-strong);
}

.content-block,
.post-detail-body {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
  font-size: 17px;
  line-height: 1.8;
  margin: 0;
  padding: 24px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

html[data-theme="dark"] .content-block,
html[data-theme="dark"] .post-detail-body {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}

.actions,
.post-detail-actions,
.reaction-actions,
.owner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.post-detail-actions {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.reaction-actions,
.owner-actions {
  min-width: 0;
}

.owner-actions {
  justify-content: flex-end;
}

.detail-jump-actions {
  display: flex;
  flex: 1 1 160px;
  justify-content: center;
}

.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--color-primary-border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--primary-dark);
  gap: 6px;
  padding: 10px 14px;
}

.actions button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: var(--shadow-primary);
}

.actions .meta {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  font-size: 14px;
  font-weight: 800;
  padding: 7px 11px;
}

#like-button {
  min-width: 68px;
  min-height: 38px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border-color: #b7d7c3;
  color: #166534;
  font-size: 15px;
  padding: 8px 12px;
}

#like-button:hover {
  background: #e8f7ef;
  border-color: #72b78a;
  color: #14532d;
}

#like-button.is-selected {
  background: #dff3e7;
  border-color: #4f9f68;
  box-shadow:
    inset 0 0 0 1px rgba(79, 159, 104, 0.24),
    0 10px 22px rgba(22, 101, 52, 0.16);
  color: #14532d;
}

#dislike-button {
  min-width: 68px;
  min-height: 38px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border-color: #f0c0c0;
  color: #b42318;
  font-size: 15px;
  padding: 8px 12px;
}

#dislike-button:hover {
  background: #fff0f0;
  border-color: #dc7a7a;
  color: #991b1b;
}

#dislike-button.is-selected {
  background: #ffe6e6;
  border-color: #cf5f5f;
  box-shadow:
    inset 0 0 0 1px rgba(207, 95, 95, 0.22),
    0 10px 22px rgba(180, 35, 24, 0.14);
  color: #991b1b;
}

#bookmark-button {
  min-width: 68px;
  min-height: 38px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border-color: #d6c4ff;
  color: #5b35a8;
  font-size: 15px;
  padding: 8px 12px;
}

#bookmark-button:hover {
  background: #f3edff;
  border-color: #a58bde;
  color: #4c1d95;
}

#bookmark-button.is-selected {
  background: #eee6ff;
  border-color: #8a6fd1;
  box-shadow:
    inset 0 0 0 1px rgba(138, 111, 209, 0.22),
    0 10px 22px rgba(91, 53, 168, 0.14);
  color: #4c1d95;
}

#share-post-button {
  border-color: #b6e1f7;
  color: #075985;
}

#share-post-button:hover {
  background: #e9f7ff;
  border-color: #75bfe3;
  color: #075985;
}

.comment-jump-button {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  color: var(--primary-dark);
}

.comment-jump-button:hover {
  background: color-mix(in srgb, var(--primary-soft) 82%, var(--surface));
  border-color: var(--primary);
  color: var(--primary-dark);
}

.back-to-top-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 880;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
  padding: 10px 14px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--motion-base),
    transform var(--motion-base),
    background var(--motion-fast),
    border-color var(--motion-fast);
}

.back-to-top-button.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top-button:hover,
.back-to-top-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.actions #delete-post-button {
  border-color: #e59696;
  background: var(--danger);
  color: var(--color-on-primary);
}

.actions #delete-post-button:hover {
  border-color: var(--color-danger-hover);
  background: var(--color-danger-hover);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-danger);
}

html[data-theme="dark"] .actions button {
  background: var(--surface-raised);
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-sm);
  color: #dbeafe;
}

html[data-theme="dark"] .actions button:hover {
  background: color-mix(in srgb, var(--primary-soft) 82%, var(--surface));
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

html[data-theme="dark"] .actions .meta {
  background: color-mix(in srgb, var(--surface) 82%, var(--bg));
  border-color: var(--line-strong);
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
}

html[data-theme="dark"] #like-button {
  background: #162a20;
  border-color: #47795b;
  color: #a9edc1;
}

html[data-theme="dark"] #like-button:hover {
  background: #183524;
  border-color: #63a978;
  color: #c8f7d8;
}

html[data-theme="dark"] #like-button.is-selected {
  background: #1f5131;
  border-color: #7ed99a;
  box-shadow:
    inset 0 0 0 1px rgba(126, 217, 154, 0.2),
    0 10px 22px rgba(0, 0, 0, 0.24);
  color: #dcffe6;
}

html[data-theme="dark"] #dislike-button {
  background: #321c21;
  border-color: #8e4a52;
  color: #ffb4bb;
}

html[data-theme="dark"] #dislike-button:hover {
  background: #3b2024;
  border-color: #cf6e78;
  color: #ffd4d8;
}

html[data-theme="dark"] #dislike-button.is-selected {
  background: #632932;
  border-color: #ff9ca6;
  box-shadow:
    inset 0 0 0 1px rgba(255, 156, 166, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.24);
  color: #ffe1e4;
}

html[data-theme="dark"] #bookmark-button {
  background: #251f3a;
  border-color: #745ba8;
  color: #d8c8ff;
}

html[data-theme="dark"] #bookmark-button:hover {
  background: #2c2445;
  border-color: #9a7dd5;
  color: #eee7ff;
}

html[data-theme="dark"] #bookmark-button.is-selected {
  background: #46306f;
  border-color: #c1a9ff;
  box-shadow:
    inset 0 0 0 1px rgba(193, 169, 255, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.24);
  color: #f4efff;
}

html[data-theme="dark"] #share-post-button {
  border-color: #427895;
  color: #abe4ff;
}

html[data-theme="dark"] #share-post-button:hover {
  background: #133142;
  border-color: #60a5c7;
  color: #d9f4ff;
}

html[data-theme="dark"] .comment-jump-button,
html[data-theme="dark"] .back-to-top-button {
  background: var(--surface-raised);
  border-color: var(--color-primary-border);
  color: #dbeafe;
}

html[data-theme="dark"] .comment-jump-button:hover,
html[data-theme="dark"] .back-to-top-button:hover,
html[data-theme="dark"] .back-to-top-button:focus-visible {
  background: color-mix(in srgb, var(--primary-soft) 84%, var(--surface));
  border-color: var(--primary);
  color: #ffffff;
}

html[data-theme="dark"] .actions #delete-post-button {
  background: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 64%, var(--line));
  color: #ffffff;
}

html[data-theme="dark"] .actions #delete-post-button:hover {
  background: var(--color-danger-hover);
  border-color: var(--color-danger-hover);
  box-shadow: var(--shadow-danger);
}

.comment-panel {
  display: grid;
  gap: 16px;
}

.comment-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.comment-panel-header h2 {
  margin-bottom: 0;
}

.comment-form,
.comment-composer {
  display: grid;
  gap: 12px;
}

.comment-composer {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  padding: 16px;
}

html[data-theme="dark"] .comment-composer {
  background: var(--surface-soft);
  border-color: var(--line);
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment-item,
.activity-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px;
  transition:
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    transform var(--motion-base);
}

html[data-theme="dark"] .comment-item,
html[data-theme="dark"] .activity-item,
html[data-theme="dark"] .profile-list div,
html[data-theme="dark"] .reply-form,
html[data-theme="dark"] .comment-edit-form {
  background: var(--surface-soft);
  border-color: var(--line);
}

html[data-theme="dark"] .reply-item {
  background: color-mix(in srgb, var(--surface-soft) 82%, var(--primary-soft));
}

.comment-item:hover,
.activity-item:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.comment-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-identity,
.comment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.comment-actions {
  justify-content: flex-end;
}

.comment-header strong {
  color: var(--color-text-strong);
}

.comment-header span {
  color: var(--muted);
  font-size: 14px;
}

.comment-item p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0 18px;
  padding-left: 12px;
  border-left: 3px solid var(--line);
}

.reply-item {
  background: color-mix(in srgb, var(--surface) 72%, var(--surface-soft));
}

.reply-form {
  display: grid;
  gap: 10px;
  margin: 12px 0 0 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.comment-edit-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.edited-meta {
  margin-top: 8px !important;
  font-size: 13px;
}

.mypage-dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-summary-card,
.recent-activity-panel,
.activity-stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .profile-summary-card,
html[data-theme="dark"] .recent-activity-panel,
html[data-theme="dark"] .activity-stat-card {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="dark"] .profile-summary-meta div,
html[data-theme="dark"] .recent-activity-item,
html[data-theme="dark"] .activity-empty {
  background: var(--surface-soft);
  border-color: var(--line);
}

.profile-summary-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 22px;
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(135deg, var(--primary-dark), var(--primary) 58%, #82b9ff);
  box-shadow: var(--shadow-primary);
  color: var(--color-on-primary);
  font-size: 18px;
  font-weight: 900;
}

.profile-summary-content {
  min-width: 0;
}

.dashboard-eyebrow {
  margin: 0 0 6px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

html[data-theme="dark"] .dashboard-eyebrow {
  color: #b9d6ff;
}

.profile-summary-card h2,
.recent-activity-panel h2 {
  margin: 0;
  color: var(--color-text-strong);
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.profile-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}

.profile-summary-meta div {
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 10px 12px;
}

.profile-summary-meta dt,
.activity-stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-summary-meta dd {
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 900;
}

.activity-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.activity-stat-card {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 16px;
  transition:
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    transform var(--motion-base);
}

.activity-stat-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.activity-stat-card strong {
  color: var(--color-text-strong);
  font-size: 30px;
  line-height: 1;
}

.activity-stat-helper {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.recent-activity-panel {
  padding: 20px;
}

.recent-activity-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.recent-activity-count {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 6px 10px;
}

html[data-theme="dark"] .recent-activity-count {
  background: var(--primary-soft);
  border-color: var(--color-primary-border);
  color: #dbeafe;
}

.recent-activity-list {
  display: grid;
  gap: 10px;
}

.recent-activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text);
  padding: 12px;
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.recent-activity-item:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.recent-activity-type {
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
  white-space: nowrap;
}

html[data-theme="dark"] .recent-activity-type {
  color: #dbeafe;
}

.recent-activity-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recent-activity-body strong {
  color: var(--color-text-strong);
  overflow-wrap: anywhere;
}

.activity-timeline {
  position: relative;
}

.activity-timeline-item {
  grid-template-columns: 28px minmax(0, 1fr);
  position: relative;
}

.activity-timeline-marker {
  position: relative;
  width: 14px;
  height: 14px;
  margin: 8px auto 0;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 32%, var(--line));
}

.activity-timeline-content {
  gap: 6px;
}

.activity-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.activity-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 9px;
  white-space: nowrap;
}

.activity-type-badge[data-activity-type="like"] {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 26%, var(--line));
  color: #137047;
}

.activity-type-badge[data-activity-type="dislike"] {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
  color: #a53939;
}

.activity-type-badge[data-activity-type="bookmark"] {
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
  color: #8a5a00;
}

.activity-visual-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.activity-insight-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.activity-insight-header h2 {
  margin: 0;
  color: var(--color-text-strong);
  font-size: 18px;
  line-height: 1.3;
}

.activity-category-summary,
.activity-type-summary {
  min-width: 0;
}

.activity-category-list,
.activity-type-summary-list {
  display: grid;
  gap: 10px;
}

.activity-category-item,
.activity-type-summary-item,
.activity-insight-skeleton {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 12px;
}

.activity-category-header,
.activity-type-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-category-header {
  justify-content: space-between;
  margin-bottom: 10px;
}

.activity-category-count {
  flex: 0 0 auto;
  color: var(--color-text-strong);
  font-size: 13px;
  font-weight: 900;
}

.activity-category-meter {
  display: block;
  overflow: hidden;
  height: 7px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.activity-category-meter span {
  display: block;
  width: var(--activity-rate, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
}

.activity-type-summary-body {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}

.activity-type-summary-body strong {
  color: var(--color-text-strong);
  font-size: 14px;
}

.activity-type-summary-body span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.recent-activity-description,
.recent-activity-date,
.activity-empty {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.activity-empty {
  margin: 0;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px;
  text-align: center;
}

html[data-theme="dark"] .activity-timeline-marker {
  border-color: var(--surface-soft);
  box-shadow: 0 0 0 1px var(--color-primary-border);
}

html[data-theme="dark"] .activity-type-badge {
  color: #dbeafe;
}

html[data-theme="dark"] .activity-type-badge[data-activity-type="like"] {
  color: #b9f6d7;
}

html[data-theme="dark"] .activity-type-badge[data-activity-type="dislike"] {
  color: #fecaca;
}

html[data-theme="dark"] .activity-type-badge[data-activity-type="bookmark"] {
  color: #fde68a;
}

html[data-theme="dark"] .activity-insight-card,
html[data-theme="dark"] .activity-category-item,
html[data-theme="dark"] .activity-type-summary-item,
html[data-theme="dark"] .activity-insight-skeleton {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="dark"] .activity-category-item,
html[data-theme="dark"] .activity-type-summary-item,
html[data-theme="dark"] .activity-insight-skeleton {
  background: var(--surface-soft);
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.profile-list div {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px;
  transition:
    border-color var(--motion-base),
    box-shadow var(--motion-base),
    transform var(--motion-base);
}

.profile-list div:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.profile-list dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

html[data-theme="dark"] .profile-list dt,
html[data-theme="dark"] .comment-header span,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .auth-status {
  color: var(--muted);
}

.profile-list dd {
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 800;
}

.nickname-form {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 10px;
  margin-top: 16px;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.mypage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.mypage-tabs button {
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  color: var(--primary-dark);
}

html[data-theme="dark"] .mypage-tabs button {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: #dbeafe;
}

.mypage-tabs button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.inline-filter {
  max-width: 260px;
  margin-bottom: 14px;
}

.activity-item p {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.activity-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-item a {
  color: var(--primary);
  font-weight: 800;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.activity-item a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.toast-container {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 1000;
  display: grid;
  gap: var(--space-3);
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, var(--primary-soft));
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  padding: 13px 14px;
  pointer-events: auto;
  animation: toast-in var(--motion-base) ease both;
}

.toast.is-hiding {
  animation: toast-out var(--motion-fast) ease both;
}

.toast-message {
  overflow-wrap: anywhere;
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.toast-close:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  box-shadow: none;
  color: var(--text);
  transform: none;
}

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

.toast-error {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--surface) 90%, var(--danger-soft));
}

.toast-info {
  border-left-color: var(--primary);
}

.toast-warning {
  border-left-color: var(--color-warning);
  background: color-mix(in srgb, var(--surface) 88%, var(--color-warning-soft));
}

html[data-theme="dark"] .toast {
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-soft));
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

html[data-theme="dark"] .toast-error {
  background: color-mix(in srgb, var(--surface) 82%, var(--danger-soft));
}

html[data-theme="dark"] .toast-warning {
  background: color-mix(in srgb, var(--surface) 82%, var(--color-warning-soft));
}

html[data-theme="dark"] .toast-close:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  animation: modal-fade-in var(--motion-fast) ease both;
}

.confirm-modal {
  display: grid;
  gap: 18px;
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  padding: 22px;
  animation: modal-pop-in var(--motion-base) ease both;
}

html[data-theme="dark"] .confirm-modal {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.confirm-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.confirm-modal-title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: 20px;
  line-height: 1.25;
}

.confirm-modal-message {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.confirm-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  box-shadow: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.confirm-modal-close:hover {
  border-color: var(--line-strong);
  background: var(--primary-soft);
  box-shadow: none;
  color: var(--text);
  transform: none;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.confirm-modal-cancel {
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--text);
}

.confirm-modal-cancel:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.confirm-modal-confirm-danger {
  background: var(--danger);
  color: var(--color-on-primary);
}

.confirm-modal-confirm-danger:hover {
  background: var(--color-danger-hover);
  box-shadow: var(--shadow-danger);
}

html[data-theme="dark"] .confirm-modal-close,
html[data-theme="dark"] .confirm-modal-cancel {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--text);
}

html[data-theme="dark"] .confirm-modal-confirm-danger {
  background: var(--danger);
  color: #ffffff;
}

html[data-theme="dark"] .confirm-modal-confirm-danger:hover {
  background: var(--color-danger-hover);
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.site-footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0 30px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.footer-title {
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  font-weight: 800;
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-links span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.footer-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(20, 48, 86, 0.08);
  color: var(--primary-dark);
  font-weight: 800;
  padding: 7px 12px;
  white-space: nowrap;
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.footer-portal:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 12px 24px rgba(21, 91, 181, 0.16);
  transform: translateY(-2px);
}

.footer-github {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(20, 48, 86, 0.08);
  color: var(--primary-dark);
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.footer-github svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  transition: transform var(--motion-fast);
}

.footer-github::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  border-radius: 6px;
  background: #101827;
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  padding: 5px 8px;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition:
    opacity var(--motion-fast),
    transform var(--motion-fast);
  white-space: nowrap;
}

.footer-github:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 12px 24px rgba(21, 91, 181, 0.16);
  transform: translateY(-2px) scale(1.04);
}

.footer-github:focus-visible {
  outline: 3px solid rgba(21, 91, 181, 0.2);
  outline-offset: 3px;
}

.footer-github:hover svg,
.footer-github:focus-visible svg {
  transform: scale(1.12);
}

.footer-github:hover::after,
.footer-github:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

html[data-theme="dark"] .footer-title {
  color: #d5dfef;
}

html[data-theme="dark"] .footer-github {
  background: #1d2a42;
  border-color: #455d7d;
  color: #dbeafe;
}

html[data-theme="dark"] .footer-portal {
  background: #1d2a42;
  border-color: #455d7d;
  color: #dbeafe;
}

html[data-theme="dark"] .footer-portal:hover {
  background: #263b5d;
  border-color: #6c9add;
  color: #ffffff;
}

html[data-theme="dark"] .footer-github:hover {
  background: #263b5d;
  border-color: #6c9add;
  color: #ffffff;
}

html[data-theme="dark"] .footer-github::after {
  background: #edf3fb;
  color: #101827;
}

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
}

.guide-highlight {
  position: relative;
  z-index: 1002 !important;
  border-radius: 8px;
  box-shadow:
    0 0 0 4px rgba(91, 157, 255, 0.36),
    0 18px 42px rgba(15, 23, 42, 0.24) !important;
  pointer-events: none;
}

.guide-popover {
  position: fixed;
  z-index: 1003;
  border: 1px solid #b9cbe6;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
  color: var(--text);
  padding: 18px;
}

.guide-popover h2 {
  margin: 0 0 8px;
  color: #10213b;
  font-size: 19px;
}

.guide-popover p {
  margin: 0;
}

.guide-popover .guide-step-count {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.guide-actions button {
  min-height: 36px;
  padding: 8px 12px;
}

.guide-actions .guide-secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.guide-actions .guide-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

html[data-theme="dark"] .guide-overlay {
  background: rgba(2, 6, 23, 0.68);
}

html[data-theme="dark"] .guide-popover {
  border-color: #516989;
  background: #182236;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .guide-popover h2 {
  color: #f3f7ff;
}

html[data-theme="dark"] .guide-popover .guide-step-count {
  color: #b9d6ff;
}

html[data-theme="dark"] .guide-actions .guide-secondary {
  background: #22314b;
  border-color: #557093;
  color: #dbeafe;
}

html[data-theme="dark"] .guide-actions .guide-secondary:hover {
  background: #263b5d;
  border-color: #6c9add;
  color: #ffffff;
}

@media (max-width: 840px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .toolbar,
  .toolbar form,
  .community-hero,
  .dashboard-preview-grid,
  .recommendation-grid,
  .board-shortcuts,
  .nickname-form,
  .profile-list,
  .activity-visual-section,
  .activity-stats-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    width: 100%;
  }

  .page {
    width: min(100% - 24px, 1180px);
    margin: 24px auto;
  }
}

@media (max-width: 640px) {
  .page-title h1 {
    font-size: 25px;
  }

  .panel,
  .form-panel,
  .toolbar {
    padding: 16px;
  }

  .post-table {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .site-header {
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }

  .brand {
    align-self: flex-start;
    max-width: 100%;
    font-size: 18px;
  }

  .brand-text {
    gap: 4px;
  }

  .nav-links {
    align-items: stretch;
    gap: 8px;
  }

  .nav-links > * {
    max-width: 100%;
  }

  .nav-links a,
  .link-button {
    flex: 1 1 auto;
    min-height: 38px;
    text-align: center;
  }

  .auth-status {
    flex: 1 0 100%;
  }

  .page {
    width: min(100% - 20px, 1180px);
    margin: 20px auto;
  }

  .page-title {
    margin-bottom: 16px;
  }

  .community-hero-copy {
    min-height: auto;
    padding: 22px;
  }

  .community-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 104px;
    padding: 16px;
  }

  .page-title h1 {
    overflow-wrap: anywhere;
  }

  .current-board,
  .help-button {
    margin-top: 10px;
  }

  .shortcut-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-shortcut {
    display: grid;
    min-height: 72px;
    text-align: center;
  }

  .shortcut-desc {
    font-size: 11px;
  }

  .toolbar label,
  .toolbar form label {
    min-width: 0;
  }

  .write-tabs {
    width: 100%;
  }

  .write-tab {
    flex: 1 1 0;
  }

  .write-guide-card,
  .draft-box,
  .preview-panel {
    padding: 16px;
  }

  .draft-box {
    grid-template-columns: 1fr;
  }

  .draft-actions {
    justify-content: stretch;
  }

  .draft-actions button {
    flex: 1 1 auto;
  }

  .toolbar form button {
    width: 100%;
  }

  .toolbar form .search-clear-button {
    width: 28px;
  }

  .toolbar form .recent-search-chip,
  .toolbar form .recent-search-clear {
    width: auto;
  }

  .list-summary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-summary,
  .view-mode-toggle {
    width: 100%;
  }

  .view-mode-button {
    flex: 1 1 0;
  }

  .panel,
  .form-panel,
  .toolbar,
  .shortcut-group {
    padding: 16px;
  }

  .profile-summary-card {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 18px;
  }

  .profile-summary-meta {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .activity-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recent-activity-panel {
    padding: 16px;
  }

  .activity-insight-card {
    padding: 16px;
  }

  .activity-category-header,
  .activity-type-summary-item {
    align-items: flex-start;
  }

  .post-list-panel:not(.is-table-view) .post-table {
    display: none;
  }

  .post-list-panel:not(.is-table-view) .post-card-list,
  .post-list-panel.is-card-view .post-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .post-list-panel.is-table-view {
    overflow-x: auto;
  }

  .post-list-panel.is-table-view .post-table {
    display: table;
  }

  .post-list-panel.is-table-view .post-card-list {
    display: none;
  }

  .post-table {
    min-width: 760px;
    font-size: 13px;
  }

  .post-table th,
  .post-table td {
    padding: 10px 8px;
  }

  .post-table td:first-child {
    max-width: 230px;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .actions {
    align-items: stretch;
  }

  .actions button {
    flex: 1 1 calc(50% - 8px);
  }

  .actions .meta {
    justify-content: center;
  }

  .post-detail-card {
    gap: 14px;
  }

  .post-detail-header {
    gap: 10px;
    padding-bottom: 14px;
  }

  .post-detail-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .post-detail-meta-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .post-detail-meta-item {
    justify-content: space-between;
    border-radius: var(--radius-md);
  }

  .post-detail-meta-row.is-profile .post-detail-meta-item {
    justify-content: flex-start;
  }

  .post-detail-body {
    min-height: 140px;
    font-size: 16px;
    line-height: 1.72;
    padding: 18px;
  }

  .post-detail-actions,
  .reaction-actions,
  .detail-jump-actions,
  .owner-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .reaction-actions button,
  .detail-jump-actions button,
  .owner-actions button,
  .reaction-actions .meta {
    width: 100%;
  }

  .back-to-top-button {
    right: 16px;
    bottom: 16px;
    min-height: 40px;
    padding: 9px 12px;
  }

  .comment-panel-header {
    display: grid;
    gap: 8px;
  }

  .reply-list,
  .reply-form {
    margin-left: 8px;
    padding-left: 10px;
  }

  .comment-edit-form {
    padding: 10px;
  }

  .preview-panel-header,
  .recent-viewed-panel .preview-panel-header {
    display: grid;
    gap: 6px;
  }

  .comment-header {
    align-items: stretch;
    display: grid;
  }

  .comment-actions {
    justify-content: stretch;
  }

  .inline-actions button,
  .comment-form button,
  .reply-form button,
  .comment-actions button,
  .comment-edit-form button {
    flex: 1 1 auto;
  }

  .nickname-form,
  .profile-list,
  .activity-stats-grid {
    grid-template-columns: 1fr;
  }

  .inline-filter {
    max-width: none;
  }

  .mypage-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .mypage-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .site-footer {
    width: min(100% - 20px, 1180px);
    padding-bottom: 24px;
  }

  .footer-meta {
    align-items: center;
    gap: 8px;
  }

  .footer-links {
    gap: 7px;
  }

  .toast-container {
    right: 10px;
    bottom: 12px;
    width: calc(100vw - 20px);
  }

  .toast {
    border-radius: var(--radius-md);
    font-size: 13px;
    padding: 12px;
  }

  .modal-overlay {
    align-items: end;
    padding: 12px;
  }

  .confirm-modal {
    gap: 14px;
    padding: 18px;
  }

  .confirm-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .floating-write-button {
    display: inline-flex;
  }
}

@media (max-width: 480px) {
  .brand {
    gap: 8px;
    padding: 5px 8px 5px 6px;
    font-size: 17px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .brand-mark::after {
    right: 5px;
    bottom: 5px;
    width: 6px;
    height: 6px;
  }

  .nav-links a,
  .link-button,
  button {
    font-size: 14px;
    padding: 8px 10px;
  }

  .floating-write-button {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    min-width: 108px;
    min-height: 48px;
    padding: 12px 15px;
  }

  .shortcut-links {
    grid-template-columns: 1fr;
  }

  .community-metrics {
    grid-template-columns: 1fr;
  }

  .community-hero-copy {
    padding: 20px;
  }

  .metric-card {
    min-height: 92px;
  }

  .actions button {
    flex-basis: 100%;
  }

  .pagination {
    flex-wrap: wrap;
  }

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

  .write-guide-card,
  .draft-box,
  .preview-panel,
  .preview-body {
    padding: 14px;
  }

  .draft-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .post-table {
    min-width: 700px;
  }

  .post-card {
    gap: 9px;
    padding: 14px;
  }

  .post-card-title {
    font-size: 16px;
  }

  .post-card-stat {
    padding: 6px 8px;
  }

  .post-detail-body {
    padding: 16px;
  }

  .comment-composer,
  .reply-form,
  .comment-edit-form {
    padding: 12px;
  }

  .profile-avatar {
    width: 54px;
    height: 54px;
  }

  .profile-summary-card h2,
  .recent-activity-panel h2 {
    font-size: 19px;
  }

  .recent-activity-header {
    display: grid;
  }

  .recent-activity-item {
    grid-template-columns: 1fr;
  }

  .footer-meta {
    flex-direction: column;
  }

  .footer-links {
    flex-direction: column;
  }

  .toast-container {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .confirm-modal-actions {
    grid-template-columns: 1fr;
  }

  .confirm-modal-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .button-link:hover,
  button:hover,
  .nav-links a:hover,
  .link-button:hover,
  .board-shortcut:hover,
  .shortcut-group:hover,
  .toolbar:hover,
  .panel:hover,
  .form-panel:hover,
  .comment-item:hover,
  .activity-item:hover,
  .profile-list div:hover,
  .activity-stat-card:hover,
  .recent-activity-item:hover,
  .category-chip:hover,
  .category-badge:hover,
  .anonymous-badge:hover,
  .reply-badge:hover,
  .edited-badge:hover,
  .back-to-top-button:hover,
  .floating-write-button:hover {
    transform: none;
  }

  .footer-github:hover,
  .footer-portal:hover,
  .footer-github:hover svg,
  .footer-github:hover::after,
  .footer-github:focus-visible svg,
  .footer-github:focus-visible::after {
    transform: none;
  }

  .toast,
  .toast.is-hiding {
    animation: none;
  }

  .modal-overlay,
  .confirm-modal {
    animation: none;
  }

  .loading-spinner,
  .button-spinner,
  .skeleton::after,
  .reading-progress span {
    animation: none;
    transition: none;
  }
}
