/* Shared visual language. Page styles own layout, these tokens own appearance. */
:root {
  color-scheme: light;
  --ink: #202b3b;
  --muted: #647184;
  --line: #e0e5eb;
  --control-line: #8793a5;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --sidebar: #f9fafc;
  --hover: #edf1f6;
  --blue: #365dcc;
  --blue-soft: #edf2ff;
  --soft: var(--blue-soft);
  --action: #365dcc;
  --action-hover: #294bac;
  --danger: #b13434;
  --danger-soft: #fff0ef;
  --success: #22734d;
  --success-soft: #edf7f1;
  --shadow: 0 4px 20px #22304a08;
  --shadow-float: 0 16px 48px #15233f20;
  --radius: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR",
    "Malgun Gothic", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7ecf4;
  --muted: #a4afc1;
  --line: #303b4e;
  --control-line: #68768c;
  --bg: #111722;
  --panel: #192231;
  --sidebar: #151d2a;
  --hover: #253247;
  --blue: #a0b8ff;
  --blue-soft: #253454;
  --action: #4167da;
  --action-hover: #5279ed;
  --danger: #ffaaa3;
  --danger-soft: #40272b;
  --success: #8ad8b0;
  --success-soft: #1b352e;
  --shadow: 0 4px 20px #00000015;
  --shadow-float: 0 16px 48px #00000055;
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button,
a {
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
input,
select,
textarea {
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
::selection {
  background: var(--blue-soft);
  color: var(--ink);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--panel);
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: translateY(0);
}
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--action);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
}
.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.button:hover:not(:disabled) {
  background: var(--hover);
}
.button.primary {
  background: var(--action);
  border-color: var(--action);
  color: #fff;
}
.button.primary:hover:not(:disabled) {
  background: var(--action-hover);
}
.button.danger {
  color: var(--danger);
  background: var(--danger-soft);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}
.icon-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--ink);
}
.icon-btn svg,
.ui-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--control-line);
  border-radius: 9px;
  background: var(--panel);
  font-weight: 400;
}
.field input:hover,
.field select:hover {
  border-color: var(--muted);
}
.field input:focus,
.field select:focus {
  border-color: var(--blue);
}
.field small {
  color: var(--muted);
  font-weight: 400;
}
.status {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.status.error,
.status[data-tone="error"] {
  color: var(--danger);
}
.status[data-tone="success"] {
  color: var(--success);
}
.ui-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}
.ui-dialog::backdrop {
  background: #10182788;
}
.ui-dialog h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.ui-dialog p {
  margin: 0 0 20px;
  color: var(--muted);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
