:root {
  font-family:
    "Segoe UI Variable",
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: #172b3a;
  background: #f6f8fb;
  font-synthesis: none;
  --ink: #172b3a;
  --muted: #607080;
  --paper: #fff;
  --canvas: #f6f8fb;
  --accent: #2457d6;
  --accent-soft: #eef3ff;
  --line: #e0e6ee;
  --green: #18755b;
  --red: #b83939;
  --radius: 14px;
  --shadow: 0 16px 60px #102b4d12;
  color-scheme: light;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button {
  color: inherit;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
svg {
  vertical-align: middle;
  flex-shrink: 0;
}
img {
  max-width: 100%;
  display: block;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-weight: 700;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
  font-weight: 650;
}
h3 {
  font-size: 1.04rem;
  font-weight: 650;
}
p {
  line-height: 1.6;
}
small {
  font-size: 0.82rem;
}
input,
select,
textarea {
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9d3df;
  border-radius: 9px;
  padding: 10px 12px;
  min-height: 46px;
  width: 100%;
  max-width: 100%;
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: var(--accent);
}
input[type="color"] {
  padding: 5px;
  width: 64px;
}
input[type="file"] {
  padding: 9px;
  font-size: 0.875rem;
}
textarea {
  resize: vertical;
  min-height: 98px;
}
input::placeholder,
textarea::placeholder {
  color: #758292;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
:focus-visible {
  outline: 3px solid #2457d65c;
  outline-offset: 3px;
}
input[readonly] {
  background: #f4f6fa;
}
input:invalid:not(:placeholder-shown):not(:focus) {
  box-shadow: none;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  transition:
    background 0.15s,
    border-color 0.15s;
  white-space: normal;
}
.button:hover {
  background: #f0f3f8;
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button.primary:hover {
  filter: brightness(0.94);
}
.button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.button.danger {
  background: #fff2f1;
  color: var(--red);
  border-color: #f0cecb;
}
.button.ghost {
  border-color: transparent;
  background: transparent;
}
.button.icon-button {
  width: 44px;
  padding: 10px;
  flex-shrink: 0;
}
.button.small {
  padding: 7px 12px;
  font-size: 0.875rem;
  min-height: 40px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field > span,
.field > label {
  font-weight: 600;
  font-size: 0.9rem;
}
.field small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  min-height: 52px;
}
.switch > span:first-child {
  min-width: 0;
}
.switch strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}
.switch small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 25px;
  min-height: 25px;
  border: 0;
  border-radius: 99px;
  padding: 3px;
  background: #a7b3c2;
  flex-shrink: 0;
  transition: background 0.15s;
}
.switch input::before {
  content: "";
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0002;
  transition: transform 0.15s;
}
.switch input:checked {
  background: var(--accent);
}
.switch input:checked::before {
  transform: translateX(17px);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  max-width: 100%;
  border-radius: 7px;
  background: #edf1f7;
  color: #506478;
  font-size: 0.77rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}
.badge.green {
  color: #12624b;
  background: #e7f5ef;
}
.badge.blue {
  color: #244eb9;
  background: #edf2ff;
}
.badge.amber {
  color: #875000;
  background: #fff2d9;
}
.badge.red {
  color: #a72f2f;
  background: #fff0ef;
}
.muted {
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 55px 22px;
  color: var(--muted);
}
.empty svg {
  display: block;
  margin: 0 auto 18px;
  color: #7b91a7;
}
.empty h2,
.empty h3 {
  color: var(--ink);
  margin-bottom: 8px;
}
.empty p {
  max-width: 440px;
  margin: 0 auto 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.toast-region {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  right: 24px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  pointer-events: none;
  max-width: min(430px, calc(100vw - 32px));
}
.toast {
  padding: 14px 18px;
  background: #173f36;
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.93rem;
  overflow-wrap: anywhere;
}
.toast-error {
  background: #873232;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  max-width: calc(100vw - 24px);
  color: var(--ink);
  box-shadow: 0 24px 100px #102b4d33;
}
dialog::backdrop {
  background: #132a4666;
  backdrop-filter: blur(3px);
}
[hidden] {
  display: none !important;
}
button[aria-busy="true"] {
  opacity: 0.65;
  cursor: wait;
}
.form-error {
  color: #a42e2e;
  background: #fff2f1;
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 0.9rem;
}
.form-error:empty {
  display: none;
}
progress {
  accent-color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media (max-width: 600px) {
  .toast-region {
    left: 16px;
    right: 16px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    max-width: none;
  }
  .button {
    padding: 10px 14px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
}
