:root{
  --bg:#edf5fb;
  --bg-2:#f9fcff;
  --glass:rgba(255,255,255,.66);
  --glass-strong:rgba(255,255,255,.82);
  --glass-soft:rgba(255,255,255,.45);
  --line:rgba(102,143,174,.28);
  --line-strong:rgba(0,104,117,.28);
  --text:#14232d;
  --muted:#627789;
  --muted-2:#8fa2b2;
  --primary:#006875;
  --primary-2:#00daf3;
  --green:#008b67;
  --green-soft:rgba(0,236,179,.16);
  --red:#d43754;
  --red-soft:rgba(255,107,107,.16);
  --yellow:#c78200;
  --yellow-soft:rgba(255,189,72,.18);
  --blue:#1976d2;
  --shadow:0 22px 60px rgba(42,78,112,.18);
  --shadow-soft:0 12px 32px rgba(42,78,112,.12);
  --radius:24px;
  --sans:"Microsoft YaHei","Segoe UI",Inter,system-ui,sans-serif;
  --mono:"JetBrains Mono","SFMono-Regular",Consolas,monospace;
  color-scheme:light;
}

*{box-sizing:border-box}
html,body{
  margin:0;
  width:100%;
  min-height:100%;
  overflow-x:hidden;
}
body{
  min-height:100dvh;
  color:var(--text);
  font-family:var(--sans);
  font-size:14px;
  background:
    radial-gradient(circle at 16% 16%, rgba(0,218,243,.24), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(0,236,179,.18), transparent 26%),
    linear-gradient(145deg, rgba(255,255,255,.95), rgba(226,241,250,.94) 42%, rgba(247,252,255,.98));
  overflow:hidden;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(110deg, transparent 0 18%, rgba(255,255,255,.42) 18% 19%, transparent 19% 100%),
    linear-gradient(rgba(0,104,117,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,104,117,.035) 1px, transparent 1px);
  background-size:100% 100%, 64px 64px, 64px 64px;
}
body::after{
  content:"";
  position:fixed;
  left:50%;
  bottom:-280px;
  width:min(980px,70vw);
  height:420px;
  transform:translateX(-50%);
  pointer-events:none;
  border-radius:50%;
  background:radial-gradient(ellipse at center, rgba(0,218,243,.22), rgba(255,255,255,.16) 42%, transparent 72%);
  filter:blur(4px);
}

button,a,input{font:inherit}
button,a{touch-action:manipulation}
button{
  cursor:pointer;
  border:0;
  color:inherit;
}
button:disabled{cursor:not-allowed;opacity:.58}
a{color:inherit;text-decoration:none}
svg{width:1em;height:1em}
small{color:var(--muted);font-size:.78rem}
strong{font-family:var(--mono);font-weight:800}
.positive,.up-text,.positive strong{color:var(--green)}
.negative,.down-text,.negative strong{color:var(--red)}
.pending{color:var(--yellow)}

.aero-shell{
  position:relative;
  z-index:1;
  height:100dvh;
  display:flex;
  flex-direction:column;
  padding:18px;
  gap:16px;
}

.terminal-topbar{
  flex:0 0 auto;
  min-height:74px;
  display:grid;
  grid-template-columns:260px minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  padding:12px 16px;
  border:1px solid rgba(255,255,255,.82);
  border-radius:28px;
  background:linear-gradient(135deg, rgba(255,255,255,.78), rgba(238,248,253,.58));
  box-shadow:var(--shadow-soft);
  backdrop-filter:blur(22px) saturate(1.15);
}
.brand{
  min-width:0;
  display:flex;
  align-items:center;
  gap:12px;
}
.brand img{
  width:44px;
  height:44px;
  border-radius:15px;
  box-shadow:0 10px 24px rgba(0,104,117,.24);
}
.brand span{display:grid;gap:2px}
.brand strong{
  font-family:var(--sans);
  font-size:1.38rem;
  letter-spacing:.01em;
}
.brand small{font-weight:700;color:#688399}

.top-metrics{
  min-width:0;
  display:grid;
  grid-template-columns:repeat(7,minmax(105px,1fr));
  gap:8px;
}
.top-metrics article{
  min-width:0;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.7);
  border-radius:18px;
  background:rgba(255,255,255,.44);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.82);
}
.top-metrics small{
  display:block;
  margin-bottom:4px;
  font-size:.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.top-metrics strong{
  display:block;
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
#clock{
  min-width:96px;
  text-align:center;
  color:#395568;
  font:900 1rem/1 var(--mono);
}
.top-actions button,.top-actions a{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.86);
  background:rgba(255,255,255,.5);
  color:var(--primary);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.88), 0 8px 20px rgba(49,91,126,.10);
}

.terminal-layout{
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns:minmax(300px,340px) minmax(620px,1fr) minmax(320px,380px);
  gap:16px;
  align-items:stretch;
  overflow:hidden;
}
.left-rail,.right-rail,.center-stage{
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:16px;
  overflow-x:hidden;
  overflow-y:auto;
  padding-right:4px;
  scrollbar-gutter:stable;
}

.glass-panel{
  min-width:0;
  border:1px solid rgba(255,255,255,.76);
  border-radius:var(--radius);
  background:linear-gradient(145deg, rgba(255,255,255,.76), rgba(235,248,253,.58));
  box-shadow:var(--shadow);
  backdrop-filter:blur(24px) saturate(1.16);
  overflow:hidden;
}
.panel-title{
  min-height:56px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.35));
}
.panel-title span{
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  font-size:1.02rem;
}
.panel-title b{
  flex:none;
  padding:.32rem .72rem;
  border-radius:999px;
  border:1px solid rgba(0,139,103,.22);
  background:var(--green-soft);
  color:var(--green);
  font-size:.76rem;
}
.panel-title small{font-weight:700}
.panel-title-actions{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}
.settings-expand{
  min-height:34px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(0,104,117,.22);
  color:var(--primary);
  background:rgba(255,255,255,.64);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9), 0 8px 18px rgba(49,91,126,.10);
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-weight:900;
  white-space:nowrap;
}
.settings-expand:hover{
  transform:translateY(-1px);
  border-color:rgba(0,104,117,.38);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95), 0 12px 24px rgba(49,91,126,.15);
}
.settings-expand svg{width:16px;height:16px}

