:root{
  --bg0:#f3f4f6;
  --bg1:#ffffff;
  --ring:#2563eb;
  --ring2:#22c55e;
  --text:#111827;
  --muted:#6b7280;
  --stroke:#e5e7eb;
  --shadow:0 18px 45px rgba(15,23,42,.16);
  --toolbar-bg:linear-gradient(145deg, rgba(255,255,255,0.98) 0%, rgba(249,250,251,0.96) 50%, rgba(243,244,246,0.9) 100%);
  --toolbar-blur:blur(18px) saturate(1.35);
  --input-bg:#ffffff;
  --toolbar-total: 88px;
  --radius: 14px;
  --tile-radius: 18px;
  --btn-h: 34px;
  --btn-r: 999px;
  --tap-gap: .5rem;
}

html,body{
  height:100%;
}

body{
  margin:0;
  color:var(--text);
  font-family:Inter, system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,ui-sans-serif;
  background:
    radial-gradient(800px 520px at 0% 0%, #dbeafe 0%, transparent 55%),
    radial-gradient(900px 580px at 100% 0%, #fee2e2 0%, transparent 55%),
    linear-gradient(180deg,#f9fafb 0%, #f3f4f6 50%, #eef2f7 100%);
  background-attachment:fixed;
}

.sj-toolbar{
  position:fixed;
  inset:0 0 auto 0;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  grid-template-rows:auto auto;
  gap:.4rem .5rem;
  align-items:center;
  padding: calc(env(safe-area-inset-top, 0px) + .45rem) 1rem .65rem;
  z-index:1000;
  backdrop-filter:var(--toolbar-blur);
  -webkit-backdrop-filter:var(--toolbar-blur);
  background:var(--toolbar-bg);
  border-bottom:1px solid rgba(229,231,235,0.9);
  box-shadow:0 12px 35px rgba(15,23,42,.18);
  transition: transform .22s ease, opacity .18s ease, box-shadow .22s ease, background .22s ease;
}

.sj-nav{
  display:flex;
  gap:var(--tap-gap);
  align-items:center;
}

.sj-brand{
  display:flex;
  gap:.7rem;
  align-items:center;
  justify-content:center;
  min-width:0;
}

.sj-brand img.logo{
  height:30px;
  width:30px;
  object-fit:contain;
  border-radius:10px;
  box-shadow:0 10px 30px rgba(15,23,42,.35);
}

.brand-text{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.sj-brand h1{
  margin:0;
  font-size:clamp(1rem, 1.15vw, 1.12rem);
  font-weight:700;
  letter-spacing:.02em;
  color:var(--text);
}

.sj-right{
  display:flex;
  align-items:center;
  gap:.45rem;
  justify-content:flex-end;
}

.sj-btn{
  height:var(--btn-h);
  min-width:var(--btn-h);
  display:inline-grid;
  place-items:center;
  padding:0 14px;
  border-radius:var(--btn-r);
  border:1px solid rgba(148,163,184,.65);
  background:linear-gradient(145deg,#f9fafb,#eef2ff);
  color:var(--text);
  cursor:pointer;
  transition:
    transform .07s ease,
    background .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    filter .15s ease;
  box-shadow:0 8px 22px rgba(15,23,42,.15);
  font-size:13px;
  font-weight:500;
}

.sj-btn .fa{
  font-size:14px;
}

.sj-btn[disabled]{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
  filter:saturate(.4);
}

.sj-btn:hover:not([disabled]){
  background:linear-gradient(145deg,#eef2ff,#e5f0ff);
  border-color:rgba(129,140,248,.9);
  box-shadow:0 10px 26px rgba(15,23,42,.16);
}

.sj-btn:active:not([disabled]){
  transform:translateY(1px) scale(.985);
  box-shadow:0 6px 18px rgba(15,23,42,.18);
}

.sj-btn:focus-visible{
  outline:none;
  box-shadow:0 0 0 1px var(--ring),0 0 0 4px rgba(37,99,235,.25);
  border-color:var(--ring);
}

#sj-form{
  grid-column:1/4;
  display:flex;
  gap:.55rem;
  width:100%;
  margin:0;
  position:relative;
}

.sj-addr-wrap{
  display:grid;
  grid-template-columns:26px 1fr 40px;
  align-items:center;
  gap:.45rem;
  width:100%;
  border:1px solid var(--stroke);
  background:var(--input-bg);
  border-radius:999px;
  height:46px;
  padding:0 .85rem;
  box-shadow:0 14px 35px rgba(15,23,42,.18);
  position:relative;
}

.scheme-dot{
  width:13px;
  height:13px;
  border-radius:50%;
  justify-self:center;
  background:#fbbf24;
  opacity:.98;
  box-shadow:0 0 0 1px rgba(15,23,42,.08),0 0 0 6px rgba(251,191,36,.18);
}

.scheme-dot.secure{
  background:#22c55e;
  box-shadow:0 0 0 1px rgba(15,23,42,.08),0 0 0 6px rgba(34,197,94,.16);
}

#sj-address{
  width:100%;
  height:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  font-size:15px;
  font-family:Inter, ui-sans-serif;
}

#sj-address::placeholder{
  color:#9ca3af;
}

.go-btn{
  height:34px;
  width:34px;
  border-radius:999px;
  border:0;
  background:linear-gradient(135deg,#2563eb,#4f46e5);
  display:grid;
  place-items:center;
  box-shadow:0 10px 24px rgba(37,99,235,.55);
  cursor:pointer;
  transition:transform .09s ease, box-shadow .18s ease, filter .15s ease;
}

.go-btn:hover{
  box-shadow:0 14px 30px rgba(37,99,235,.6);
  filter:brightness(1.03);
}

.go-btn:active{
  transform:translateY(1px) scale(.96);
  box-shadow:0 8px 18px rgba(37,99,235,.6);
}

.go-btn i{
  color:#fff;
  font-size:14px;
}

.ac-panel{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 8px);
  z-index:1001;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  box-shadow:0 26px 70px rgba(15,23,42,.2);
  overflow:hidden;
  display:none;
}

.ac-panel.show{
  display:block;
}

.ac-top-sites{
  padding:10px 12px 8px;
  border-bottom:1px solid #e5e7eb;
  background:#f9fafb;
}

.ac-top-title{
  font-size:11px;
  font-weight:600;
  color:#6b7280;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.ac-top-chips{
  margin-top:5px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.ac-top-chip{
  font-size:11px;
  padding:4px 11px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#ffffff;
  color:#2563eb;
  box-shadow:0 6px 16px rgba(15,23,42,.12);
  display:inline-flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  transition:background .16s ease, border-color .16s ease, transform .08s ease, box-shadow .16s ease;
}

.ac-top-chip:hover{
  background:#eff6ff;
  border-color:#bfdbfe;
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(37,99,235,.18);
}

.ac-top-chip i{
  font-size:11px;
}

.ac-list{
  list-style:none;
  margin:0;
  padding:6px;
  max-height:min(50vh, 380px);
  overflow:auto;
}

.ac-item{
  display:grid;
  grid-template-columns:22px 1fr auto;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  transition:background .12s ease, transform .06s ease;
}

.ac-item:hover{
  background:#f3f4f6;
}

.ac-item[aria-selected="true"]{
  outline:2px solid #2563eb;
  background:#eff6ff;
}

.ac-item i{
  opacity:.95;
  width:22px;
  text-align:center;
  color:#9ca3af;
}

.ac-text{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:14px;
  color:#111827;
}

.ac-sub{
  color:#6b7280;
  font-size:11px;
  padding:2px 7px;
  border:1px solid #e5e7eb;
  border-radius:999px;
  background:#f9fafb;
}

.ac-empty{
  padding:10px 10px;
  color:#9ca3af;
  font-size:13px;
}

#sj-frame{
  position:fixed;
  left:0;
  right:0;
  top:var(--toolbar-total);
  height:calc(100svh - var(--toolbar-total));
  width:100vw;
  border:0;
  display:none;
  background:#fff;
  z-index:1;
}

.sj-landing{
  padding-top:calc(var(--toolbar-total) + 22px);
  max-width:min(1120px, 100% - 24px);
  margin:0 auto;
}

.landing-shell{
  margin-top:18px;
}

.math-hero{
  position:relative;
  display:grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1.3fr);
  gap:22px;
  padding:22px 24px;
  border-radius:22px;
  background:
    radial-gradient(160% 140% at 0% 0%, #dbeafe 0%, transparent 55%),
    radial-gradient(160% 140% at 100% 100%, #fee2e2 0%, transparent 55%),
    #ffffff;
  border:1px solid rgba(229,231,235,.95);
  box-shadow:0 24px 70px rgba(15,23,42,.18);
}

.hero-main h2{
  margin:0;
  font-size:clamp(1.12rem, 2.1vw, 1.4rem);
  font-weight:650;
  display:flex;
  align-items:center;
  gap:9px;
}

.hero-main h2 i{
  color:#2563eb;
}

.hero-main p{
  margin:7px 0 15px;
  color:#6b7280;
  font-size:14px;
}

.hero-side{
  align-self:stretch;
  border-radius:18px;
  border:1px solid rgba(229,231,235,.9);
  background:rgba(248,250,252,.96);
  backdrop-filter:blur(14px);
  padding:13px 15px;
  font-size:13px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.hero-side-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
}

.hero-side-title i{
  color:#f59e0b;
}

.hero-steps{
  margin:4px 0 0 22px;
  padding:0;
  color:#6b7280;
}

.hero-steps li{
  margin:4px 0;
}

.hero-tip{
  margin:4px 0 0;
  color:#6b7280;
  font-size:12px;
}

.hero-tip kbd{
  background:#e5e7eb;
  border-radius:4px;
  padding:2px 6px;
  border:1px solid #d1d5db;
  font-size:11px;
}

.sj-section-title{
  margin:18px 2px 4px;
  font-size:clamp(1rem, 1.9vw, 1.08rem);
  font-weight:650;
}

.shortcuts-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:20px;
}

.shortcuts-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.section-subtitle{
  margin:4px 2px 0;
  font-size:13px;
  color:#6b7280;
}

.chip-btn{
  height:30px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:#f9fafb;
  color:var(--text);
  cursor:pointer;
  box-shadow:0 6px 16px rgba(15,23,42,.12);
  font-size:12px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-weight:500;
  transition:background .16s ease, box-shadow .18s ease, transform .08s ease, border-color .16s ease;
}

.chip-btn:hover{
  background:#eff6ff;
  border-color:#bfdbfe;
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(37,99,235,.18);
}

.sj-shortcuts{
  margin:14px 0 10px;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
}

.sj-shortcut{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  padding:15px 17px;
  border:1px solid rgba(229,231,235,.9);
  border-radius:var(--tile-radius);
  background:linear-gradient(145deg,#ffffff,#f9fafb);
  color:var(--text);
  cursor:pointer;
  box-shadow:0 18px 45px rgba(15,23,42,.16);
  transition:transform .12s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
  text-align:left;
}

.sj-shortcut:hover{
  transform:translateY(-2px) translateZ(0);
  box-shadow:0 24px 60px rgba(15,23,42,.2);
  border-color:#dbeafe;
  background:linear-gradient(145deg,#f9fafb,#eef2ff);
}

.sj-shortcut:active{
  transform:translateY(0);
  box-shadow:0 10px 26px rgba(15,23,42,.2);
}

.sj-shortcut:focus-visible{
  outline:2px solid #2563eb;
  outline-offset:3px;
}

.sj-shortcut .fa-brands,
.sj-shortcut .fa-solid{
  font-size:18px;
  width:22px;
  text-align:center;
  opacity:.98;
  flex:0 0 auto;
  color:#2563eb;
}

.sj-shortcut span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-weight:550;
  font-size:14px;
}

.sj-shortcuts.editing .sj-shortcut{
  position:relative;
  padding-left:54px;
}

.drag-handle{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  width:22px;
  height:24px;
  display:none;
  place-items:center;
  opacity:.9;
  border:1px dashed #d1d5db;
  border-radius:7px;
  font-size:12px;
  cursor:grab;
  user-select:none;
  background:#f9fafb;
}

.sj-shortcuts.editing .drag-handle{
  display:grid;
}

.shortcut-tools{
  margin-left:auto;
  display:none;
  gap:6px;
}

.sj-shortcuts.editing .shortcut-tools{
  display:flex;
}

.tool-btn{
  height:28px;
  min-width:28px;
  display:grid;
  place-items:center;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  border-radius:10px;
  cursor:pointer;
  transition:background .16s ease, transform .08s ease, box-shadow .16s ease;
}

.tool-btn:hover{
  background:#eff6ff;
  box-shadow:0 6px 18px rgba(15,23,42,.16);
  transform:translateY(-1px);
}

.drag-ghost{
  opacity:.4;
  transform:scale(.98);
}

.drag-over{
  outline:2px dashed #2563eb;
  outline-offset:3px;
}

footer{
  max-width:min(1120px, 100% - 24px);
  margin:30px auto 38px;
  padding:12px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  color:#6b7280;
  border-top:1px solid #e5e7eb;
  font-size:13px;
}

footer a{
  color:#2563eb;
  text-decoration:none;
}

footer a:hover{
  text-decoration:underline;
}

#sj-loader{
  position:fixed;
  top:calc(var(--toolbar-total) + 6px);
  right:14px;
  z-index:10;
  padding:7px 11px;
  font-size:12px;
  border-radius:16px;
  border:1px solid #e5e7eb;
  background:#ffffff;
  display:none;
  color:var(--text);
  box-shadow:0 12px 35px rgba(15,23,42,.22);
}

#sj-loader.show{
  display:block;
}

#sj-loading-overlay{
  position:fixed;
  left:0;
  right:0;
  top:var(--toolbar-total);
  bottom:0;
  display:none;
  z-index:100;
  background: rgba(243,244,246,0.96);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
}

#sj-loading-overlay.show{
  display:flex;
}

