:root {
  color-scheme: dark;
  --background: #101114;
  --surface: #1b1d22;
  --ink: #f2f3f7;
  --muted: #a4a8b5;
  --border: #2d3038;
  --accent: #b491ed;
  --accent-hover: #c3a4f5;
  --soft-accent: #282132;
  --success: #85d7ab;
  --danger: #f4a5b1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-size: 15px; line-height: 1.55; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(29px, 3.4vw, 40px); line-height: 1.2; font-weight: 650; letter-spacing: -1.3px; }
h2 { font-size: 19px; line-height: 1.35; font-weight: 650; letter-spacing: -.35px; }
h3 { font-size: 15px; font-weight: 650; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #aaa6ff; outline-offset: 3px; }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.65px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 19px; font-weight: 750; letter-spacing: -.5px; }
.brand-light { font-weight: 450; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; background: var(--accent); color: white; border-radius: 10px; font-size: 23px; line-height: 1; font-weight: 700; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 19px 36px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.owner-label { color: var(--muted); font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 42px; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: 13px; transition: background .15s; }
.button-primary { background: var(--accent); color: #1d152d; box-shadow: none; }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-quiet { background: transparent; border-color: var(--border); color: var(--muted); min-height: 34px; padding: 6px 12px; font-size: 12px; }
.button-quiet:hover:not(:disabled) { background: var(--background); }
.button-full { width: 100%; justify-content: space-between; }
.settings-layout { max-width: 1200px; padding: 42px 36px 24px; margin: 0 auto; }
.page-heading { margin-bottom: 30px; }
.page-heading .eyebrow { margin-bottom: 12px; }
.page-description { color: var(--muted); max-width: 660px; margin-top: 13px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 3px 12px #1c234003; }
.panel-heading { padding: 25px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 13px; }
.panel-heading .muted { margin-top: 3px; }
.integration-logo { width: 40px; height: 40px; display: grid; place-items: center; color: #176de0; background: #edf5ff; border-radius: 11px; font-size: 30px; font-weight: 600; line-height: 1; font-style: italic; font-family: Georgia, serif; }
.badge { margin-left: auto; display: inline-flex; align-items: center; border-radius: 5px; padding: 5px 8px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.badge-neutral { background: #282a31; color: var(--muted); }
.badge-saved { background: #1c3328; color: var(--success); }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.form-section { padding: 25px 28px; border-bottom: 1px solid var(--border); }
.section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.section-heading .muted { margin-top: 2px; font-size: 12px; }
.step-number { width: 28px; height: 28px; display: grid; place-items: center; background: var(--soft-accent); color: var(--accent); border-radius: 8px; font-size: 11px; font-weight: 650; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field-group { min-width: 0; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.optional { color: var(--muted); font-weight: 400; margin-left: 4px; font-size: 10px; }
input { display: block; width: 100%; min-height: 43px; border: 1px solid var(--border); border-radius: 7px; background: #111216; color: var(--ink); padding: 10px 12px; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: #8b91a4; font-size: 12px; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #5550dc13; }
input:disabled { background: #25272f; color: var(--muted); }
.field-help { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.token-group + .token-group { margin-top: 23px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.token-state { color: var(--muted); font-size: 10px; }
.token-state.is-saved { color: var(--success); }
.token-state.is-pending { color: var(--danger); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 80px; }
.password-toggle { position: absolute; right: 5px; top: 5px; height: 33px; padding: 0 9px; background: transparent; border: 0; border-radius: 4px; color: var(--muted); font-size: 11px; }
.password-toggle:hover { background: var(--background); }
.field-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.field-bottom .field-help { flex: 1; }
.text-button { padding: 0; border: 0; background: transparent; font-size: 10px; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.danger-text { color: var(--danger); }
.shared-token-note { font-size: 11px; color: var(--muted); background: #22242b; border-radius: 7px; padding: 11px 13px; margin-top: 23px; }
.save-bar { padding: 21px 28px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.save-bar .field-help { margin-top: 0; max-width: 245px; }
.notice { border-radius: 8px; padding: 12px 15px; margin-bottom: 20px; font-size: 12px; }
.notice-error { color: var(--danger); background: #302027; border: 1px solid #613442; }
.notice-success { color: var(--success); background: #1c3026; border: 1px solid #355442; }
.notice-info { color: #c2cce1; background: #18212f; border: 1px solid #2d4567; }
#save-feedback { margin: 0 28px 23px; }
.status-column { display: grid; gap: 20px; }
.status-panel { padding: 24px; }
.status-panel h2 { margin-top: 10px; font-size: 19px; }
.local-status { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--success); margin-top: 14px; }
.status-dot { width: 6px; height: 6px; background: #24a17f; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-list { padding: 0; margin: 23px 0 17px; }
.status-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; font-weight: 600; text-align: right; }
.delivery-note { padding: 23px 24px; background: var(--soft-accent); border: 1px solid #463753; border-radius: 13px; }
.note-mark { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #c1bdf6; color: var(--accent); border-radius: 50%; font-family: Georgia, serif; font-style: italic; font-size: 14px; margin-bottom: 15px; }
.delivery-note h2 { font-size: 15px; }
.delivery-note p { color: #bcb2c7; font-size: 12px; margin-top: 12px; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; font-size: 10px; color: #8a8fa0; }
.skip-link { position: absolute; left: -9999px; top: 0; padding: 10px; background: #282a31; color: var(--ink); z-index: 5; }
.skip-link:focus { left: 10px; top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.login-layout { min-height: 100dvh; display: grid; grid-template-columns: .9fr 1.1fr; }
.login-intro { background: #1b1922; color: white; display: flex; flex-direction: column; align-items: flex-start; padding: 44px clamp(36px, 6vw, 90px); }
.login-intro .brand-mark { background: #7974f7; }
.intro-copy { margin: auto 0; padding: 90px 0; }
.intro-copy .eyebrow { color: #aba8e7; margin-bottom: 18px; }
.intro-copy h1 { font-size: clamp(36px, 4.2vw, 58px); line-height: 1.13; font-weight: 600; letter-spacing: -2px; }
.intro-description { max-width: 340px; margin-top: 23px; color: #bfc3da; font-size: 15px; }
.intro-footer { display: flex; align-items: center; gap: 8px; color: #bfc3da; font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: 60px 35px; background: #141519; }
.login-card { width: 100%; max-width: 360px; }
.login-card .eyebrow { margin-bottom: 12px; }
.login-card h2 { font-size: 27px; letter-spacing: -.8px; }
.login-card > .muted { margin-top: 12px; font-size: 14px; }
.login-card form { margin-top: 30px; }
.login-card label { font-size: 13px; }
.login-card input { min-height: 47px; }
.login-card .button { margin-top: 23px; min-height: 45px; }
#login-error { margin: 16px 0 0; }
.login-footnote { color: #858b9e; font-size: 11px; margin-top: 23px; line-height: 1.6; }
@media (max-width: 1000px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
  .settings-layout, .topbar-inner { padding-left: 24px; padding-right: 24px; }
  .panel-heading, .form-section { padding-left: 22px; padding-right: 22px; }
  .panel-heading { flex-wrap: wrap; }
  .badge { margin-left: 53px; }
  .field-row { grid-template-columns: 1fr; }
  .save-bar { flex-wrap: wrap; padding-left: 22px; padding-right: 22px; }
  .status-panel, .delivery-note { padding: 20px; }
}
@media (max-width: 760px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-layout { padding-top: 28px; }
  .status-column { grid-template-columns: 1fr 1fr; }
  .panel-heading { flex-wrap: nowrap; }
  .badge { margin-left: auto; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { padding: 25px 30px; }
  .intro-copy { padding: 40px 0 18px; }
  .intro-copy h1 { font-size: 38px; }
  .intro-description { margin-top: 15px; }
  .intro-footer { display: none; }
  .login-panel { padding: 36px 28px 50px; }
}
@media (max-width: 480px) {
  .topbar-inner { padding: 16px; }
  .owner-label { display: none; }
  .settings-layout { padding: 27px 16px 20px; }
  .page-description { font-size: 13px; }
  .panel-heading, .form-section { padding: 22px 18px; }
  .panel-heading { gap: 10px; flex-wrap: wrap; }
  .panel-heading h2 { font-size: 17px; }
  .badge { margin-left: 50px; }
  .field-row, .status-column { grid-template-columns: 1fr; }
  .field-bottom { flex-wrap: wrap; gap: 3px; }
  .field-bottom .field-help { flex-basis: 100%; }
  .save-bar { padding: 19px 18px; }
  .save-bar .button { width: 100%; }
  #save-feedback { margin-left: 18px; margin-right: 18px; }
  .page-footer { flex-wrap: wrap; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