.control-card{flex:0 0 auto}
.monitor-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  padding:16px 18px 10px;
}
.monitor-actions button{
  min-height:58px;
  border-radius:18px;
  font-weight:900;
  font-size:1.08rem;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  box-shadow:0 14px 30px rgba(0,104,117,.18);
}
.primary-action,.primary-soft{
  background:linear-gradient(135deg, #00e8b5, #00c8dd);
  color:#00242a;
}
.danger-action{
  background:linear-gradient(135deg, #ff7890, #d43754);
  color:#fff;
}
.ghost-action{
  border:1px solid rgba(255,255,255,.78);
  background:rgba(255,255,255,.55);
  color:#355166;
}

.state-hero{
  margin:8px 18px 14px;
  padding:18px;
  border:1px solid rgba(0,104,117,.16);
  border-radius:22px;
  background:linear-gradient(135deg, rgba(255,255,255,.62), rgba(0,218,243,.08));
}
.state-hero small{display:block;margin-bottom:6px}
.state-hero strong{
  display:block;
  color:#00a7c0;
  font-size:2rem;
  letter-spacing:.04em;
}
.state-hero p{
  margin:8px 0 0;
  color:#5e7487;
  line-height:1.55;
}
.phase-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:0 18px 18px;
}
.phase-grid article{
  padding:12px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.5);
}
.phase-grid small{display:block;margin-bottom:5px}

.settings-card{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.settings-grid{
  min-height:0;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:16px 18px;
}
.settings-group{
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid rgba(0,104,117,.12);
  border-radius:18px;
  background:linear-gradient(145deg,rgba(255,255,255,.74),rgba(238,247,255,.54));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.88);
}
.settings-group-title{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding-bottom:2px;
}
.settings-group-title span{
  color:#142434;
  font-weight:950;
  letter-spacing:.02em;
}
.settings-group-title small{
  color:#6a8196;
  font-size:.72rem;
  font-weight:800;
  text-align:right;
}
.settings-group-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.field{
  display:grid;
  gap:7px;
  color:#4c6578;
  font-weight:800;
  font-size:.78rem;
}
.field > span{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.field-help-trigger{
  width:20px;
  height:20px;
  flex:0 0 20px;
  border:1px solid rgba(39,106,255,.2);
  border-radius:999px;
  color:#2b63ff;
  background:linear-gradient(145deg,rgba(255,255,255,.9),rgba(229,240,255,.78));
  box-shadow:0 8px 18px rgba(39,106,255,.12), inset 0 1px 0 rgba(255,255,255,.9);
  font:950 .72rem/1 var(--font);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.field-help-trigger:hover{
  border-color:rgba(39,106,255,.45);
  transform:translateY(-1px);
}
.field-wide{grid-column:1 / -1}
.field input{
  width:100%;
  height:42px;
  border:1px solid rgba(0,104,117,.18);
  border-radius:14px;
  outline:0;
  padding:0 12px;
  color:#122530;
  background:rgba(255,255,255,.72);
  font:900 .95rem/1 var(--mono);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
.field input:focus{
  border-color:rgba(0,104,117,.5);
  box-shadow:0 0 0 4px rgba(0,218,243,.16), inset 0 1px 0 rgba(255,255,255,.9);
}
.setting-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:0 18px 14px;
}
.setting-actions button{
  min-height:42px;
  border-radius:14px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
}
.strategy-note{
  margin:0 18px 18px;
  padding:12px 14px;
  border-left:4px solid var(--primary-2);
  border-radius:16px;
  background:rgba(0,218,243,.08);
}
.strategy-note strong{color:var(--primary)}
.strategy-note p{
  margin:6px 0 0;
  color:#5c7284;
  line-height:1.55;
  font-size:.82rem;
}

body.settings-modal-open{overflow:hidden}
.settings-modal{
  position:fixed;
  inset:0;
  z-index:1200;
  display:grid;
  place-items:center;
  padding:24px;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.settings-modal[hidden]{display:none !important}
.settings-modal.open{
  opacity:1;
  pointer-events:auto;
}
.settings-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(8,31,43,.34);
  backdrop-filter:blur(12px) saturate(1.08);
}
.settings-modal-card{
  position:relative;
  width:min(1080px, calc(100vw - 40px));
  max-height:min(820px, calc(100dvh - 42px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.82);
  border-radius:32px;
  background:
    radial-gradient(circle at 12% 8%, rgba(0,218,243,.16), transparent 32%),
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(232,248,253,.88));
  box-shadow:0 36px 90px rgba(20,55,78,.30);
  transform:translateY(12px) scale(.98);
  transition:transform .2s ease;
}
.settings-modal.open .settings-modal-card{
  transform:translateY(0) scale(1);
}
.settings-modal-header{
  flex:none;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  padding:24px 28px 18px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.46));
}
.settings-modal-header h2{
  margin:4px 0 8px;
  font-size:1.55rem;
  line-height:1.15;
}
.settings-modal-header p{
  margin:0;
  color:var(--muted);
  font-weight:800;
}
.modal-kicker{
  display:inline-flex;
  padding:.26rem .62rem;
  border-radius:999px;
  color:var(--green);
  border:1px solid rgba(0,139,103,.22);
  background:var(--green-soft);
  font-size:.76rem;
  font-weight:900;
}
.settings-modal-close{
  flex:none;
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:16px;
  color:var(--primary);
  border:1px solid rgba(0,104,117,.18);
  background:rgba(255,255,255,.66);
}
.settings-modal-close svg{width:20px;height:20px}
.settings-modal-body{
  min-height:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:18px;
  padding:22px 28px;
  overflow:auto;
}
.settings-modal-grid-host .settings-grid{
  padding:0;
  overflow:visible;
  gap:14px;
}
.settings-modal-grid-host .settings-group-grid{
  grid-template-columns:repeat(3, minmax(0,1fr));
}
.settings-modal-grid-host .field{
  padding:12px;
  border:1px solid rgba(0,104,117,.12);
  border-radius:18px;
  background:rgba(255,255,255,.55);
}
.settings-modal-help{
  align-self:start;
  padding:18px;
  border:1px solid rgba(0,104,117,.16);
  border-radius:22px;
  background:rgba(0,218,243,.08);
  color:#526a7d;
  font-weight:800;
  line-height:1.65;
}