#sj-loading-overlay .inner{
  margin:auto;
  display:grid;
  gap:14px;
  place-items:center;
  text-align:center;
}

.sj-spinner{
  width:54px;
  height:54px;
  border-radius:50%;
  border:3px solid rgba(229,231,235,1);
  border-top-color:#2563eb;
  border-right-color:#22c55e;
  animation: sjSpin .9s linear infinite;
  box-shadow: 0 0 0 1px rgba(15,23,42,.06) inset;
}

@keyframes sjSpin{
  to{ transform: rotate(360deg); }
}

#sj-loading-overlay .label{
  font: 600 13px/1.2 Inter, ui-sans-serif;
  color:#111827;
  opacity:.9;
  letter-spacing:.2px;
}

.desc p#sj-error{
  color:#dc2626;
}

pre#sj-error-code{
  white-space:pre-wrap;
  background:#f3f4f6;
  padding:10px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  color:#111827;
  overflow:auto;
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:12px;
}

.settings-wrap{
  position:relative;
}

#btn-settings[aria-expanded="true"]{
  box-shadow:0 0 0 1px var(--ring),0 0 0 4px rgba(37,99,235,.25);
  border-color:var(--ring);
}

.settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, 96vw);
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 18px 55px rgba(15,23,42,.2),
    0 4px 12px rgba(15,23,42,.08);
  border: 1px solid rgba(229,231,235,.95);
  padding: 0;
  display: none;
  z-index: 1002;
  animation: gSlide .18s ease-out;
  overflow: hidden;
}