.field-help-modal{
  position:fixed;
  inset:0;
  z-index:2200;
  display:grid;
  place-items:center;
  padding:20px;
  opacity:0;
  pointer-events:none;
  transition:opacity .16s ease;
}
.field-help-modal[hidden]{display:none}
.field-help-modal.open{
  opacity:1;
  pointer-events:auto;
}
.field-help-backdrop{
  position:absolute;
  inset:0;
  background:rgba(8,18,32,.34);
  backdrop-filter:blur(10px);
}
.field-help-card{
  position:relative;
  width:min(460px, calc(100vw - 32px));
  border:1px solid rgba(120,170,255,.28);
  border-radius:24px;
  background:linear-gradient(145deg,rgba(255,255,255,.94),rgba(238,247,255,.9));
  box-shadow:0 28px 80px rgba(24,68,140,.28), inset 0 1px 0 rgba(255,255,255,.95);
  overflow:hidden;
}
.field-help-card header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:20px 22px 14px;
  border-bottom:1px solid rgba(0,104,117,.12);
}
.field-help-card header span{
  display:block;
  color:#2b63ff;
  font-size:.75rem;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.field-help-card h3{
  margin:5px 0 0;
  color:#122033;
  font-size:1.22rem;
  line-height:1.2;
}
.field-help-card header button{
  width:38px;
  height:38px;
  border:1px solid rgba(0,104,117,.14);
  border-radius:14px;
  background:rgba(255,255,255,.76);
  color:#526a7d;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.field-help-card header button svg{width:18px;height:18px}
.field-help-body{
  padding:18px 22px 22px;
  color:#4e6478;
  font-weight:800;
}
.field-help-body p{
  margin:0 0 14px;
  line-height:1.65;
}
.field-help-body dl{
  display:grid;
  gap:10px;
  margin:0;
}
.field-help-body div{
  padding:11px 12px;
  border-radius:14px;
  background:rgba(232,242,255,.72);
  border:1px solid rgba(39,106,255,.1);
}
.field-help-body dt{
  color:#16283a;
  font-weight:950;
  margin-bottom:4px;
}
.field-help-body dd{
  margin:0;
  line-height:1.55;
}
.settings-modal-help strong{
  display:block;
  margin-bottom:8px;
  color:var(--primary);
  font-size:1.02rem;
}
.settings-modal-help p{margin:0 0 10px}
.settings-modal-help ul{
  margin:0;
  padding-left:18px;
}
.settings-modal-footer{
  flex:none;
  display:flex;
  justify-content:flex-end;
  gap:12px;
  padding:18px 28px 24px;
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.46);
}
.settings-modal-footer button{
  min-height:44px;
  border-radius:16px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:900;
}
.preset-modal-card{
  width:min(1040px, calc(100vw - 40px));
}
.preset-modal-body{
  min-height:0;
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:16px;
  padding:24px 28px;
  overflow:auto;
}
.preset-card{
  position:relative;
  min-height:360px;
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:20px;
  border:1px solid rgba(0,104,117,.16);
  border-radius:26px;
  background:linear-gradient(145deg, rgba(255,255,255,.72), rgba(235,248,253,.54));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.88), 0 18px 38px rgba(42,78,112,.10);
}
.preset-card.recommended{
  border-color:rgba(0,139,103,.42);
  background:
    radial-gradient(circle at 70% 0%, rgba(0,236,179,.22), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.82), rgba(225,251,247,.62));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92), 0 22px 48px rgba(0,139,103,.16);
}
.preset-ribbon{
  position:absolute;
  top:16px;
  right:16px;
  padding:.28rem .68rem;
  border-radius:999px;
  color:var(--green);
  background:var(--green-soft);
  border:1px solid rgba(0,139,103,.22);
  font-size:.76rem;
  font-weight:950;
}
.preset-card-head{
  display:flex;
  gap:14px;
  align-items:flex-start;
  padding-right:52px;
}
.preset-icon{
  flex:none;
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:17px;
  color:var(--primary);
  border:1px solid rgba(0,104,117,.18);
  background:rgba(255,255,255,.66);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
.preset-icon svg{width:22px;height:22px}
.preset-card h3{
  margin:0 0 6px;
  font-size:1.28rem;
  line-height:1.15;
}
.preset-card p{
  margin:0;
  color:#627789;
  font-weight:800;
  line-height:1.55;
}
.preset-card dl{
  display:grid;
  gap:10px;
  margin:0;
}
.preset-card dl div{
  display:grid;
  gap:4px;
  padding:12px;
  border:1px solid rgba(0,104,117,.11);
  border-radius:16px;
  background:rgba(255,255,255,.55);
}
.preset-card dt{
  color:#6d8293;
  font-size:.76rem;
  font-weight:900;
}
.preset-card dd{
  margin:0;
  color:#172934;
  font-weight:950;
}
.preset-apply{
  margin-top:auto;
  min-height:48px;
  border-radius:16px;
  border:1px solid rgba(0,104,117,.18);
  background:rgba(255,255,255,.66);
  color:var(--primary);
  font-weight:950;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9), 0 10px 24px rgba(49,91,126,.10);
}
.preset-apply.primary-soft{
  color:#00242a;
  border-color:transparent;
}
.preset-footnote{
  margin:0 auto 0 0;
  color:#5f7485;
  font-weight:800;
  line-height:1.45;
}

.checklist-panel{flex:0 0 auto;max-height:260px}
.checklist{
  padding:14px 18px 18px;
  display:grid;
  gap:8px;
  max-height:200px;
  overflow:auto;
}
.check{
  display:grid;
  grid-template-columns:minmax(82px,1fr) minmax(90px,1.2fr);
  align-items:center;
  gap:10px;
  padding:9px 11px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.46);
}
.check span{font-weight:800;color:#4f6577}
.check b{
  justify-self:end;
  text-align:right;
  font-size:.78rem;
}
.check.ok b{color:var(--green)}
.check.bad{
  border-color:rgba(212,55,84,.22);
  background:rgba(255,107,107,.08);
}
.check.bad b{color:var(--red)}

.market-board{flex:0 0 auto}
.board-title b{
  color:var(--primary);
  background:rgba(0,218,243,.12);
  border-color:rgba(0,104,117,.16);
}
.price-stage{
  display:grid;
  grid-template-columns:1fr minmax(240px,.8fr) 1fr;
  gap:18px;
  align-items:center;
  padding:22px 26px 16px;
}
.price-side{
  min-height:154px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:20px;
  border-radius:28px;
  border:1px solid rgba(255,255,255,.7);
  background:rgba(255,255,255,.48);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
.price-side span{
  font-weight:900;
  letter-spacing:.08em;
}
.price-side strong{
  margin-top:8px;
  font-size:4rem;
  line-height:.95;
}
.price-side small{margin-top:8px}
.price-side.up{align-items:flex-start;color:var(--green)}
.price-side.down{align-items:flex-end;color:var(--red)}
.countdown-core{
  min-height:154px;
  display:grid;
  place-items:center;
  text-align:center;
  padding:18px;
  border-radius:32px;
  background:linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,.4));
  border:1px solid rgba(0,104,117,.12);
}
.countdown-core strong{
  font-size:3.8rem;
  line-height:1;
  color:#21333e;
}
.countdown-core span{
  color:#5a7184;
  font-weight:800;
}
.price-drift{
  width:100%;
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px;
}
.price-drift .drift-pill{
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-height:28px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid rgba(0,104,117,.12);
  background:rgba(255,255,255,.58);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
  color:#536d80;
  font:800 .78rem/1.15 var(--mono);
  white-space:nowrap;
}
.price-drift .drift-pill b{
  color:#21333e;
  font-weight:950;
}
.price-drift .drift-pill.live b,
.top-metrics strong.live-price{
  color:var(--orange);
}
.price-drift .drift-pill.up b,
.top-metrics strong.price-up{
  color:var(--green);
}
.price-drift .drift-pill.down b,
.top-metrics strong.price-down{
  color:var(--red);
}
.price-drift .drift-source{
  flex-basis:100%;
  color:#8296a6;
  font:800 .68rem/1.2 var(--sans);
}
.probability-rail{
  position:relative;
  height:18px;
  margin:0 26px 20px;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(0,236,179,.14) 0 50%, rgba(255,107,107,.14) 50% 100%);
  overflow:hidden;
  box-shadow:inset 0 1px 3px rgba(38,75,105,.12);
}
.probability-rail span{
  position:absolute;
  inset:0 auto 0 0;
  width:50%;
  border-radius:999px;
  background:linear-gradient(90deg, #00e8b5, #00daf3);
}
.probability-rail i{
  position:absolute;
  top:-5px;
  width:2px;
  height:28px;
  left:50%;
  background:#5d7486;
  box-shadow:0 0 0 4px rgba(255,255,255,.78);
}
.book-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  padding:0 26px 18px;
}
.book-card{
  border:1px solid var(--line);
  border-radius:22px;
  background:rgba(255,255,255,.5);
  overflow:hidden;
  transition:border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.book-card.hot{
  transform:translateY(-1px);
  box-shadow:0 16px 32px rgba(0,104,117,.14);
  border-color:rgba(0,104,117,.42);
}
.book-title,.book-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:13px 16px;
}
.book-title{
  background:rgba(255,255,255,.45);
  border-bottom:1px solid var(--line);
}
.book-title span{color:var(--muted);font-family:var(--mono);font-size:.78rem}
.book-row + .book-row{border-top:1px solid rgba(102,143,174,.16)}
.book-card.up strong{color:var(--green)}
.book-card.down strong{color:var(--red)}

.confluence-panel{
  display:grid;
  grid-template-columns:1.2fr 1.2fr .8fr .8fr;
  gap:12px;
  padding:0 26px 18px;
}
.confluence-card{
  min-width:0;
  min-height:86px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border:1px solid rgba(0,104,117,.16);
  border-radius:20px;
  background:linear-gradient(135deg, rgba(255,255,255,.64), rgba(235,248,255,.46));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.86);
}
.confluence-card div{
  min-width:0;
  display:grid;
  gap:5px;
}
.confluence-card small{
  font-weight:900;
  letter-spacing:.06em;
}
.confluence-card strong{
  color:#203542;
  font-size:1.05rem;
}
.confluence-card > span{
  min-width:0;
  color:#5d7486;
  font-weight:800;
  line-height:1.3;
  text-align:right;
}
.confluence-card.compact{
  display:grid;
  align-content:center;
  justify-items:start;
  gap:5px;
}
.confluence-card.compact span{text-align:left;font-size:.78rem}
.confluence-card.ok{
  border-color:rgba(0,139,103,.34);
  background:linear-gradient(135deg, rgba(0,236,179,.16), rgba(255,255,255,.62));
}
.confluence-card.ok strong{color:var(--green)}
.confluence-card.warn{
  border-color:rgba(199,130,0,.36);
  background:linear-gradient(135deg, rgba(255,189,72,.18), rgba(255,255,255,.62));
}
.confluence-card.warn strong{color:var(--yellow)}
.confluence-card.bad{
  border-color:rgba(212,55,84,.32);
  background:linear-gradient(135deg, rgba(255,107,107,.14), rgba(255,255,255,.62));
}
.confluence-card.bad strong{color:var(--red)}