.settings-panel.show{
  display:block;
}

@keyframes gSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.settings-shell{
  display:grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(0, 1.6fr);
  min-height: 220px;
}

.settings-nav{
  border-right:1px solid #edf0f2;
  background:#f9fafb;
  padding:10px 8px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.settings-tab{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 11px;
  border-radius:999px;
  border:1px solid transparent;
  background:transparent;
  cursor:pointer;
  font-size:13px;
  color:#6b7280;
  transition:background .14s ease, border-color .14s ease, color .14s ease, transform .08s ease;
}

.settings-tab i{
  font-size:14px;
  width:18px;
  text-align:center;
}

.settings-tab span{
  white-space:nowrap;
}

.settings-tab:hover{
  background:#e5e7eb;
}

.settings-tab.active{
  background:#eff6ff;
  color:#2563eb;
  border-color:#bfdbfe;
  transform:translateY(-1px);
}

.settings-content{
  padding:10px 0 10px;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.settings-content-head{
  padding:8px 18px 9px;
  border-bottom:1px solid #edf0f2;
}

.settings-content-head h2{
  margin:0;
  font-size:14px;
  font-weight:600;
}

.settings-content-head p{
  margin:4px 0 0;
  font-size:12px;
  color:#6b7280;
}

.settings-section{
  padding:6px 0 0;
}

.settings-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 18px;
}

.settings-row + .settings-row{
  border-top:1px solid #edf0f2;
}

.settings-row small{
  color:#6b7280;
  display:block;
  margin-top:2px;
  font-size:12px;
}

.settings-actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  margin-top:auto;
  padding:10px 14px;
  border-top:1px solid #e7eaed;
}