.decision-strip{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.36);
}
.decision-strip article{
  min-width:0;
  padding:14px 16px;
  border-right:1px solid rgba(102,143,174,.16);
}
.decision-strip article:last-child{border-right:0}
.decision-strip small,.decision-strip span{
  display:block;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.decision-strip strong{
  display:block;
  margin-top:5px;
  color:#203542;
}

.activity-panel{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.summary-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:12px;
  padding:16px 18px;
}
.stat-card,.summary-grid.compact article{
  min-width:0;
  padding:16px;
  border:1px solid var(--line);
  border-radius:20px;
  background:rgba(255,255,255,.52);
}
.stat-card small,.summary-grid.compact small{
  display:block;
  margin-bottom:8px;
}
.stat-card strong{
  font-size:1.28rem;
}
.stat-card.featured{
  background:linear-gradient(135deg, rgba(0,236,179,.16), rgba(255,255,255,.54));
}
.records-shell{
  flex:1 1 auto;
  min-height:0;
  margin:0 18px 18px;
  border:1px solid var(--line);
  border-radius:22px;
  background:rgba(255,255,255,.42);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.records-head{
  flex:0 0 auto;
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
}
.records-head span{color:var(--muted);font-size:.82rem}
.record-list{
  flex:1 1 auto;
  min-height:260px;
  max-height:360px;
  overflow:auto;
  padding:12px;
  display:grid;
  gap:10px;
}
.record-empty{
  min-height:160px;
  display:grid;
  place-items:center;
  text-align:center;
  color:var(--muted);
}
.record-empty strong{display:block;color:#4d6476;margin-bottom:6px}
.record-card{
  padding:12px;
  border:1px solid rgba(102,143,174,.22);
  border-radius:18px;
  background:rgba(255,255,255,.58);
}
.record-top,.record-title,.record-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.record-title,.record-meta{justify-content:flex-start;min-width:0}
.record-meta span{
  max-width:300px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  color:var(--muted);
  font-family:var(--mono);
  font-size:.78rem;
}
.record-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:8px;
}
.record-grid div{
  padding:8px;
  border-radius:12px;
  background:rgba(237,245,251,.72);
}
.record-grid small{display:block;margin-bottom:4px}

.right-rail .glass-panel{flex:0 0 auto}
.official-panel{height:38%}
.alert-panel{height:auto;max-height:270px;display:flex;flex-direction:column}
.log-panel{height:calc(64% - 32px);min-height:320px;display:flex;flex-direction:column}
.summary-grid.compact{
  grid-template-columns:repeat(3,1fr);
  gap:0;
  padding:0;
  border-bottom:1px solid var(--line);
}
.summary-grid.compact article{
  border:0;
  border-right:1px solid rgba(102,143,174,.16);
  border-radius:0;
  background:rgba(255,255,255,.32);
}
.summary-grid.compact article:last-child{border-right:0}

.official-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
}
.official-tabs{
  display:flex;
  padding:4px;
  border-radius:999px;
  background:rgba(214,231,240,.58);
}
.official-tab{
  min-width:78px;
  height:34px;
  border-radius:999px;
  background:transparent;
  color:var(--muted);
  font-weight:900;
}
.official-tab.active{
  background:rgba(255,255,255,.86);
  color:var(--primary);
  box-shadow:0 6px 16px rgba(55,92,120,.12);
}
.official-updated{
  color:var(--muted);
  font-size:.78rem;
  font-family:var(--mono);
}
.position-list{
  height:calc(100% - 172px);
  min-height:160px;
  overflow:auto;
  padding:12px 14px 16px;
  display:grid;
  gap:10px;
}
.position-list.empty,.alert-list.empty{
  display:grid;
  place-items:center;
  text-align:center;
  color:var(--muted-2);
}
.pos-card,.order-card{
  border:1px solid rgba(102,143,174,.22);
  border-radius:18px;
  background:rgba(255,255,255,.58);
  padding:12px;
}
.pos-title,.order-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.pos-title span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pos-metrics,.order-meta{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:10px 0;
}
.pos-metrics div,.order-meta div{
  padding:8px;
  border-radius:12px;
  background:rgba(237,245,251,.72);
}
.pos-card button{
  width:100%;
  height:38px;
  border-radius:12px;
  background:linear-gradient(135deg,#00e8b5,#00c8dd);
  color:#00242a;
  font-weight:900;
}
.order-note{color:var(--muted);font-size:.78rem}

.alert-list{
  flex:1 1 auto;
  min-height:0;
  max-height:214px;
  overflow:auto;
  padding:8px 10px 10px;
  display:grid;
  gap:6px;
}
.alert-card{
  padding:8px 10px;
  border:1px solid rgba(199,130,0,.25);
  border-radius:14px;
  background:var(--yellow-soft);
}
.alert-card.error{
  border-color:rgba(212,55,84,.25);
  background:var(--red-soft);
}
.alert-card.info{
  border-color:rgba(0,104,117,.2);
  background:rgba(0,218,243,.10);
}
.alert-card header,.alert-card footer{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.alert-card header strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.alert-card p{
  margin:4px 0;
  color:#536b7d;
  font-size:.78rem;
  line-height:1.32;
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.alert-card time,.alert-card footer{font-size:.7rem;color:var(--muted)}
.alert-card footer{display:none}
.alert-badge{font-weight:900;color:var(--yellow)}
.alert-badge.error{color:var(--red)}
.alert-badge.info{color:var(--primary)}

.log-toolbar{
  flex:0 0 auto;
  padding:10px 14px;
  border-bottom:1px solid var(--line);
  color:var(--muted);
  font-size:.78rem;
}
.logs{
  flex:1 1 auto;
  overflow:auto;
  padding:12px 14px 16px;
  display:grid;
  align-content:start;
  gap:8px;
  font-family:var(--mono);
}
.log-row{
  display:grid;
  grid-template-columns:74px minmax(0,1fr);
  gap:10px;
  align-items:start;
  padding:8px 10px;
  border-radius:12px;
  background:rgba(255,255,255,.44);
}
.log-row time{color:#547084}
.log-row.ok span{color:var(--green)}
.log-row.warn span{color:var(--yellow)}
.log-row.err span{color:var(--red)}
.log-row.info span{color:#33566c}

.tag,.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:22px;
  padding:0 .48rem;
  border-radius:999px;
  font-family:var(--mono);
  font-size:.72rem;
  font-weight:900;
}
.tag.up,.badge.win{
  color:var(--green);
  border:1px solid rgba(0,139,103,.28);
  background:var(--green-soft);
}
.tag.down,.badge.loss,.badge.sold{
  color:var(--red);
  border:1px solid rgba(212,55,84,.28);
  background:var(--red-soft);
}
.badge.pending{
  color:var(--yellow);
  border:1px solid rgba(199,130,0,.28);
  background:var(--yellow-soft);
}

::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{
  border:3px solid transparent;
  border-radius:999px;
  background:rgba(0,104,117,.32);
  background-clip:padding-box;
}
::-webkit-scrollbar-track{background:transparent}

@media (max-width:1680px){
  .terminal-layout{grid-template-columns:310px minmax(560px,1fr) 330px}
  .top-metrics{grid-template-columns:repeat(3,minmax(110px,1fr))}
  .terminal-topbar{grid-template-columns:240px minmax(0,1fr) auto}
  .price-side strong{font-size:3.3rem}
  .countdown-core strong{font-size:3.2rem}
  .confluence-panel{grid-template-columns:1fr 1fr}
  .decision-strip{grid-template-columns:repeat(3,1fr)}
  .summary-grid{grid-template-columns:repeat(3,1fr)}
}

@media (min-width:1920px){
  .aero-shell{
    padding:22px;
    gap:18px;
  }

  .terminal-layout{
    grid-template-columns:minmax(360px,420px) minmax(860px,1fr) minmax(390px,460px);
    gap:20px;
  }

  .terminal-topbar{
    grid-template-columns:320px minmax(0,1fr) auto;
  }

  .top-metrics{
    grid-template-columns:repeat(7,minmax(130px,1fr));
  }
}

@media (min-width:2560px){
  body{
    font-size:15px;
  }

  .aero-shell{
    padding:28px 32px;
    gap:22px;
  }

  .terminal-layout{
    grid-template-columns:minmax(420px,500px) minmax(1040px,1fr) minmax(450px,540px);
    gap:24px;
  }

  .terminal-topbar{
    min-height:86px;
    grid-template-columns:360px minmax(0,1fr) auto;
    gap:18px;
  }

  .top-metrics article{
    padding:13px 16px;
  }
}

@media (max-width:1280px){
  body{overflow:auto}
  .aero-shell{height:auto;min-height:100dvh}
  .terminal-layout{grid-template-columns:1fr}
  .left-rail,.right-rail,.center-stage{overflow:visible}
  .official-panel,.alert-panel,.log-panel{height:auto;min-height:260px}
  .position-list,.alert-list,.logs{max-height:320px}
  .terminal-topbar{grid-template-columns:1fr;align-items:start}
  .top-metrics{grid-template-columns:repeat(2,1fr)}
}

@media (max-width:760px){
  .aero-shell{padding:10px}
  .top-metrics,.settings-grid,.book-grid,.phase-grid,.summary-grid,.record-grid,.pos-metrics,.order-meta{
    grid-template-columns:1fr;
  }
  .price-stage{grid-template-columns:1fr;gap:10px;padding:14px}
  .price-side{align-items:flex-start!important;min-height:110px}
  .price-side strong{font-size:3rem}
  .countdown-core strong{font-size:3rem}
  .decision-strip{grid-template-columns:1fr}
  .monitor-actions,.setting-actions{grid-template-columns:1fr}
}

@media (max-height:980px) and (min-width:1181px){
  .aero-shell{
    height:100dvh;
  }

  .terminal-layout{
    min-height:0;
    overflow:hidden;
  }

  .left-rail,
  .right-rail,
  .center-stage{
    overflow-y:auto;
    overflow-x:hidden;
  }

  .settings-grid{
    max-height:none;
  }
}

/* Responsive safety layer: keep the trading console usable on small laptops. */
html{
  min-width:0;
  overflow-x:hidden;
}

body{
  min-width:0;
}

img,svg,video,canvas{
  max-width:100%;
}

.terminal-layout,
.terminal-topbar,
.top-metrics,
.price-stage,
.book-grid,
.decision-strip,
.summary-grid,
.records-shell,
.record-list,
.position-list,
.alert-list,
.logs{
  min-width:0;
}

.record-card,
.pos-card,
.order-card,
.alert-card,
.log-row,
.book-row,
.decision-strip article,
.stat-card{
  min-width:0;
}

.record-card *,
.pos-card *,
.order-card *,
.alert-card *,
.log-row *,
.book-row *,
.decision-strip article *,
.top-metrics article *{
  min-width:0;
}

.price-side strong{
  font-size:clamp(2.35rem, 4.5vw, 4rem);
}

.countdown-core strong{
  font-size:clamp(2.45rem, 4vw, 3.8rem);
}

.state-hero strong{
  font-size:clamp(1.45rem, 2.3vw, 2rem);
}

.record-list,
.position-list,
.alert-list,
.logs,
.settings-grid,
.checklist{
  overscroll-behavior:contain;
}

.records-head span,
.official-updated,
.log-summary,
.alert-card p,
.order-note{
  overflow-wrap:anywhere;
}

@media (max-width:1560px){
  .aero-shell{
    padding:14px;
    gap:12px;
  }

  .terminal-layout{
    grid-template-columns:minmax(276px,300px) minmax(480px,1fr) minmax(288px,320px);
    gap:12px;
  }

  .terminal-topbar{
    min-height:66px;
    grid-template-columns:220px minmax(0,1fr) auto;
    gap:10px;
    padding:10px 12px;
    border-radius:22px;
  }

  .brand img{
    width:38px;
    height:38px;
    border-radius:13px;
  }

  .brand strong{
    font-size:1.12rem;
  }

  .brand small{
    font-size:.72rem;
  }

  .top-metrics{
    grid-template-columns:repeat(4,minmax(86px,1fr));
    gap:6px;
  }

  .top-metrics article{
    padding:8px 10px;
    border-radius:14px;
  }

  .top-actions button,
  .top-actions a{
    width:40px;
    height:40px;
    border-radius:14px;
  }

  #clock{
    min-width:82px;
    font-size:.86rem;
  }

  .glass-panel{
    border-radius:20px;
  }

  .panel-title{
    min-height:50px;
    padding:12px 14px;
  }

  .monitor-actions{
    padding:14px 14px 8px;
    gap:10px;
  }

  .monitor-actions button{
    min-height:52px;
    border-radius:15px;
    font-size:.98rem;
  }

  .state-hero{
    margin:8px 14px 12px;
    padding:14px;
    border-radius:18px;
  }

  .phase-grid,
  .settings-grid,
  .checklist,
  .summary-grid{
    padding-left:14px;
    padding-right:14px;
  }

  .price-stage{
    gap:12px;
    padding:18px 18px 14px;
    grid-template-columns:minmax(118px,1fr) minmax(210px,.9fr) minmax(118px,1fr);
  }

  .price-side,
  .countdown-core{
    min-height:132px;
    border-radius:22px;
    padding:16px;
  }

  .probability-rail{
    margin-left:18px;
    margin-right:18px;
  }

  .book-grid{
    gap:10px;
    padding:0 18px 14px;
  }

  .book-title,
  .book-row{
    padding:11px 12px;
  }

  .decision-strip article{
    padding:12px;
  }

  .record-list{
    min-height:210px;
    max-height:300px;
  }
}

@media (max-width:1366px), (max-height:820px){
  body{
    overflow-x:hidden;
    overflow-y:auto;
  }

  .aero-shell{
    height:auto;
    min-height:100dvh;
  }

  .terminal-layout{
    align-items:start;
  }

  .left-rail,
  .right-rail,
  .center-stage{
    overflow:visible;
  }

  .settings-card,
  .activity-panel{
    flex:0 0 auto;
  }

  .settings-grid{
    max-height:360px;
  }

  .checklist-panel{
    max-height:none;
  }

  .checklist{
    max-height:220px;
  }

  .official-panel,
  .alert-panel,
  .log-panel{
    height:auto;
  }

  .official-panel{
    min-height:320px;
  }

  .alert-panel,
  .log-panel{
    min-height:260px;
  }

  .position-list,
  .alert-list,
  .logs{
    height:auto;
    min-height:160px;
    max-height:300px;
  }
}

@media (max-width:1180px){
  body{
    overflow-x:hidden;
    overflow-y:auto;
  }

  .aero-shell{
    height:auto;
    min-height:100dvh;
    padding:12px;
  }

  .terminal-layout{
    grid-template-columns:1fr;
  }

  .center-stage{
    order:1;
  }

  .left-rail{
    order:2;
  }

  .right-rail{
    order:3;
  }

  .left-rail,
  .right-rail,
  .center-stage{
    display:grid;
    grid-template-columns:1fr;
  }

  .terminal-topbar{
    grid-template-columns:210px minmax(0,1fr) auto;
  }

  .top-actions{
    justify-content:space-between;
  }

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

  .settings-card{
    max-height:none;
  }

  .settings-grid{
    max-height:none;
  }

  .official-panel,
  .alert-panel,
  .log-panel{
    min-height:auto;
  }

  .position-list,
  .alert-list,
  .logs,
  .record-list{
    max-height:360px;
  }
}

@media (max-width:980px){
  .terminal-topbar{
    grid-template-columns:1fr;
  }

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

  .price-stage{
    grid-template-columns:1fr 1fr;
  }

  .countdown-core{
    grid-column:1 / -1;
    order:-1;
  }

  .book-grid,
  .summary-grid{
    grid-template-columns:1fr 1fr;
  }

  .decision-strip{
    grid-template-columns:1fr 1fr;
  }

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

  .records-head{
    display:grid;
  }

  .record-top,
  .record-title,
  .record-meta{
    flex-wrap:wrap;
  }
}

@media (max-width:640px){
  body{
    font-size:13px;
  }

  .aero-shell{
    padding:8px;
    gap:10px;
  }

  .terminal-topbar{
    padding:10px;
    border-radius:18px;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
  }

  .brand{
    grid-column:1;
  }

  .brand small{
    display:none;
  }

  .top-metrics,
  .settings-grid,
  .book-grid,
  .summary-grid,
  .decision-strip,
  .phase-grid,
  .record-grid,
  .pos-metrics,
  .order-meta{
    grid-template-columns:1fr;
  }

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

  .top-actions{
    grid-column:2;
    gap:6px;
    justify-content:flex-end;
  }

  .top-actions button,
  .top-actions a{
    width:38px;
    height:38px;
  }

  #clock{
    min-width:72px;
    flex:0 0 auto;
    text-align:right;
  }

  .panel-title{
    align-items:flex-start;
    flex-wrap:wrap;
    gap:8px;
  }

  .panel-title span{
    width:100%;
  }

  .monitor-actions,
  .setting-actions{
    grid-template-columns:1fr;
  }

  .monitor-actions button{
    min-height:54px;
  }

  .price-stage{
    grid-template-columns:1fr;
    padding:12px;
  }

  .price-side{
    align-items:flex-start !important;
    min-height:98px;
  }

  .countdown-core{
    min-height:118px;
  }

  .probability-rail{
    margin:0 12px 14px;
  }

  .book-grid{
    padding:0 12px 12px;
  }

  .official-toolbar{
    align-items:flex-start;
    flex-direction:column;
  }

  .official-tabs{
    width:100%;
  }

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

  .log-row{
    grid-template-columns:64px minmax(0,1fr);
    padding:7px 8px;
  }

  .records-shell{
    margin:0 12px 12px;
  }

  .record-list,
  .position-list,
  .alert-list,
  .logs{
    max-height:300px;
  }
}

@media (max-width:860px){
  .panel-title-actions{
    width:100%;
    justify-content:space-between;
  }

  .settings-expand{
    min-height:40px;
  }

  .settings-modal{
    padding:12px;
  }

  .settings-modal-card{
    width:calc(100vw - 20px);
    max-height:calc(100dvh - 20px);
    border-radius:24px;
  }

  .settings-modal-header,
  .settings-modal-body,
  .settings-modal-footer{
    padding-left:18px;
    padding-right:18px;
  }

  .settings-modal-body{
    grid-template-columns:1fr;
  }

  .settings-modal-grid-host .settings-grid{
    grid-template-columns:1fr;
  }

  .preset-modal-body{
    grid-template-columns:1fr;
    padding-left:18px;
    padding-right:18px;
  }

  .preset-card{
    min-height:0;
  }

  .settings-modal-footer{
    display:grid;
    grid-template-columns:1fr;
  }

  .preset-footnote{
    margin:0;
  }
}

@media (prefers-reduced-motion:reduce){
  .settings-modal,
  .settings-modal-card,
  .settings-expand{
    transition:none;
  }
}

/* Desktop viewport fit layer.
   Keep the trading terminal usable on common PC resolutions while preserving
   internal scrolling for the strategy parameters and side panels. */
@media (min-width:1181px){
  html,
  body{
    height:100%;
    overflow:hidden;
  }

  body{
    min-height:100dvh;
  }

  .aero-shell{
    height:100dvh;
    min-height:0;
    overflow:hidden;
    padding:clamp(10px, .95vw, 22px);
    gap:clamp(10px, .85vw, 18px);
  }

  .terminal-topbar{
    flex:0 0 auto;
    min-height:clamp(58px, 4.4vw, 86px);
    padding:clamp(8px, .7vw, 14px) clamp(10px, .85vw, 18px);
  }

  .terminal-layout{
    flex:1 1 auto;
    height:auto;
    min-height:0;
    align-items:stretch;
    overflow:hidden;
    gap:clamp(10px, .85vw, 20px);
    grid-template-columns:clamp(286px, 17vw, 500px) minmax(500px, 1fr) clamp(292px, 18vw, 540px);
  }

  .left-rail,
  .center-stage,
  .right-rail{
    height:100%;
    min-height:0;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding-right:clamp(2px, .32vw, 6px);
  }

  .control-card,
  .checklist-panel,
  .official-panel,
  .alert-panel,
  .log-panel{
    flex:0 0 auto;
  }

  .settings-card{
    flex:0 0 auto;
    min-height:0;
    max-height:none;
    overflow:hidden;
  }

  .settings-title{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .settings-title .panel-title-actions{
    flex-wrap:wrap;
    gap:8px;
  }

  .settings-grid{
    flex:0 1 auto;
    min-height:0;
    max-height:min(52vh, 520px);
    overflow-x:hidden;
    overflow-y:auto;
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .setting-actions,
  .strategy-note{
    flex:0 0 auto;
  }

  .setting-actions{
    padding-top:8px;
    background:linear-gradient(180deg, rgba(255,255,255,0), rgba(244,251,255,.86) 22%, rgba(244,251,255,.92));
  }

  .checklist-panel{
    max-height:clamp(170px, 24vh, 260px);
  }

  .checklist{
    max-height:200px;
  }

  .official-panel{
    height:auto;
    min-height:0;
    max-height:none;
    flex-basis:clamp(180px, 27vh, 380px);
  }

  .alert-panel{
    height:auto;
    min-height:0;
    flex-basis:270px;
    max-height:270px;
  }

  .log-panel{
    height:auto;
    min-height:340px;
    flex:1 1 420px;
  }

  .position-list,
  .alert-list,
  .logs{
    min-height:0;
    max-height:none;
  }

  .alert-list{
    max-height:214px;
    padding:8px 10px 10px;
    gap:6px;
  }

  .logs{
    padding:12px 14px 18px;
    gap:9px;
  }
}

@media (min-width:1181px) and (max-width:1500px){
  .terminal-layout{
    grid-template-columns:clamp(276px, 21vw, 312px) minmax(430px, 1fr) clamp(278px, 22vw, 326px);
  }

  .top-metrics{
    grid-template-columns:repeat(4, minmax(82px, 1fr));
  }

  .settings-expand{
    min-height:32px;
    padding:0 10px;
    font-size:.82rem;
  }
}

@media (min-width:1181px) and (max-height:900px){
  body{
    font-size:13px;
  }

  .terminal-topbar{
    min-height:56px;
    border-radius:22px;
  }

  .brand img{
    width:36px;
    height:36px;
    border-radius:12px;
  }

  .brand strong{
    font-size:1.08rem;
  }

  .brand small,
  .top-metrics small{
    font-size:.66rem;
  }

  .top-metrics article{
    padding:7px 9px;
    border-radius:13px;
  }

  .panel-title{
    min-height:46px;
    padding:10px 13px;
  }

  .monitor-actions{
    padding:12px 13px 8px;
    gap:8px;
  }

  .monitor-actions button{
    min-height:46px;
    border-radius:14px;
    font-size:.92rem;
  }

  .state-hero{
    margin:7px 13px 10px;
    padding:12px;
    border-radius:16px;
  }

  .state-hero strong{
    font-size:clamp(1.36rem, 2.2vw, 1.8rem);
  }

  .state-hero p{
    line-height:1.42;
    font-size:.78rem;
  }

  .phase-grid{
    gap:8px;
    padding:0 13px 12px;
  }

  .phase-grid article{
    padding:9px 10px;
    border-radius:14px;
  }

  .settings-grid{
    gap:8px;
    padding:11px 13px;
    max-height:min(45vh, 430px);
  }

  .field{
    gap:5px;
    font-size:.7rem;
  }

  .field input{
    height:36px;
    border-radius:12px;
    padding:0 10px;
    font-size:.86rem;
  }

  .setting-actions{
    gap:8px;
    padding:7px 13px 11px;
  }

  .setting-actions button{
    min-height:36px;
    border-radius:12px;
    font-size:.82rem;
  }

  .strategy-note{
    margin:0 13px 13px;
    padding:10px 12px;
    border-radius:14px;
  }

  .strategy-note p{
    line-height:1.38;
    font-size:.76rem;
  }

  .checklist-panel{
    max-height:200px;
  }

  .checklist{
    max-height:142px;
  }

  .alert-panel{
    flex-basis:270px;
    max-height:270px;
  }

  .alert-list{
    max-height:214px;
  }

  .log-panel{
    min-height:340px;
    flex-basis:400px;
  }
}

@media (min-width:1181px) and (max-height:760px){
  .aero-shell{
    padding:8px;
    gap:8px;
  }

  .terminal-layout{
    gap:8px;
  }

  .state-hero p,
  .strategy-note p{
    display:none;
  }

  .settings-grid{
    max-height:min(50vh, 390px);
  }

  .checklist-panel{
    max-height:160px;
  }
}

@media (max-width:980px){
  .confluence-panel{
    grid-template-columns:1fr;
    padding:0 14px 14px;
  }
  .confluence-card{
    min-height:72px;
    align-items:flex-start;
    flex-direction:column;
  }
  .confluence-card > span{text-align:left}
}

@media (max-width:760px){
  .settings-group-grid,
  .settings-modal-grid-host .settings-group-grid{
    grid-template-columns:1fr;
  }
}

@media (min-width:1181px) and (max-height:760px){
  .settings-group{
    padding:10px;
    gap:8px;
  }
  .settings-group-title small{
    display:none;
  }
  .settings-group-grid{
    gap:8px;
  }
}