.menu-btn{
  height:30px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  color:var(--text);
  cursor:pointer;
  font-size:13px;
  font-weight:500;
  transition:background .16s ease, box-shadow .16s ease, transform .08s ease, border-color .16s ease;
}

.menu-btn:hover{
  background:#eff6ff;
  border-color:#bfdbfe;
  box-shadow:0 8px 20px rgba(15,23,42,.16);
  transform:translateY(-1px);
}

.switch{
  --w:44px;
  --h:24px;
  position:relative;
  width:var(--w);
  height:var(--h);
  border-radius:999px;
  background:#e5e7eb;
  cursor:pointer;
  flex:0 0 auto;
}

.switch input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
}

.switch i{
  position:absolute;
  top:2px;
  left:2px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#ffffff;
  transition:transform .22s cubic-bezier(.4,0,.2,1), background .18s ease, box-shadow .18s ease;
  box-shadow:0 6px 16px rgba(15,23,42,.25);
}

.switch input:checked + i{
  transform:translateX(20px);
  background:#2563eb;
}

body.toolbar-hidden .sj-toolbar{
  transform:translateY(-100%);
  opacity:0;
  pointer-events:none;
}

body.toolbar-hidden #sj-frame{
  top:0;
  height:100svh;
}

body.toolbar-hidden .sj-landing{
  padding-top:16px;
}

body.toolbar-hidden #sj-loader{
  top:8px;
}

body.toolbar-hidden.toolbar-revealed .sj-toolbar{
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#reveal-strip{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:5px;
  z-index:1002;
  pointer-events:auto;
  background:transparent;
}

.floating-settings{
  position:fixed;
  top:calc(env(safe-area-inset-top, 0px) + 8px);
  right:calc(env(safe-area-inset-right, 0px) + 8px);
  z-index:1003;
  height:34px;
  min-width:34px;
  display:grid;
  place-items:center;
  padding:0 9px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:rgba(255,255,255,.96);
  color:var(--text);
  box-shadow:0 10px 30px rgba(15,23,42,.24);
  cursor:pointer;
  transition:opacity .16s ease, transform .07s ease, background .16s ease, border-color .16s ease, box-shadow .18s ease;
  opacity:0;
  pointer-events:none;
}

.floating-settings .fa-solid{
  font-size:14px;
}

.floating-settings:hover{
  background:#f3f4f6;
  border-color:#d1d5db;
  box-shadow:0 14px 35px rgba(15,23,42,.25);
}

.floating-settings:active{
  transform:translateY(1px) scale(.99);
}

.floating-settings:focus-visible{
  outline:none;
  box-shadow:0 0 0 1px var(--ring),0 0 0 4px rgba(37,99,235,.25);
  border-color:var(--ring);
}

body.toolbar-hidden:not(.toolbar-revealed) .floating-settings{
  opacity:1;
  pointer-events:auto;
}

body.toolbar-revealed .floating-settings{
  opacity:0;
  pointer-events:none;
}

dialog.sj-dialog{
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:0;
  background:#ffffff;
  color:var(--text);
  box-shadow:0 24px 70px rgba(15,23,42,.28);
  width:min(460px, 92vw);
}

.sj-d-head{
  padding:13px 15px;
  border-bottom:1px solid #e5e7eb;
  font-weight:600;
}

.sj-d-body{
  padding:13px 15px;
  display:grid;
  gap:10px;
}

.sj-d-row{
  display:grid;
  gap:6px;
}

.sj-d-row input{
  height:38px;
  padding:0 11px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#ffffff;
  color:var(--text);
  font-size:14px;
  transition:border-color .16s ease, box-shadow .18s ease, background .16s ease;
}

.sj-d-row input:focus{
  outline:none;
  border-color:var(--ring);
  box-shadow:0 0 0 1px var(--ring),0 0 0 4px rgba(37,99,235,.25);
  background:#fff;
}

.sj-d-foot{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  padding:10px 15px;
  border-top:1px solid #e5e7eb;
}

.btn-primary{
  background:#2563eb;
  border:1px solid #2563eb;
  color:#ffffff;
}

.btn-primary:hover{
  background:#1d4ed8;
  border-color:#1d4ed8;
}

.btn-danger{
  border-color:#ef4444;
  background:#fee2e2;
  color:#b91c1c;
}

.btn-danger:hover{
  background:#fecaca;
  border-color:#dc2626;
}

.sj-select{
  appearance: none;
  cursor: pointer;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: var(--text);
  min-height: 34px;
  transition: background .15s, border-color .15s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(15,23,42,.12);
  position: relative;
  background-image:
    linear-gradient(45deg, #6b7280 50%, transparent 50%),
    linear-gradient(135deg, transparent 50%, #6b7280 50%);
  background-position:
    calc(100% - 14px) calc(50% - 3px),
    calc(100% - 14px) calc(50% + 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.sj-select:hover{
  background:#eff6ff;
  border-color:#bfdbfe;
}

.sj-select:focus{
  outline: none;
  border-color: #2563eb;
  box-shadow:0 0 0 1px var(--ring),0 0 0 4px rgba(37,99,235,.25);
}

.sj-select::-ms-expand{
  display: none;
}

.sj-select option{
  background: #ffffff;
  color: var(--text);
  padding: 6px;
  border: none;
}

body.in-frame .sj-landing,
body.in-frame footer{
  display:none !important;
}

body.in-frame #sj-frame{
  display:block;
}

.sj-topchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-suggestions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.hero-suggestions .hero-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
}

.hero-topchips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn.top-chip {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg1);
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .08s ease, box-shadow .16s ease;
}

.chip-btn.top-chip:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(15,23,42,.16);
}

.chip-btn.top-chip i {
  font-size: 12px;
  opacity: .8;
}

#ad-countdown {
  font-size: 12px;
  opacity: .8;
  margin-left: 8px;
  min-width: 84px;
  text-align: right;
}

#sj-top-sites[hidden],
#sj-top-sites {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.adbreak-tip {
  position: absolute;
  z-index: 9999;
  max-width: 220px;
  background: #111827;
  color: #e5e7eb;
  font: 600 12px/1.35 Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(75,85,99,.9);
  box-shadow: 0 18px 40px rgba(15,23,42,.7);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.adbreak-tip.show {
  opacity: 1;
  transform: translateY(0);
}

.adbreak-tip::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: inherit;
  border-left: 1px solid rgba(75,85,99,.9);
  border-top: 1px solid rgba(75,85,99,.9);
  transform: rotate(45deg);
  box-shadow: -2px -2px 6px rgba(0,0,0,.12);
}

@keyframes adbreak-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37,99,235,0);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(37,99,235,.25),
      0 0 12px 4px rgba(37,99,235,.24);
  }
}

.adbreak-pulse {
  animation: adbreak-pulse 1.2s ease-in-out infinite;
  border-color: rgba(37,99,235,.95) !important;
  outline: 2px solid rgba(37,99,235,.35);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .adbreak-pulse {
    animation: none;
    outline-offset: 0;
  }
  .adbreak-tip {
    transition: none;
  }
}

body.hide-hero-side .hero-side{
  display:none;
}

body.hide-hero-side .math-hero{
  grid-template-columns: minmax(0,1fr);
}

body.compact-shortcuts .sj-shortcut{
  padding:10px 12px;
  box-shadow:0 12px 30px rgba(15,23,42,.18);
}

body.compact-shortcuts .sj-shortcut span{
  font-size:13px;
}

body.hide-openfront #openfront-ad{
  display:none;
}

@media (max-width: 960px){
  .math-hero{
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 860px){
  :root{
    --btn-h: 36px;
  }

  .sj-toolbar{
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
  }

  .sj-brand{
    justify-content:flex-start;
  }

  #sj-form{
    grid-column:1/3;
  }
}

@media (max-width: 780px){
  .math-hero{
    grid-template-columns: minmax(0,1fr);
  }
}

@media (max-width:640px){
  .sj-shortcuts{
    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  }

  .sj-toolbar{
    padding-inline:0.7rem;
  }

  .settings-shell{
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-nav{
    flex-direction:row;
    overflow-x:auto;
    border-right:none;
    border-bottom:1px solid #edf0f2;
  }
}

@media (max-width:420px){
  .sj-shortcuts{
    grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  }

  .hero-suggestions{
    gap:4px;
  }
}

@media (prefers-reduced-motion: reduce){
  *{
    animation:none !important;
    transition:none !important;
  }
}

.edu-info{
  margin-top:22px;
  padding:15px 18px;
  border-radius:18px;
  background:linear-gradient(145deg,#ffffff,#f9fafb);
  border:1px solid rgba(229,231,235,.95);
  box-shadow:0 18px 45px rgba(15,23,42,.16);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
}

.edu-clock{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  font-weight:600;
  color:#111827;
}

.edu-clock i{
  color:#2563eb;
  font-size:15px;
}

.edu-links{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

#dlg-cookies textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke, #e5e7eb);
  background: var(--input-bg, #fff);
  resize: vertical;
  padding: 10px 12px;
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.35;
  color: var(--text, #111827);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

#dlg-cookies textarea:focus {
  outline: none;
  border-color: var(--ring, #2563eb);
  background: #fff;
  box-shadow: 0 0 0 1px var(--ring, #2563eb),0 0 0 4px rgba(37,99,235,.25);
}

#dlg-cookies-json {
  display: block;
  margin-top: 6px;
  padding: 6px;
  border-radius: 10px;
  border: 1px dashed var(--stroke, #d1d5db);
  background: var(--bg0, #f3f4f6);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}

#dlg-cookies-json:hover {
  border-color: var(--ring, #2563eb);
  background: rgba(37,99,235,.08);
}

#dlg-cookies .sj-d-foot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

#dlg-cookies-clear.btn-danger {
  background: rgba(239,68,68,.1);
  color: #b91c1c;
  border-color: rgba(239,68,68,.25);
}

#dlg-cookies-clear.btn-danger:hover {
  background: rgba(239,68,68,.16);
  border-color: rgba(239,68,68,.35);
}

.sj-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(30px);
  background: rgba(17,24,39,.97);
  color: #fff;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(15,23,42,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
  z-index: 999999;
}

.sj-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

:root:not(.dark) .sj-toast {
  background: rgba(255,255,255,.98);
  color: #111827;
  box-shadow: 0px 18px 40px rgba(15,23,42,.3);
}

#dlg-cookies .chip-btn {
  border-radius: 10px;
  font-weight: 600;
  transition: background .2s, transform .15s, box-shadow .18s ease;
}

#dlg-cookies .chip-btn:hover {
  transform: translateY(-1px);
  box-shadow:0 8px 24px rgba(15,23,42,.22);
}

#dlg-cookies .chip-btn:active {
  transform: translateY(0);
  opacity: .9;
}

@media (max-width: 480px) {
  #dlg-cookies .sj-d-foot {
    grid-template-columns: 1fr 1fr;
  }
}

#district-onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(30,64,175,0.9));
  color: #fff;
  -webkit-font-smoothing: antialiased;
  backdrop-filter: blur(8px);
  animation: dc-fade-in 320ms ease both;
}

@keyframes dc-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dc-onboard-card {
  width: min(980px, calc(100% - 48px));
  max-width: 980px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(15,23,42,0.15));
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(3,7,18,0.9);
  padding: 28px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.08);
  color: #f3f6fb;
}

.dc-onboard-visual {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
}

.dc-onboard-logo {
  width: 144px;
  height: 144px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(15,23,42,0.4));
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  box-shadow: 0 20px 60px rgba(3,7,18,0.9), inset 0 1px 0 rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.dc-onboard-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display:block;
}

.dc-onboard-badge {
  width: 144px;
  height: 36px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:13px;
  color:#020617;
  background: #fff;
  border-radius: 999px;
}

.dc-onboard-form h2 {
  margin: 0 0 6px 0;
  font-size: 20px;
  color: #fff;
}

.dc-onboard-form p.lead {
  margin: 0 0 14px 0;
  color: rgba(243,246,251,0.9);
  font-size: 13px;
}

.dc-field {
  display:flex;
  gap:8px;
  margin-bottom:10px;
  align-items:center;
}

.dc-field label {
  width: 120px;
  font-size: 13px;
  color: rgba(243,246,251,0.9);
}

.dc-input {
  flex: 1;
  display:flex;
  gap:8px;
  align-items:center;
}

.dc-input input[type="text"],
.dc-input input[type="url"] {
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border: none;
  outline: none;
  background: rgba(15,23,42,0.75);
  color: #fff;
  font-size: 14px;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.05);
}

.dc-input input::placeholder {
  color: rgba(148,163,184,0.9);
}

.dc-actions {
  margin-top: 12px;
  display:flex;
  gap:10px;
  align-items:center;
}

.dc-btn {
  padding: 10px 14px;
  border-radius: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg,#2563eb,#22c55e);
  color: #fff;
  box-shadow: 0 18px 50px rgba(37,99,235,0.45);
  transition: transform .12s ease, box-shadow .16s ease, filter .12s ease;
}

.dc-btn.secondary {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(148,163,184,0.7);
  box-shadow: none;
}

.dc-btn:hover { 
  transform: translateY(-2px);
  box-shadow: 0 20px 55px rgba(37,99,235,0.55);
  filter:brightness(1.03);
}

.dc-btn:active{
  transform:translateY(0);
  box-shadow:0 14px 40px rgba(37,99,235,0.55);
}

.dc-note {
  margin-left: auto;
  color: rgba(226,232,240,0.92);
  font-size: 12px;
}

.dc-status {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(226,232,240,0.96);
}

#district-onboard-settings {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99998;
  display: inline-flex;
  align-items:center;
  gap:8px;
  background: linear-gradient(180deg,#ffffff,#e0f2fe);
  color: #020617;
  padding:8px 12px;
  border-radius:999px;
  box-shadow: 0 18px 50px rgba(15,23,42,0.65);
  font-weight:700;
  font-size:13px;
  cursor:pointer;
  border: none;
  outline: none;
}

#district-onboard-settings:hover{
  filter:brightness(1.02);
  transform:translateY(-1px);
}

@media (max-width:880px) {
  .dc-onboard-card { 
    grid-template-columns: 1fr; 
    padding:18px; 
    gap:14px; 
  }
  .dc-onboard-logo { 
    margin: 0 auto; 
  }
  .dc-field label { 
    width: 92px; 
  }
}
