:root {
  color-scheme: dark;
  --bg: #080d18;
  --bg-soft: #0c1423;
  --panel: rgba(15, 25, 42, .84);
  --panel-solid: #101b2d;
  --line: rgba(155, 180, 211, .13);
  --line-strong: rgba(155, 180, 211, .22);
  --text: #f1f6fb;
  --muted: #8c9caf;
  --muted-bright: #b3c0cf;
  --green: #38e29f;
  --green-soft: rgba(56, 226, 159, .12);
  --cyan: #43c8f5;
  --violet: #a58af7;
  --amber: #f5b95e;
  --danger: #ff7184;
  --success-fg: #9feaca;
  --info-fg: #b9edf8;
  --warning-fg: #ffd492;
  --danger-fg: #ffabb6;
  --surface: #101b2d;
  --surface-raised: #142238;
  --field-bg: #0a1422;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 74% -20%, rgba(30, 106, 91, .28), transparent 32rem),
    linear-gradient(145deg, #080d18 0%, #0a101c 52%, #080d17 100%);
  letter-spacing: .01em;
}
button, input { font: inherit; }
small { font-size: .75rem; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1rem; background: var(--green); color: #042216; border-radius: 8px; font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.ambient { position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(1px); opacity: .22; }
.ambient-one { width: 340px; height: 340px; right: -190px; top: 26%; background: radial-gradient(circle, rgba(56,226,159,.25), transparent 68%); }
.ambient-two { width: 280px; height: 280px; left: -190px; top: 58%; background: radial-gradient(circle, rgba(67,200,245,.16), transparent 68%); }

.topbar {
  height: 78px;
  padding: 0 clamp(1.25rem, 4vw, 4.4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 24, .72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: inline-flex; min-width: 0; align-items: center; gap: .75rem; text-decoration: none; }
.brand-mark { position: relative; display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; overflow: hidden; border: 1px solid rgba(56,226,159,.5); border-radius: 12px; background: linear-gradient(145deg, #102d3e 0%, #0d2234 45%, #07121f 100%); box-shadow: inset 0 0 18px rgba(56,226,159,.1), 0 7px 22px rgba(0,0,0,.22); }
.brand-mark::before { content: ""; position: absolute; width: 31px; height: 31px; border: 1px solid rgba(67,200,245,.26); border-radius: 9px; transform: rotate(45deg); }
.brand-mark::after { content: ""; position: absolute; right: 4px; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.brand-mark span { position: relative; z-index: 1; color: #dffdf1; font-size: .75rem; font-weight: 900; letter-spacing: -.04em; text-shadow: 0 0 10px rgba(56,226,159,.42); }
.brand-copy { min-width: 0; }
.brand strong { display: block; white-space: nowrap; font-size: 1.02rem; letter-spacing: .035em; }
.brand small { display: block; margin-top: .14rem; font-size: .75rem; letter-spacing: .23em; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: .65rem; }
.theme-control { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; padding: .3rem; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(17,29,48,.72); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.theme-control-label { display: grid; gap: .04rem; padding-left: .35rem; color: var(--muted-bright); font-size: .75rem; font-weight: 750; line-height: 1.15; white-space: nowrap; }
.theme-control-label small { color: var(--muted); font-size: .75rem; font-weight: 550; letter-spacing: 0; }
.theme-options { display: inline-grid; grid-template-columns: repeat(3, auto); gap: .16rem; padding: .14rem; border-radius: 9px; background: rgba(4,10,18,.34); }
.theme-option { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 30px; padding: .32rem .48rem; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; font-size: .75rem; font-weight: 720; line-height: 1; cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.theme-option:hover { color: var(--text); background: rgba(255,255,255,.035); }
.theme-option[aria-pressed="true"] { color: var(--success-fg); border-color: rgba(56,226,159,.26); background: rgba(56,226,159,.1); box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.theme-option-icon { width: 1em; color: currentColor; font-size: .78rem; line-height: 1; text-align: center; }
.theme-option:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.privacy-pill, .connection-pill, .source-badge, .soft-badge, .count-badge { display: inline-flex; align-items: center; border: 1px solid var(--line); background: rgba(17,29,48,.7); border-radius: 999px; color: var(--muted-bright); }
.privacy-pill { padding: .5rem .78rem; font-size: .75rem; color: #9feaca; border-color: rgba(56,226,159,.16); background: rgba(56,226,159,.06); }
.shield-icon { margin-right: .38rem; color: var(--green); }
.connection-pill { gap: .42rem; padding: .5rem .72rem; font-size: .75rem; }
.connection-pill i, .live-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 9px rgba(245,185,94,.7); }
.connection-pill.online i, .live-label i { background: var(--green); box-shadow: 0 0 9px rgba(56,226,159,.8); }
.connection-pill.error i { background: var(--danger); box-shadow: 0 0 9px rgba(255,113,132,.7); }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(17,29,48,.75); cursor: pointer; transition: .2s ease; }
.icon-button:hover { border-color: rgba(56,226,159,.38); color: var(--green); transform: translateY(-1px); }
.icon-button.loading span { animation: rotate .85s linear infinite; }
.admin-link, .ghost-button { padding: .55rem .9rem; border: 1px solid var(--line-strong); border-radius: 10px; text-decoration: none; font-size: .78rem; font-weight: 650; background: rgba(17,29,48,.72); transition: .2s ease; }
.admin-link:hover, .ghost-button:hover { border-color: rgba(56,226,159,.4); color: var(--green); }

.page-shell { width: min(1440px, calc(100% - clamp(2rem, 7vw, 8rem))); margin: 0 auto; padding: 3.8rem 0 4rem; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 3rem; margin-bottom: 2rem; }
.eyebrow, .section-kicker { color: var(--green); font-size: .75rem; letter-spacing: .2em; font-weight: 800; }
.eyebrow { display: flex; align-items: center; gap: .55rem; margin-bottom: .78rem; }
.eyebrow span { width: 22px; height: 1px; background: var(--green); box-shadow: 0 0 9px rgba(56,226,159,.7); }
.hero h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.65rem); line-height: 1; letter-spacing: -.045em; }
.hero h1 span { color: var(--green); margin-left: .18em; }
.hero p { max-width: 690px; margin: 1.05rem 0 0; color: var(--muted); font-size: .94rem; line-height: 1.8; }
.hero-meta { display: grid; min-width: 230px; border-left: 1px solid var(--line); padding-left: 1.35rem; gap: .9rem; }
.hero-meta div { display: flex; flex-direction: column; gap: .25rem; }
.hero-meta span { color: var(--muted); font-size: .75rem; }
.hero-meta strong { font-size: .8rem; color: var(--muted-bright); font-weight: 600; }

.status-strip { min-height: 76px; display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2.2rem); margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(100deg, rgba(16,28,46,.9), rgba(12,21,36,.72)); box-shadow: 0 12px 40px rgba(0,0,0,.12); }
.system-state, .mini-state { display: flex; align-items: center; gap: .75rem; }
.system-state { min-width: 180px; }
.system-state small, .mini-state small, .control-card small, .revision-card small { display: block; color: var(--muted); font-size: .75rem; margin-bottom: .22rem; }
.system-state strong, .mini-state strong { display: block; font-size: .78rem; }
.state-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 5px rgba(140,156,175,.08); }
.state-dot.active { background: var(--green); box-shadow: 0 0 0 5px rgba(56,226,159,.1), 0 0 14px rgba(56,226,159,.45); }
.state-dot.paused { background: var(--amber); box-shadow: 0 0 0 5px rgba(245,185,94,.1), 0 0 14px rgba(245,185,94,.35); }
.strip-divider { width: 1px; align-self: stretch; background: var(--line); }
.mini-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--green); border: 1px solid rgba(56,226,159,.16); border-radius: 9px; background: rgba(56,226,159,.06); }
.source-badge { margin-left: auto; padding: .43rem .68rem; font-size: .75rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.metric-card, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(16,27,45,.88), rgba(12,21,36,.78)); box-shadow: 0 15px 55px rgba(0,0,0,.14); }
.metric-card { min-height: 154px; padding: 1.25rem 1.3rem; border-radius: var(--radius); position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; inset: auto -45px -70px auto; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, rgba(67,200,245,.06), transparent 67%); }
.accent-card { border-color: rgba(56,226,159,.24); background: linear-gradient(145deg, rgba(18,42,47,.85), rgba(13,26,39,.82)); }
.accent-card::after { background: radial-gradient(circle, rgba(56,226,159,.14), transparent 68%); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.metric-symbol { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-style: normal; color: var(--green); background: rgba(56,226,159,.08); }
.metric-symbol.cyan { color: var(--cyan); background: rgba(67,200,245,.08); }
.metric-symbol.violet { color: var(--violet); background: rgba(165,138,247,.08); }
.metric-symbol.amber { color: var(--amber); background: rgba(245,185,94,.08); }
.metric-card > strong { display: block; margin-top: .55rem; font-size: 2.05rem; letter-spacing: -.035em; }
.metric-foot { display: flex; align-items: center; gap: .42rem; margin-top: .42rem; color: var(--muted); font-size: .75rem; }
.positive-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

.overview-grid { display: grid; grid-template-columns: .95fr 1.25fr; gap: 1rem; margin-bottom: 1rem; }
.data-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 1rem; margin-bottom: 1rem; }
.panel { border-radius: var(--radius); padding: 1.35rem; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.panel-heading h2 { margin: .24rem 0 0; font-size: .98rem; letter-spacing: -.01em; }
.soft-badge, .count-badge { padding: .38rem .65rem; font-size: .75rem; }
.soft-badge.running { color: var(--green); border-color: rgba(56,226,159,.18); background: rgba(56,226,159,.07); }
.soft-badge.paused { color: var(--amber); border-color: rgba(245,185,94,.18); background: rgba(245,185,94,.07); }
.progress-content { display: flex; align-items: center; justify-content: center; gap: clamp(1.4rem, 3vw, 3rem); min-height: 192px; }
.progress-ring-wrap { width: 148px; height: 148px; position: relative; flex: 0 0 auto; }
.progress-ring { width: 148px; height: 148px; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: rgba(140,156,175,.1); }
.ring-value { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 364.425; stroke-dashoffset: 364.425; filter: drop-shadow(0 0 7px rgba(56,226,159,.35)); transition: stroke-dashoffset .7s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-size: 1.65rem; }
.ring-label span { margin-top: .2rem; color: var(--muted); font-size: .75rem; letter-spacing: .15em; }
.progress-detail { flex: 1; min-width: 0; }
.task-ref { color: var(--green); font-size: .75rem; letter-spacing: .08em; }
.progress-detail h3 { margin: .45rem 0 1.15rem; font-size: .94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-numbers { display: flex; align-items: baseline; gap: .35rem; margin-bottom: .6rem; }
.progress-numbers strong { font-size: 1.5rem; }
.progress-numbers span { color: var(--muted-bright); }
.progress-numbers small { margin-left: .4rem; color: var(--muted); font-size: .75rem; }
progress { width: 100%; height: 5px; border: 0; border-radius: 9px; overflow: hidden; background: rgba(140,156,175,.1); }
progress::-webkit-progress-bar { background: rgba(140,156,175,.1); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--green), var(--cyan)); border-radius: 9px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--green), var(--cyan)); }

.chart-legend { display: flex; gap: .75rem; color: var(--muted); font-size: .75rem; }
.chart-legend span { display: flex; align-items: center; gap: .28rem; }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; }
.legend-total { background: rgba(67,200,245,.28); }
.legend-success { background: var(--green); }
.trend-chart { height: 192px; display: flex; align-items: stretch; justify-content: space-between; gap: .7rem; padding-top: .65rem; border-bottom: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 25%; }
.chart-column { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.bars { width: min(35px, 70%); flex: 1; display: flex; align-items: flex-end; gap: 3px; }
.bar { flex: 1; min-height: 2px; border-radius: 4px 4px 1px 1px; transition: height .7s ease; }
.bar.total { background: linear-gradient(180deg, rgba(67,200,245,.5), rgba(67,200,245,.12)); }
.bar.success { background: linear-gradient(180deg, var(--green), rgba(56,226,159,.3)); box-shadow: 0 -4px 12px rgba(56,226,159,.12); }
.bar-value { position: absolute; top: -1.15rem; left: 50%; transform: translateX(-50%); opacity: 0; color: var(--text); font-size: .75rem; transition: .2s; }
.chart-column:hover .bar-value { opacity: 1; }
.bar-label { margin: .65rem 0 -.15rem; color: var(--muted); font-size: .75rem; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: .72rem .7rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; letter-spacing: .06em; font-weight: 600; white-space: nowrap; }
td { padding: .78rem .7rem; border-bottom: 1px solid rgba(155,180,211,.075); color: var(--muted-bright); font-size: .75rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.012); }
td:first-child { color: var(--text); font-weight: 600; }
.status-cell { display: inline-flex; align-items: center; gap: .4rem; }
.status-cell i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.status-cell.enabled i { background: var(--green); box-shadow: 0 0 8px rgba(56,226,159,.55); }
.status-cell.disabled i { background: var(--danger); }
.empty-cell, .empty-state { color: var(--muted); text-align: center; padding: 2.2rem 1rem !important; font-size: .75rem; }
.activity-list { display: flex; flex-direction: column; max-height: 310px; overflow-y: auto; padding-right: .2rem; }
.activity-item { position: relative; display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: .7rem; padding: .67rem 0; border-bottom: 1px solid rgba(155,180,211,.075); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: rgba(56,226,159,.07); font-size: .75rem; }
.activity-icon.failed { color: var(--danger); background: rgba(255,113,132,.07); }
.activity-copy strong { display: block; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.activity-copy span, .activity-time { color: var(--muted); font-size: .75rem; }
.activity-time { text-align: right; }
.live-label { display: flex; align-items: center; gap: .35rem; color: var(--green); font-size: .75rem; letter-spacing: .1em; }
.task-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.task-item { display: flex; align-items: center; gap: .78rem; min-width: 0; padding: .85rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(8,15,27,.38); }
.task-index { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: rgba(56,226,159,.07); font-size: .75rem; }
.task-copy { min-width: 0; flex: 1; }
.task-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .75rem; white-space: nowrap; }
.task-copy span { display: block; margin-top: .28rem; color: var(--muted); font-size: .75rem; }
.task-toggle { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.task-toggle.on { background: var(--green); box-shadow: 0 0 8px rgba(56,226,159,.5); }

.admin-panel { margin-top: 1rem; padding: 1.6rem; border: 1px solid rgba(56,226,159,.22); border-radius: 22px; background: linear-gradient(145deg, rgba(17,38,45,.78), rgba(12,21,36,.9)); box-shadow: var(--shadow); }
.admin-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; }
.admin-heading h2 { margin: .35rem 0 .45rem; font-size: 1.35rem; }
.admin-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.7; }
.ghost-button { cursor: pointer; }
.admin-grid { display: grid; grid-template-columns: 1fr 220px; gap: 1rem; margin-top: 1.5rem; }
.control-card, .revision-card, .health-card { border: 1px solid var(--line); border-radius: 15px; background: rgba(8,15,27,.42); }
.control-card { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 1rem; padding: 1.15rem; }
.control-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--green); background: rgba(56,226,159,.08); font-size: 1.1rem; }
.control-card h3 { margin: .15rem 0 .25rem; font-size: .88rem; }
.control-card p { margin: 0; color: var(--muted); font-size: .75rem; }
.control-button, .primary-button { border: 0; border-radius: 10px; padding: .7rem 1rem; color: #042216; background: linear-gradient(135deg, var(--green), #62f0b9); font-size: .75rem; font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(56,226,159,.13); }
.control-button.resume { color: #2a1900; background: linear-gradient(135deg, var(--amber), #ffd586); }
.control-button:disabled, .primary-button:disabled { opacity: .5; cursor: wait; }
.revision-card { display: flex; flex-direction: column; justify-content: center; padding: 1.15rem; }
.revision-card strong { font-size: 1.6rem; color: var(--green); }
.revision-card span { margin-top: .3rem; color: var(--muted); font-size: .75rem; }
.health-card { margin-top: 1rem; padding: 1.15rem; }
.health-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.health-item { display: flex; align-items: center; gap: .6rem; padding: .7rem; border: 1px solid var(--line); border-radius: 11px; }
.health-item i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--danger); }
.health-item.ok i { background: var(--green); box-shadow: 0 0 7px rgba(56,226,159,.4); }
.health-item strong { display: block; font-size: .75rem; }
.health-item span { display: block; margin-top: .15rem; color: var(--muted); font-size: .75rem; }

footer { width: min(1440px, calc(100% - clamp(2rem, 7vw, 8rem))); margin: 0 auto; padding: 1.2rem 0 2rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .75rem; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; background: rgba(4,8,15,.8); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.login-modal { width: min(430px, 100%); padding: 2.3rem; border: 1px solid rgba(56,226,159,.22); border-radius: 24px; background: linear-gradient(155deg, #121f31, #0b1422); box-shadow: 0 35px 100px rgba(0,0,0,.5); }
.login-mark { display: flex; margin-bottom: 1.5rem; }
.login-modal h2 { margin: .4rem 0 .55rem; font-size: 1.55rem; }
.login-modal > p { margin: 0 0 1.4rem; color: var(--muted); line-height: 1.65; font-size: .75rem; }
.login-modal form { display: flex; flex-direction: column; }
.login-modal label { margin: .7rem 0 .38rem; color: var(--muted-bright); font-size: .75rem; }
.login-modal input { width: 100%; padding: .78rem .85rem; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; color: var(--text); background: rgba(4,10,18,.48); transition: .2s; }
.login-modal input:focus { border-color: rgba(56,226,159,.55); box-shadow: 0 0 0 3px rgba(56,226,159,.07); }
.password-wrap { position: relative; }
.password-wrap button { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); width: 34px; height: 30px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.primary-button { margin-top: .7rem; padding: .82rem; }
.form-error { min-height: 1rem; margin: .55rem 0 0 !important; color: var(--danger) !important; font-size: .75rem !important; }
.back-link { display: block; margin-top: 1.2rem; color: var(--muted); text-align: center; text-decoration: none; font-size: .75rem; }
.back-link:hover { color: var(--green); }
.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90; max-width: min(360px, calc(100vw - 2.4rem)); padding: .8rem 1rem; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--text); background: #142238; box-shadow: var(--shadow); font-size: .75rem; transform: translateY(140%); opacity: 0; transition: .25s ease; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: rgba(255,113,132,.35); }
.noscript { position: fixed; inset: auto 0 0; z-index: 100; padding: .8rem; text-align: center; color: #2a1900; background: var(--amber); font-weight: 700; }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes soft-pulse { 50% { opacity: .58; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid, .data-grid { grid-template-columns: 1fr; }
  .task-list { grid-template-columns: repeat(2, 1fr); }
  .health-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .topbar { height: 68px; padding: 0 1rem; }
  .privacy-pill, .connection-pill span { display: none; }
  .admin-link { display: inline-flex; align-items: center; min-height: 34px; padding: .45rem .58rem; white-space: nowrap; }
  .page-shell { width: calc(100% - 1.5rem); padding-top: 2rem; }
  .hero { display: block; }
  .hero-meta { margin-top: 1.4rem; padding: .8rem 0 0; border-left: 0; border-top: 1px solid var(--line); grid-template-columns: 1fr 1fr; }
  .status-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .strip-divider { display: none; }
  .source-badge { margin-left: 0; justify-self: start; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 140px; padding: 1rem; }
  .metric-card > strong { font-size: 1.65rem; }
  .progress-content { align-items: flex-start; }
  .progress-ring-wrap, .progress-ring { width: 118px; height: 118px; }
  .progress-ring { width: 118px; height: 118px; }
  .task-list { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .health-list { grid-template-columns: repeat(2, 1fr); }
  .control-card { grid-template-columns: 40px 1fr; }
  .control-button { grid-column: 1 / -1; }
  footer { width: calc(100% - 1.5rem); flex-direction: column; }
}
@media (max-width: 480px) {
  .brand { gap: .55rem; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .brand strong { font-size: .9rem; letter-spacing: .01em; }
  .brand small { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: 1fr; }
  .progress-content { flex-direction: column; align-items: center; }
  .progress-detail { width: 100%; text-align: center; }
  .progress-numbers { justify-content: center; }
  .panel { padding: 1rem; }
  .chart-legend { display: none; }
  .health-list { grid-template-columns: 1fr; }
  .admin-heading { flex-direction: column; }
  .login-modal { padding: 1.5rem; }
}

/* Full cloud administration workspace */
.sr-only { position: absolute !important; top: 0 !important; left: 0 !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
body.admin-route .public-section { display: none; }
body.admin-route .page-shell { width: min(1580px, calc(100% - clamp(1.5rem, 4vw, 5rem))); padding-top: 1.65rem; }
body.admin-route footer { width: min(1580px, calc(100% - clamp(1.5rem, 4vw, 5rem))); }
body.admin-route .privacy-pill { color: var(--cyan); border-color: rgba(67,200,245,.2); background: rgba(67,200,245,.06); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(56,226,159,.72); outline-offset: 2px; }
select, textarea { font: inherit; }

.admin-console { margin-top: 0; padding: clamp(1rem, 2vw, 1.65rem); background: linear-gradient(145deg, rgba(13,25,41,.94), rgba(9,17,30,.94)); }
.console-heading { align-items: center; padding: .2rem .15rem 1.35rem; }
.console-heading h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); }
.admin-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; flex-wrap: wrap; }
.config-sync-state { display: inline-flex; align-items: center; gap: .45rem; padding: .57rem .72rem; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(8,15,27,.4); font-size: .75rem; }
.config-sync-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px rgba(245,185,94,.45); }
.config-sync-state.online { color: #9feaca; border-color: rgba(56,226,159,.18); }
.config-sync-state.online i { background: var(--green); box-shadow: 0 0 8px rgba(56,226,159,.55); }
.config-sync-state.error { color: #ffabb6; border-color: rgba(255,113,132,.22); }
.config-sync-state.error i { background: var(--danger); }
.danger-ghost:hover { color: var(--danger) !important; border-color: rgba(255,113,132,.35) !important; }

.admin-tabs { display: flex; align-items: center; gap: .35rem; overflow-x: auto; padding: .42rem; margin: 0 0 1.15rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(5,11,20,.42); scrollbar-width: thin; }
.admin-tab { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; flex: 1 0 auto; min-width: 94px; padding: .66rem .72rem; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; font-size: .75rem; font-weight: 700; cursor: pointer; transition: .2s ease; }
.admin-tab > span { color: var(--muted-bright); font-size: .8rem; }
.admin-tab:hover { color: var(--text); background: rgba(255,255,255,.025); }
.admin-tab.active { color: #c8f9e3; border-color: rgba(56,226,159,.22); background: linear-gradient(135deg, rgba(56,226,159,.12), rgba(67,200,245,.05)); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.admin-tab.active > span { color: var(--green); }
.admin-tab-panel { min-height: 430px; padding: .25rem .1rem .1rem; }
.admin-tab-panel:not(.active) { display: none; }
.admin-loading { min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--muted-bright); font-size: .75rem; }
.loading-orbit { width: 48px; height: 48px; border: 2px solid rgba(56,226,159,.12); border-top-color: var(--green); border-radius: 50%; animation: rotate .9s linear infinite; box-shadow: inset 0 0 18px rgba(56,226,159,.05); }
.admin-data-error { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 .85rem; padding: .78rem .9rem; border: 1px solid rgba(255,113,132,.34); border-radius: 12px; background: rgba(255,113,132,.075); }
.admin-data-error[hidden] { display: none; }
.admin-data-error > div { min-width: 0; }
.admin-data-error strong { display: block; color: #ffb1bd; font-size: .8rem; }
.admin-data-error p { margin: .2rem 0 0; color: var(--muted-bright); font-size: .75rem; line-height: 1.55; overflow-wrap: anywhere; }
.admin-data-error .row-button { flex: 0 0 auto; }
.admin-data-error.feed-error { border-color: rgba(245,185,94,.32); background: rgba(245,185,94,.07); }
.admin-data-error.feed-error strong { color: #ffd492; }

.console-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.console-stats article { display: flex; align-items: center; gap: .8rem; min-height: 98px; padding: 1rem; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(140deg, rgba(14,27,44,.8), rgba(8,16,29,.58)); }
.console-stats article > div { min-width: 0; }
.console-stats small { display: block; color: var(--muted); font-size: .75rem; }
.console-stats strong { display: block; margin: .12rem 0; font-size: 1.45rem; }
.console-stats article > div > span { display: block; overflow: hidden; color: var(--muted); font-size: .75rem; white-space: nowrap; text-overflow: ellipsis; }
.stat-icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--green); background: rgba(56,226,159,.08); }
.stat-icon.cyan { color: var(--cyan); background: rgba(67,200,245,.08); }
.stat-icon.violet { color: var(--violet); background: rgba(165,138,247,.08); }
.stat-icon.amber { color: var(--amber); background: rgba(245,185,94,.08); }
.onboarding-hub { margin: 1rem 0 .1rem; padding: 1rem 0 1.15rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.onboarding-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem; }
.onboarding-heading h2 { margin: .25rem 0 .35rem; font-size: 1.05rem; }
.onboarding-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.6; }
.onboarding-progress { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: .15rem .45rem; min-width: 180px; }
.onboarding-progress strong { color: var(--green); font-size: 1rem; }
.onboarding-progress span { color: var(--muted); font-size: .75rem; }
.onboarding-progress progress { grid-column: 1 / -1; width: 100%; height: 7px; margin-top: .35rem; overflow: hidden; border: 0; border-radius: 999px; background: rgba(155,180,211,.12); accent-color: var(--green); }
.onboarding-progress progress::-webkit-progress-bar { background: rgba(155,180,211,.12); }
.onboarding-progress progress::-webkit-progress-value { border-radius: 999px; background: var(--green); }
.onboarding-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: 1.1rem; margin-top: 1rem; }
.onboarding-checklist { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.onboarding-step { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: .7rem; min-height: 62px; padding: .55rem .65rem; border-left: 3px solid rgba(245,185,94,.38); background: rgba(245,185,94,.035); }
.onboarding-step.complete { border-left-color: rgba(56,226,159,.7); background: rgba(56,226,159,.035); }
.onboarding-step-marker { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid rgba(245,185,94,.26); border-radius: 50%; color: var(--amber); background: rgba(245,185,94,.06); font-size: .75rem; font-weight: 850; }
.onboarding-step.complete .onboarding-step-marker { color: #07170f; border-color: rgba(56,226,159,.6); background: var(--green); }
.onboarding-step-copy { min-width: 0; }
.onboarding-step-copy strong, .onboarding-step-copy small { display: block; overflow-wrap: anywhere; }
.onboarding-step-copy strong { color: var(--text); font-size: .8rem; }
.onboarding-step-copy small { margin-top: .16rem; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.onboarding-next { min-width: 0; padding-left: 1rem; border-left: 1px solid var(--line); }
.onboarding-next h3 { margin: .55rem 0 .35rem; font-size: .95rem; }
.onboarding-next > p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.onboarding-actions { display: flex; align-items: stretch; gap: .45rem; margin-top: .8rem; }
.onboarding-actions > * { flex: 1; }
.onboarding-safety { display: grid; gap: .35rem; margin: .9rem 0 0; padding-top: .75rem; border-top: 1px solid var(--line); }
.onboarding-safety div { display: flex; justify-content: space-between; gap: .7rem; font-size: .75rem; }
.onboarding-safety dt { color: var(--muted); }
.onboarding-safety dd { margin: 0; color: var(--muted-bright); text-align: right; overflow-wrap: anywhere; }
.queue-create-help { margin: -.55rem 0 .75rem; padding: .58rem .68rem; border-left: 3px solid rgba(245,185,94,.55); color: var(--muted-bright); background: rgba(245,185,94,.045); font-size: .75rem; line-height: 1.55; }
.queue-create-help[data-state="ready"] { border-left-color: rgba(56,226,159,.62); color: #a9e8cc; background: rgba(56,226,159,.045); }
#queue-create-button:disabled { cursor: not-allowed; }
.overview-lower-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 1rem; }
.cloud-card { margin-top: 1rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(8,15,27,.42); }
.cloud-card h2 { margin: .25rem 0 1rem; font-size: .98rem; }
.cloud-facts { margin: 0; }
.cloud-facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .67rem 0; border-bottom: 1px solid rgba(155,180,211,.08); font-size: .75rem; }
.cloud-facts div:last-child { border-bottom: 0; }
.cloud-facts dt { color: var(--muted); }
.cloud-facts dd { margin: 0; color: var(--muted-bright); text-align: right; }
.cloud-facts .secure-text { color: var(--green); }
.cloud-facts #config-last-error:not(:empty) { max-width: 190px; overflow: hidden; color: var(--amber); text-overflow: ellipsis; white-space: nowrap; }
.persistence-actions { display: flex; gap: .45rem; margin-top: .85rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.persistence-actions .row-button { flex: 1; }
.persistence-scope-note { margin: .8rem 0 0; padding: .62rem .68rem; border: 1px solid rgba(241,185,73,.24); border-radius: 10px; color: var(--muted-bright); background: rgba(241,185,73,.055); font-size: .75rem; line-height: 1.5; }
.cloud-transfer-actions { margin-top: .45rem; padding-top: 0; border-top: 0; }
.file-row-button { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.file-row-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.persistence-tier { margin-top: .9rem; padding: .85rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(5,12,22,.38); }
.persistence-tier-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.persistence-tier-heading h3 { margin: .22rem 0 0; color: var(--text); font-size: .86rem; }
.persistence-version-tag, .scope-pill { display: inline-flex; align-items: center; width: fit-content; padding: .2rem .38rem; border: 1px solid rgba(56,226,159,.24); border-radius: 999px; color: #a8f3d0; background: rgba(56,226,159,.07); font-size: .75rem; font-weight: 850; letter-spacing: .07em; }
.persistence-version-tag.legacy { color: var(--muted-bright); border-color: var(--line-strong); background: rgba(155,180,211,.055); }
.scope-pill { color: var(--muted-bright); border-color: var(--line); background: rgba(155,180,211,.045); letter-spacing: 0; }
.scope-pill.full { color: #bceeff; border-color: rgba(67,200,245,.24); background: rgba(67,200,245,.065); }
.full-snapshot-tier { border-color: rgba(56,226,159,.2); background: linear-gradient(145deg, rgba(56,226,159,.035), rgba(67,200,245,.025)); }
.full-snapshot-intro, .full-snapshot-restart-note { margin: .65rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.full-snapshot-scope { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.full-snapshot-scope span { padding: .25rem .42rem; border: 1px solid rgba(67,200,245,.16); border-radius: 7px; color: var(--muted-bright); background: rgba(67,200,245,.04); font-size: .75rem; }
.full-snapshot-gate { display: grid; grid-template-columns: 1fr auto; gap: .18rem .6rem; margin-top: .7rem; padding: .62rem .68rem; border: 1px solid rgba(245,185,94,.22); border-radius: 10px; background: rgba(245,185,94,.055); }
.full-snapshot-gate strong, .full-snapshot-gate span { min-width: 0; overflow-wrap: anywhere; }
.full-snapshot-gate strong { color: #ffe0a1; font-size: .75rem; }
.full-snapshot-gate span { grid-column: 1; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.full-snapshot-gate .text-button { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #ffd68b; }
.full-snapshot-gate[data-state="ready"] { border-color: rgba(56,226,159,.24); background: rgba(56,226,159,.055); }
.full-snapshot-gate[data-state="ready"] strong { color: #a8f3d0; }
.full-snapshot-actions { align-items: stretch; }
.full-snapshot-actions .primary-button { flex: 1; margin: 0; }
.full-snapshot-list-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .85rem; font-size: .75rem; }
.full-snapshot-list-heading span { color: var(--muted); }
.full-snapshot-list { display: grid; gap: .42rem; max-height: 260px; margin-top: .5rem; overflow-y: auto; scrollbar-width: thin; }
.full-snapshot-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .55rem; padding: .58rem .62rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(5,12,22,.48); cursor: pointer; }
.full-snapshot-row:hover { border-color: rgba(67,200,245,.28); }
.full-snapshot-row.selected { border-color: rgba(56,226,159,.38); background: rgba(56,226,159,.055); box-shadow: inset 0 0 0 1px rgba(56,226,159,.08); }
.full-snapshot-row input { accent-color: var(--green); }
.full-snapshot-row-copy { min-width: 0; }
.full-snapshot-row-copy strong, .full-snapshot-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.full-snapshot-row-copy strong { color: var(--text); font-size: .75rem; }
.full-snapshot-row-copy small { margin-top: .15rem; color: var(--muted); font-size: .75rem; }
.full-snapshot-empty { margin: 0; padding: .75rem; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: .75rem; text-align: center; }
.full-snapshot-empty.error, .full-snapshot-status.error { color: #ffb6c0; border-color: rgba(255,113,132,.25); }
.full-snapshot-empty.loading { animation: soft-pulse 1.2s ease-in-out infinite; }
.full-snapshot-status { min-height: 1em; margin: .42rem 0 0; color: var(--muted); font-size: .75rem; }
.full-snapshot-restore { width: 100%; margin-top: .35rem; }
.full-snapshot-restart-note { padding-left: .55rem; border-left: 2px solid rgba(245,185,94,.35); color: var(--muted-bright); }
:is(.settings-form, .entity-form-fields, .automation-rules-form) :is(input, select, textarea):disabled { opacity: .72; cursor: not-allowed; }

.resource-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.4rem; margin: .55rem .2rem 1.15rem; }
.resource-heading h2 { margin: .28rem 0 .35rem; font-size: 1.2rem; }
.resource-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.65; }
.primary-button.compact { flex: 0 0 auto; margin: 0; padding: .7rem .9rem; }
.resource-toolbar { display: flex; align-items: center; gap: .75rem; min-height: 54px; margin-bottom: .75rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(7,14,25,.42); }
.group-category-summary { display: flex; flex-wrap: wrap; gap: .48rem; margin: 0 0 .65rem; }
.group-category-chip { display: inline-flex; align-items: center; gap: .48rem; min-height: 36px; padding: .42rem .58rem .42rem .7rem; border: 1px solid var(--line); border-radius: 10px; color: var(--muted-bright); background: rgba(7,14,25,.42); font-size: .75rem; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.group-category-chip strong { display: grid; place-items: center; min-width: 24px; height: 22px; padding: 0 .34rem; border-radius: 999px; color: var(--cyan); background: rgba(67,200,245,.08); font-size: .75rem; }
.group-category-chip:hover { color: var(--text); border-color: rgba(67,200,245,.3); background: rgba(67,200,245,.045); }
.group-category-chip:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.group-category-chip[aria-pressed="true"] { color: #b9f6da; border-color: rgba(56,226,159,.35); background: rgba(56,226,159,.08); }
.group-category-chip[aria-pressed="true"] strong { color: #06140e; background: var(--green); }
.search-field { display: flex; align-items: center; gap: .55rem; flex: 1; min-width: 150px; color: var(--muted); }
.search-field input { width: 100%; padding: .53rem .2rem; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .75rem; }
.search-field input::placeholder { color: #66768a; }
.compact-select { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .75rem; }
.compact-select select { padding: .45rem 1.8rem .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-bright); background: #0e192a; font-size: .75rem; }
.resource-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,14,25,.36); }
.resource-table { min-width: 760px; }
.groups-resource-table { min-width: 980px; }
.resource-table th { padding: .86rem .85rem; background: rgba(15,27,45,.52); }
.resource-table td { padding: .82rem .85rem; }
.resource-table tbody tr { transition: background .15s ease; }
.resource-table tbody tr:hover { background: rgba(255,255,255,.012); }
.resource-table .group-category-row:hover { background: transparent; }
.group-category-row td { padding: .6rem .85rem; border-top: 1px solid rgba(67,200,245,.12); border-bottom: 1px solid rgba(67,200,245,.1); background: rgba(67,200,245,.035); }
.group-category-row:first-child td { border-top: 0; }
.group-category-row strong { color: var(--cyan); font-size: .75rem; }
.group-category-row small { margin-left: .5rem; color: var(--muted); font-size: .75rem; font-weight: 500; }
.resource-table .empty-cell { height: 240px; }
.identity-cell { display: flex; align-items: center; gap: .65rem; min-width: 150px; }
.identity-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--green); background: linear-gradient(135deg, rgba(56,226,159,.12), rgba(67,200,245,.06)); font-size: .75rem; font-weight: 800; }
.identity-cell strong, .primary-cell strong { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.identity-cell small, .primary-cell small { display: block; max-width: 260px; margin-top: .2rem; overflow: hidden; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; }
.tag-row { display: flex; flex-wrap: wrap; gap: .28rem; }
.mini-tag { display: inline-flex; align-items: center; padding: .24rem .42rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-bright); background: rgba(255,255,255,.018); font-size: .75rem; font-weight: 500; }
.mini-tag.test { color: var(--cyan); border-color: rgba(67,200,245,.22); background: rgba(67,200,245,.06); }
.mini-tag.category { color: #c7bcff; border-color: rgba(165,138,247,.23); background: rgba(165,138,247,.065); }
.mini-tag.secure { color: var(--green); border-color: rgba(56,226,159,.2); background: rgba(56,226,159,.05); }
.mini-tag.warning { color: var(--amber); border-color: rgba(245,185,94,.2); background: rgba(245,185,94,.05); }
.mini-tag.info { color: #75d9f7; border-color: rgba(67,200,245,.24); background: rgba(67,200,245,.07); }
.mini-tag.danger { color: #ffabb6; border-color: rgba(255,113,132,.28); background: rgba(255,113,132,.07); }
.account-login-status { display: grid; gap: .32rem; min-width: 220px; margin-top: .48rem; }
.account-login-status-labels { display: flex; flex-wrap: wrap; gap: .28rem; }
.account-login-status-detail { display: block; max-width: 320px; color: var(--muted); font-size: .75rem; line-height: 1.5; text-wrap: pretty; }
.account-login-status.verified .account-login-status-detail { color: #94cfb7; }
.account-login-status.reauth .account-login-status-detail,
.account-login-status.missing .account-login-status-detail { color: #e6a8b1; }
.account-network-status { display: grid; gap: .24rem; min-width: 180px; }
.account-network-status > strong { color: var(--muted-bright); font-size: .8rem; line-height: 1.35; }
.account-network-status > small { display: block; max-width: 290px; color: var(--muted); font-size: .75rem; line-height: 1.45; text-wrap: pretty; }
.account-network-status.account > strong { color: #75d9f7; }
.account-enabled-state { display: grid; gap: .24rem; min-width: 100px; }
.account-enabled-state > small { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.entity-status { display: inline-flex; align-items: center; gap: .38rem; color: var(--muted); font-size: .75rem; }
.entity-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.entity-status.enabled { color: #a9e9cc; }
.entity-status.enabled i { background: var(--green); box-shadow: 0 0 7px rgba(56,226,159,.48); }
.entity-status.failed { color: #ffabb6; }
.entity-status.failed i { background: var(--danger); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.row-button { padding: .42rem .55rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-bright); background: rgba(15,27,45,.55); font-size: .75rem; cursor: pointer; }
.row-button:hover { color: var(--green); border-color: rgba(56,226,159,.28); }
.row-button.danger:hover { color: var(--danger); border-color: rgba(255,113,132,.3); }

.settings-form { display: grid; gap: .85rem; }
.settings-card { min-width: 0; margin: 0; padding: 1.15rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(7,14,25,.38); }
.settings-card legend { display: flex; align-items: center; gap: .65rem; padding: 0 .35rem; font-size: .75rem; font-weight: 750; }
.settings-card legend > span:last-child { display: flex; flex-direction: column; gap: .15rem; }
.settings-card legend small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.settings-icon { width: 32px; height: 32px; display: grid !important; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--green); background: rgba(56,226,159,.07); }
.settings-icon.cyan { color: var(--cyan); background: rgba(67,200,245,.07); }
.settings-icon.violet { color: var(--violet); background: rgba(165,138,247,.07); }
.settings-icon.amber { color: var(--amber); background: rgba(245,185,94,.07); }
.form-grid { display: grid; gap: .8rem; margin-top: .75rem; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid label, .full-field, .entity-field { display: flex; flex-direction: column; gap: .4rem; color: var(--muted-bright); font-size: .75rem; }
.form-grid input, .form-grid select, .form-grid textarea, .full-field textarea, .entity-field input, .entity-field select, .entity-field textarea { width: 100%; min-height: 41px; padding: .64rem .72rem; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--text); background: #0a1422; font-size: .75rem; transition: .18s ease; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .full-field textarea:focus, .entity-field input:focus, .entity-field select:focus, .entity-field textarea:focus { border-color: rgba(56,226,159,.48); box-shadow: 0 0 0 3px rgba(56,226,159,.055); }
.form-grid .full-field { grid-column: 1 / -1; }
.form-grid select, .entity-field select { color-scheme: inherit; }
.toggle-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .9rem; }
.switch-field { display: inline-flex; align-items: center; gap: .6rem; flex: 1 1 210px; min-height: 56px; padding: .68rem .76rem; border: 1px solid var(--line); border-radius: 10px; color: var(--muted-bright); font-size: .75rem; cursor: pointer; background: rgba(255,255,255,.012); }
.switch-field input { position: absolute; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; }
.switch-control { position: relative; width: 34px; height: 19px; flex: 0 0 auto; border-radius: 999px; background: #263448; transition: .2s; }
.switch-control::after { content: ""; position: absolute; width: 13px; height: 13px; left: 3px; top: 3px; border-radius: 50%; background: #8695a8; transition: .2s; }
.switch-field input:checked + .switch-control { background: rgba(56,226,159,.3); box-shadow: inset 0 0 0 1px rgba(56,226,159,.35); }
.switch-field input:checked + .switch-control::after { left: 18px; background: var(--green); box-shadow: 0 0 7px rgba(56,226,159,.55); }
.switch-field input:focus-visible + .switch-control { outline: 2px solid rgba(56,226,159,.68); outline-offset: 2px; }
.switch-field > span:last-child { display: flex; flex-direction: column; gap: .16rem; }
.switch-field small { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.switch-field.locked { opacity: .74; cursor: not-allowed; }
.advanced-card textarea { resize: vertical; min-height: 180px; color: #bcefd7; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.5; tab-size: 2; }
.field-help { margin: .6rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.telegram-test-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .65rem 1rem; margin-top: .9rem; padding: .85rem; border: 1px solid rgba(67,200,245,.2); border-radius: 12px; background: linear-gradient(145deg, rgba(67,200,245,.07), rgba(56,226,159,.035)); }
.telegram-test-copy strong { color: var(--text); font-size: .78rem; }
.telegram-test-copy p { margin: .28rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.telegram-test-actions { display: grid; gap: .45rem; min-width: 230px; }
.telegram-test-status { grid-column: 1 / -1; margin: 0; padding-top: .6rem; border-top: 1px solid var(--line); color: var(--muted-bright); font-size: .75rem; line-height: 1.5; }
.telegram-test-status[data-state="working"] { color: var(--cyan); }
.telegram-test-status[data-state="success"] { color: var(--green); }
.telegram-test-status[data-state="warning"] { color: var(--amber); }
.telegram-test-status[data-state="error"] { color: #ffabb6; }
.health-backoff-guide { margin-top: .9rem; padding: .85rem; border: 1px solid rgba(245,185,94,.18); border-radius: 13px; background: linear-gradient(145deg, rgba(245,185,94,.055), rgba(56,226,159,.025)); }
.health-backoff-guide > div:first-child { display: flex; align-items: flex-start; gap: .65rem; }
.health-backoff-guide > div:first-child > div { min-width: 0; }
.health-backoff-guide strong { font-size: .75rem; }
.health-backoff-guide p { margin: .28rem 0 0; color: var(--muted-bright); font-size: .75rem; line-height: 1.6; }
.health-backoff-grid { margin-top: .75rem; }
.sticky-save { position: sticky; bottom: .7rem; z-index: 12; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: .7rem .8rem; border: 1px solid rgba(56,226,159,.18); border-radius: 12px; background: rgba(10,20,34,.94); box-shadow: 0 15px 45px rgba(0,0,0,.3); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sticky-save > span { margin-right: auto; color: var(--muted); font-size: .75rem; }

.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.package-card { display: flex; flex-direction: column; min-height: 220px; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(13,26,43,.72), rgba(7,14,25,.45)); }
.package-card-top { display: flex; justify-content: space-between; gap: .8rem; }
.package-card h3 { margin: .2rem 0 .35rem; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.package-card .package-copy { display: -webkit-box; min-height: 54px; margin: .75rem 0; overflow: hidden; color: var(--muted-bright); font-size: .75rem; line-height: 1.55; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.package-meta { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid rgba(155,180,211,.08); color: var(--muted); font-size: .75rem; }
.package-actions { display: flex; gap: .35rem; margin-top: .65rem; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: .9rem; }
.upload-card, .asset-library-card { padding: 1.15rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(7,14,25,.38); }
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; margin: .9rem 0; padding: 1.2rem; border: 1px dashed rgba(56,226,159,.3); border-radius: 14px; text-align: center; background: radial-gradient(circle at 50% 15%, rgba(56,226,159,.07), transparent 65%); cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: rgba(56,226,159,.68); background-color: rgba(56,226,159,.025); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: .75rem; border: 1px solid rgba(56,226,159,.2); border-radius: 14px; color: var(--green); background: rgba(56,226,159,.07); font-size: 1.2rem; }
.drop-zone strong { font-size: .75rem; }
.drop-zone small { max-width: 420px; margin-top: .4rem; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.inline-switch { margin-bottom: .8rem; }
.selected-files { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.selected-file { display: grid; grid-template-columns: 1fr auto; gap: .35rem .8rem; padding: .58rem .65rem; border: 1px solid var(--line); border-radius: 9px; font-size: .75rem; }
.selected-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file span { color: var(--muted); }
.selected-file progress { grid-column: 1 / -1; height: 4px; }
.selected-file.success { border-color: rgba(56,226,159,.2); }
.selected-file.failed { border-color: rgba(255,113,132,.25); }
.asset-list { display: flex; flex-direction: column; gap: .5rem; max-height: 520px; overflow-y: auto; }
.asset-item { display: grid; grid-template-columns: 38px 1fr auto auto; align-items: center; gap: .65rem; padding: .62rem; border: 1px solid var(--line); border-radius: 10px; }
.asset-type-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--cyan); background: rgba(67,200,245,.07); font-size: .75rem; }
.asset-item strong { display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
.asset-item small { display: block; margin-top: .2rem; color: var(--muted); font-size: .75rem; }

.queue-list { display: flex; flex-direction: column; gap: .65rem; }
.queue-list[data-stale="true"] .queue-card, .resource-table tbody[data-stale="true"] tr:not(.group-category-row) { border-color: rgba(245,185,94,.22); background-image: linear-gradient(rgba(245,185,94,.018), rgba(245,185,94,.018)); }
.queue-runtime-banner { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .75rem; padding: .78rem .9rem; border: 1px solid rgba(255,190,92,.3); border-radius: 12px; background: rgba(255,190,92,.065); }
.queue-runtime-banner[hidden] { display: none; }
.queue-runtime-banner[data-state="unhealthy"] { border-color: rgba(255,113,132,.32); background: rgba(255,113,132,.065); }
.queue-runtime-banner > div { min-width: 0; }
.queue-runtime-banner strong, .queue-runtime-banner span { display: block; }
.queue-runtime-banner strong { color: #ffd492; font-size: .75rem; }
.queue-runtime-banner[data-state="unhealthy"] strong { color: #ff9dac; }
.queue-runtime-banner span { margin-top: .2rem; color: var(--muted-bright); font-size: .75rem; line-height: 1.5; }
.queue-runtime-banner .row-button { flex: 0 0 auto; }
.queue-runtime-actions { display: flex; flex: 0 0 auto; gap: .4rem; }
.queue-card { display: grid; grid-template-columns: minmax(190px, .9fr) minmax(260px, 1.4fr) auto; align-items: center; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(7,14,25,.38); }
.queue-primary strong { display: block; font-size: .75rem; }
.queue-primary small { display: block; margin-top: .22rem; color: var(--muted); font-size: .75rem; }
.queue-primary .queue-operation-title { color: #d8f7ff; font-size: .86rem; }
.queue-primary .queue-operation-detail { max-width: 34rem; color: #9bdcf2; line-height: 1.5; }
.queue-progress { min-width: 0; }
.queue-progress-top { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .42rem; color: var(--muted); font-size: .75rem; }
.queue-progress progress { height: 5px; }
.queue-error { display: block; max-width: 620px; margin-top: .5rem; padding: .52rem .58rem; border: 1px solid rgba(255,113,132,.24); border-radius: 9px; color: #ffb2bd; background: rgba(255,113,132,.055); white-space: normal; }
.task-error-panel { display: grid; gap: .18rem; min-width: 0; line-height: 1.5; }
.task-error-panel strong, .task-error-panel span, .task-error-panel small { display: block; overflow-wrap: anywhere; }
.task-error-summary { color: #ffc2ca; font-size: .75rem; }
.task-error-stage { color: #ffd9de; font-size: .75rem; font-weight: 650; }
.task-error-detail { color: var(--muted-bright); font-size: .75rem; }
.task-error-retry { margin-top: .08rem; color: #ffd492; font-size: .75rem; }
.task-error-panel.compact { gap: .14rem; min-width: 220px; }
.task-error-panel.compact .task-error-summary { font-size: .75rem; }
.task-error-panel.compact .task-error-stage, .task-error-panel.compact .task-error-detail, .task-error-panel.compact .task-error-retry { font-size: .75rem; }
.queue-notice { display: block; max-width: 620px; margin-top: .5rem; padding: .52rem .58rem; border: 1px solid rgba(67,200,245,.24); border-radius: 9px; color: #b9edf8; background: rgba(67,200,245,.055); white-space: normal; }
.task-notice-panel { display: grid; gap: .18rem; min-width: 0; line-height: 1.5; }
.task-notice-panel strong, .task-notice-panel span, .task-notice-panel small { display: block; overflow-wrap: anywhere; }
.task-notice-summary { color: #d8f7ff; font-size: .75rem; }
.task-notice-detail { color: var(--muted-bright); font-size: .75rem; }
.task-notice-resume { color: #9bdcf2; font-size: .75rem; }
.queue-formatting-evidence { display: flex; flex-wrap: wrap; gap: .22rem .55rem; max-width: 620px; margin-top: .48rem; padding: .44rem .54rem; border: 1px solid rgba(67,200,245,.2); border-radius: 8px; color: #b9edf8; background: rgba(67,200,245,.045); font-size: .75rem; line-height: 1.45; }
.queue-formatting-evidence strong { color: #d8f7ff; }
.queue-formatting-evidence.partial { border-color: rgba(255,190,92,.24); color: #ffe0a7; background: rgba(255,190,92,.045); }
.queue-formatting-evidence.partial strong { color: #ffd492; }
.queue-blocked-reason { display: block; max-width: 620px; margin-top: .48rem; padding: .42rem .5rem; border: 1px solid rgba(255,190,92,.22); border-radius: 8px; color: #ffd492; background: rgba(255,190,92,.045); font-size: .75rem; line-height: 1.5; }
.queue-event-timeline { display: flex; flex-wrap: wrap; gap: .28rem; margin-top: .48rem; }
.queue-event-chip { display: inline-flex; padding: .22rem .38rem; border: 1px solid rgba(67,200,245,.16); border-radius: 999px; color: #9bdcf2; background: rgba(67,200,245,.045); font-size: .75rem; }
.queue-actions { display: flex; justify-content: flex-end; gap: .35rem; flex-wrap: wrap; max-width: 210px; }

.audit-table td:nth-child(6) { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.audit-result { display: inline-flex; padding: .24rem .42rem; border-radius: 999px; color: var(--green); background: rgba(56,226,159,.07); font-size: .75rem; }
.audit-result.failed { color: var(--danger); background: rgba(255,113,132,.07); }

.entity-backdrop { align-items: flex-start; overflow-y: auto; padding: clamp(1rem, 5vh, 3rem) 1rem; }
.entity-modal { width: min(760px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; padding: 1.35rem; border: 1px solid rgba(56,226,159,.2); border-radius: 20px; background: linear-gradient(155deg, #121f31, #0b1422); box-shadow: 0 35px 100px rgba(0,0,0,.52); }
.entity-modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.entity-modal-heading h2 { margin: .3rem 0 .3rem; font-size: 1.25rem; }
.entity-modal-heading p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.modal-close { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-bright); background: rgba(7,14,25,.45); font-size: 1.15rem; cursor: pointer; }
.entity-form-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; padding: 1rem 0 .25rem; }
.entity-field.full { grid-column: 1 / -1; }
.entity-field textarea { min-height: 105px; resize: vertical; line-height: 1.5; }
.resource-json-field { margin-top: .2rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.resource-json-field textarea { min-height: 180px; color: #bcefd7; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; tab-size: 2; }
.entity-field small { color: var(--muted); font-size: .75rem; line-height: 1.5; }
.entity-checkboxes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; max-height: 150px; overflow-y: auto; padding: .6rem; border: 1px solid var(--line-strong); border-radius: 9px; background: #0a1422; }
.entity-checkboxes label { display: flex; align-items: center; gap: .45rem; min-width: 0; color: var(--muted-bright); font-size: .75rem; }
.entity-checkboxes label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-checkboxes input { accent-color: var(--green); }
.entity-form-actions { display: flex; align-items: center; gap: .55rem; margin-top: .8rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.entity-form-actions > span { flex: 1; }
.delete-button { padding: .65rem .8rem; border: 1px solid rgba(255,113,132,.28); border-radius: 9px; color: #ff9ead; background: rgba(255,113,132,.07); font-size: .75rem; font-weight: 700; cursor: pointer; }
.delete-button:hover { border-color: rgba(255,113,132,.55); background: rgba(255,113,132,.11); }
.delete-button:disabled { opacity: .48; cursor: wait; }
.confirm-backdrop { z-index: 95; }
.confirm-modal { width: min(390px, 100%); padding: 1.5rem; border: 1px solid rgba(255,113,132,.24); border-radius: 18px; text-align: center; background: #111d2e; box-shadow: 0 35px 100px rgba(0,0,0,.55); }
.confirm-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto .75rem; border-radius: 13px; color: var(--danger); background: rgba(255,113,132,.08); font-weight: 900; }
.confirm-modal h2 { margin: 0 0 .45rem; font-size: 1.05rem; }
.confirm-modal p { margin: 0 0 1.15rem; color: var(--muted); font-size: .75rem; line-height: 1.6; }
.confirm-modal > div { display: flex; justify-content: center; gap: .55rem; }

@media (max-width: 1180px) {
  .console-stats { grid-template-columns: repeat(2, 1fr); }
  .package-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-lower-grid, .upload-layout { grid-template-columns: 1fr; }
  .queue-card { grid-template-columns: minmax(170px, .8fr) minmax(230px, 1.2fr); }
  .queue-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}
@media (max-width: 800px) {
  body.admin-route .page-shell, body.admin-route footer { width: calc(100% - 1.25rem); }
  .console-heading, .resource-heading { align-items: flex-start; flex-direction: column; }
  .admin-heading-actions { justify-content: flex-start; width: 100%; }
  .form-grid.four, .form-grid.three, .form-grid.two { grid-template-columns: 1fr 1fr; }
  .package-grid { grid-template-columns: 1fr; }
  .health-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .admin-console { padding: .8rem; border-radius: 16px; }
  .admin-tabs { margin-inline: -.15rem; }
  .admin-tab { min-width: 82px; padding: .6rem .52rem; }
  .console-stats { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .console-stats article { min-height: 88px; padding: .7rem; }
  .stat-icon { width: 32px; height: 32px; }
  .form-grid.four, .form-grid.three, .form-grid.two, .entity-form-fields { grid-template-columns: 1fr; }
  .entity-field.full { grid-column: auto; }
  .resource-toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .groups-toolbar .compact-select { flex: 1 1 100%; justify-content: space-between; }
  .groups-toolbar .compact-select select { flex: 1; min-width: 0; }
  .groups-toolbar .count-badge { margin-left: auto; }
  .group-category-summary { flex-wrap: nowrap; margin-inline: -.15rem; padding: .15rem; overflow-x: auto; scrollbar-width: thin; }
  .group-category-chip { flex: 0 0 auto; }
  .queue-toolbar .count-badge, .audit-toolbar .count-badge { margin-left: auto; }
  .queue-card { grid-template-columns: 1fr; }
  .queue-runtime-banner { align-items: stretch; flex-direction: column; }
  .queue-runtime-banner .row-button { width: 100%; }
  .queue-runtime-actions { width: 100%; flex-direction: column; }
  .queue-actions { grid-column: auto; }
  .entity-checkboxes { grid-template-columns: 1fr; }
  .entity-form-actions { flex-wrap: wrap; }
  .entity-form-actions > span { display: none; }
  .entity-form-actions button { flex: 1; }
  .persistence-tier { padding: .68rem; }
  .persistence-actions, .full-snapshot-actions { align-items: stretch; flex-direction: column; }
  .persistence-actions > *, .full-snapshot-actions > * { width: 100%; }
  .full-snapshot-gate { grid-template-columns: 1fr; }
  .full-snapshot-gate .text-button { grid-column: 1; grid-row: auto; justify-self: start; }
  .full-snapshot-row { grid-template-columns: auto minmax(0, 1fr); }
  .full-snapshot-row > .mini-tag { display: none; }
  .full-snapshot-row-copy small { white-space: normal; }
  .sticky-save { align-items: stretch; flex-direction: column; bottom: .35rem; }
  .sticky-save > span { margin: 0; }
}

/* 2026 admin IA, media library and accessible resource drawer */
html, body { max-width: 100%; overflow-x: hidden; }
.admin-console, .admin-workspace, .admin-content, .admin-tab-panel, .asset-library-card,
.entity-modal, .entity-form-fields, .entity-section, .entity-section-grid { min-width: 0; }
.admin-workspace { display: grid; grid-template-columns: 226px minmax(0, 1fr); align-items: start; gap: 1.15rem; }
.admin-content { grid-column: 2; width: 100%; }
.admin-tabs { position: sticky; top: 1rem; grid-column: 1; display: flex; flex-direction: column; align-items: stretch; gap: .8rem; max-height: calc(100dvh - 2rem); margin: 0; padding: .7rem; overflow-x: hidden; overflow-y: auto; border-radius: 16px; }
.admin-nav-group { display: flex; flex-direction: column; gap: .24rem; min-width: 0; }
.admin-nav-group + .admin-nav-group { padding-top: .7rem; border-top: 1px solid rgba(155,180,211,.08); }
.admin-nav-label { padding: 0 .5rem .25rem; color: #71849a; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.admin-tab { justify-content: flex-start; flex: 0 0 auto; width: 100%; min-width: 0; padding: .62rem .68rem; text-align: left; }
.admin-tab > span:first-child { width: 22px; flex: 0 0 22px; color: var(--muted-bright); text-align: center; font-size: .78rem; }
.admin-tab > span:last-child { min-width: 0; overflow: hidden; color: inherit; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-tab.active > span { color: var(--green); }
.admin-tab-panel { width: 100%; overflow: clip; }
.resource-heading > div, .panel-heading > div { min-width: 0; }
.resource-heading p { text-wrap: pretty; }
.resource-table .identity-cell strong, .resource-table .primary-cell strong { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.package-card h3 { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }

.advanced-card { padding: 0; overflow: clip; }
.advanced-card summary, .entity-advanced summary { display: flex; align-items: center; gap: .65rem; padding: .9rem 1.05rem; color: var(--muted-bright); cursor: pointer; list-style: none; }
.advanced-card summary::-webkit-details-marker, .entity-advanced summary::-webkit-details-marker { display: none; }
.advanced-card summary::after, .entity-advanced summary::after { content: "+"; margin-left: auto; color: var(--green); font-size: 1rem; }
.advanced-card[open] summary::after, .entity-advanced[open] summary::after { content: "−"; }
.advanced-card summary > span:nth-child(2) { display: flex; flex-direction: column; gap: .15rem; font-size: .75rem; font-weight: 750; }
.advanced-card summary small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.advanced-card-body { padding: 0 1.05rem 1.05rem; }

.automation-safety-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 1rem; border: 1px solid rgba(245,185,94,.24); border-radius: 15px; background: linear-gradient(135deg, rgba(245,185,94,.08), rgba(9,17,30,.68)); }
.automation-safety-card[data-armed="true"] { border-color: rgba(56,226,159,.3); background: linear-gradient(135deg, rgba(56,226,159,.09), rgba(9,17,30,.68)); }
.automation-safety-icon, .automation-icon { display: grid; place-items: center; flex: 0 0 auto; color: var(--amber); background: rgba(245,185,94,.08); }
.automation-safety-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 1.1rem; }
.automation-safety-card[data-armed="true"] .automation-safety-icon { color: var(--green); background: rgba(56,226,159,.09); }
.automation-safety-card h3, .automation-card h3, .automation-rules-heading h3 { margin: .22rem 0 .3rem; font-size: .8rem; }
.automation-safety-card p, .automation-card p, .automation-rules-heading p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.automation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.automation-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: .8rem; min-width: 0; padding: .9rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,14,25,.4); }
.automation-card.ready { border-color: rgba(56,226,159,.16); }
.automation-icon { width: 40px; height: 40px; border-radius: 12px; }
.automation-card.ready .automation-icon { color: var(--green); background: rgba(56,226,159,.08); }
.automation-state { color: var(--muted); font-size: .75rem; }
.automation-gates-card { margin-bottom: 1rem; padding: 1rem; border: 1px solid rgba(67,200,245,.18); border-radius: 15px; background: linear-gradient(145deg, rgba(13,28,46,.7), rgba(7,14,25,.42)); }
.automation-gates-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.automation-gates-heading > div { min-width: 0; }
.automation-gates-heading h3 { margin: .22rem 0 .28rem; font-size: .8rem; }
.automation-gates-heading p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.automation-gate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding-top: .85rem; }
.automation-gate-grid > label, .automation-gate-grid > fieldset { min-width: 0; margin: 0; }
.automation-gate-grid > label:not(.switch-field) { display: flex; flex-direction: column; gap: .38rem; color: var(--muted-bright); font-size: .75rem; }
.automation-gate-grid > label small { color: var(--muted); font-size: .75rem; line-height: 1.4; }
#automation-executor-mode:disabled { opacity: 1; color: var(--muted-bright); cursor: not-allowed; }
#automation-executor-status[data-state="pending"] { color: #ffd492; font-weight: 700; }
.automation-gate-grid > fieldset { grid-column: 1 / -1; padding: .72rem; border: 1px solid var(--line); border-radius: 12px; }
.automation-gate-grid > fieldset legend { padding: 0 .35rem; color: var(--muted-bright); font-size: .75rem; font-weight: 750; }
.automation-operation-gates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .48rem; }
.automation-operation-gates label { display: flex; align-items: center; gap: .45rem; min-width: 0; padding: .6rem; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-bright); background: rgba(255,255,255,.015); font-size: .75rem; cursor: pointer; }
.automation-operation-gates input { accent-color: var(--green); }
.automation-operation-gates .lead-scan-gate { border-color: rgba(67,200,245,.24); background: rgba(67,200,245,.045); }
.automation-operation-gates .lead-scan-gate input { accent-color: #43c8f5; }
.lead-scan-gate > span { display: flex; flex-direction: column; gap: .18rem; min-width: 0; line-height: 1.35; }
.lead-scan-gate small { color: #9bdff3; font-size: .75rem; line-height: 1.35; }
.automation-card.lead-scan-card { border-color: rgba(67,200,245,.18); }
.automation-card.lead-scan-card .automation-icon { color: #75d9f7; background: rgba(67,200,245,.08); }
.automation-gates-actions { display: flex; align-items: center; gap: .7rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.automation-gates-actions > span { flex: 1; min-width: 0; color: var(--muted); font-size: .75rem; }
.automation-resource-manager { margin-top: 1rem; padding: 1rem; border: 1px solid rgba(67,200,245,.2); border-radius: 16px; background: linear-gradient(145deg, rgba(10,23,39,.9), rgba(6,13,23,.72)); scroll-margin-top: 1rem; }
.automation-resource-manager > .automation-rules-heading > div:last-child { display: flex; align-items: center; gap: .45rem; flex: 0 0 auto; }
.automation-manager-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; padding-top: .8rem; }
.automation-manager-list > .empty-state, .automation-manager-note, .legacy-target-heading { grid-column: 1 / -1; }
.automation-manager-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-width: 0; padding: .72rem .78rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.015); }
.automation-manager-row.legacy { border-style: dashed; border-color: rgba(245,185,94,.24); background: rgba(245,185,94,.035); }
.automation-manager-row > div { min-width: 0; }
.automation-manager-row strong, .automation-manager-row small { display: block; overflow-wrap: anywhere; }
.automation-manager-row strong { color: var(--text); font-size: .75rem; line-height: 1.4; }
.automation-manager-row small { margin-top: .2rem; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.automation-manager-row .row-button { flex: 0 0 auto; }
.automation-manager-note { margin: 0; padding: .7rem; border: 1px solid rgba(67,200,245,.14); border-radius: 10px; color: var(--muted); background: rgba(67,200,245,.035); font-size: .75rem; }
.legacy-target-heading { margin-top: .2rem; padding: .55rem 0 .15rem; color: var(--amber); font-size: .75rem; }
.automation-rules-form { margin-top: .9rem; padding: 1rem; border: 1px solid rgba(67,200,245,.2); border-radius: 15px; background: rgba(8,16,29,.75); scroll-margin-top: 1rem; }
.automation-rules-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.automation-rules-heading > div { min-width: 0; }
.automation-rules-form > .form-grid { display: block; padding-top: .85rem; }
.automation-form-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin: 0 0 .85rem; padding: 0; list-style: none; }
.automation-form-steps li { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .62rem .68rem; border: 1px solid rgba(67,200,245,.14); border-radius: 10px; color: var(--muted-bright); background: rgba(67,200,245,.035); }
.automation-form-steps li > span { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; border-radius: 8px; color: var(--green); background: rgba(56,226,159,.07); font-size: .75rem; }
.automation-form-steps strong { min-width: 0; font-size: .75rem; line-height: 1.45; }
.automation-section { margin-bottom: .75rem; }
.automation-section-grid .automation-rule-field.full-field { grid-column: 1 / -1; }
.automation-rule-field { min-width: 0; }
.automation-rule-field:not(.switch-field) { display: flex; flex-direction: column; gap: .4rem; color: var(--muted-bright); font-size: .75rem; }
.automation-rule-field small { color: var(--muted); font-size: .75rem; line-height: 1.5; }
.automation-rule-field.full-field { grid-column: 1 / -1; }
.automation-option-picker { min-width: 0; padding: .65rem; border: 1px solid var(--line-strong); border-radius: 12px; background: #081322; }
.automation-option-picker > .selectable-picker-toolbar > input { flex: 1; min-width: 120px; min-height: 36px; padding: .5rem .58rem; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--text); background: #0e192a; font-size: .75rem; }
.automation-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; max-height: 285px; overflow-y: auto; }
.automation-option-grid > .empty-state { grid-column: 1 / -1; }
.automation-option-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .52rem; min-width: 0; padding: .62rem; border: 1px solid var(--line); border-radius: 10px; color: var(--muted-bright); background: rgba(255,255,255,.014); cursor: pointer; }
.automation-option-card:hover { border-color: rgba(67,200,245,.28); }
.automation-option-card.selected { border-color: rgba(56,226,159,.42); background: rgba(56,226,159,.055); }
.automation-option-card.unavailable { border-style: dashed; opacity: .68; cursor: not-allowed; }
.automation-option-card.unavailable.selected { opacity: .9; cursor: pointer; }
.automation-option-card input { accent-color: var(--green); }
.automation-option-card > span { min-width: 0; }
.automation-option-card strong, .automation-option-card small { display: block; overflow-wrap: anywhere; }
.automation-option-card strong { font-size: .75rem; }
.automation-option-card small { margin-top: .18rem; color: var(--muted); font-size: .75rem; }
.bump-plan-editor { display: grid; min-width: 0; gap: .7rem; }
.bump-plan-guide { padding: .75rem .8rem; border: 1px solid rgba(67,200,245,.18); border-radius: 11px; background: linear-gradient(145deg, rgba(67,200,245,.055), rgba(56,226,159,.025)); }
.bump-plan-guide strong { color: var(--text); font-size: .75rem; }
.bump-plan-guide p { margin: .3rem 0 0; color: var(--muted-bright); font-size: .75rem; line-height: 1.55; }
.bump-plan-add { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: center; gap: .55rem; }
.bump-plan-add select { min-height: 38px; padding: .55rem .62rem; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: #0a1422; font-size: .75rem; }
.bump-plan-list { display: grid; gap: .75rem; }
.bump-plan-card { min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(5,12,21,.34); }
.bump-plan-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .65rem .72rem; border-bottom: 1px solid var(--line); background: rgba(15,29,47,.58); }
.bump-plan-heading > div { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.bump-plan-heading-copy { overflow-wrap: anywhere; color: var(--text); font-size: .75rem; font-weight: 750; }
.bump-plan-runtime, .bump-plan-like { margin: .65rem; }
.bump-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; padding: 0 .65rem .65rem; }
.bump-plan-field { display: flex; flex-direction: column; gap: .34rem; min-width: 0; color: var(--muted-bright); font-size: .75rem; }
.bump-plan-field input, .bump-plan-field select { width: 100%; min-height: 39px; padding: .55rem .62rem; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--text); background: #0c1828; font-size: .75rem; }
.bump-plan-field small { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.bump-plan-accounts { display: grid; gap: .38rem; padding: 0 .65rem .65rem; color: var(--muted-bright); font-size: .75rem; }
.bump-plan-account-picker .selectable-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.control-button.danger { color: #ffabb6; border-color: rgba(255,113,132,.3); background: rgba(255,113,132,.08); }

.upload-layout { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); align-items: start; }
.upload-card { position: sticky; top: 1rem; min-width: 0; }
.asset-library-card { width: 100%; }
.asset-toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(5,11,20,.35); }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: .7rem; min-height: 180px; }
.asset-grid > .empty-state { grid-column: 1 / -1; }
.asset-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(13,26,43,.72), rgba(7,14,25,.45)); transition: border-color .18s ease, transform .18s ease; }
.asset-card:hover, .asset-card:focus-within { border-color: rgba(67,200,245,.3); transform: translateY(-1px); }
.asset-card.disabled { opacity: .72; }
.asset-preview-button { display: block; width: 100%; padding: 0; border: 0; border-bottom: 1px solid var(--line); color: inherit; background: #07101c; cursor: zoom-in; }
.asset-thumb, .picker-media-thumb { position: relative; display: grid; place-items: center; width: 100%; overflow: hidden; color: var(--cyan); background: radial-gradient(circle at 45% 35%, rgba(67,200,245,.1), rgba(5,11,20,.9)); }
.asset-thumb { aspect-ratio: 4 / 3; }
.asset-thumb img, .picker-media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-fallback { font-size: .75rem; font-weight: 850; letter-spacing: .12em; }
.asset-play-badge { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; color: #fff; background: rgba(4,8,15,.7); transform: translate(-50%, -50%); }
.asset-card-body { display: flex; flex-direction: column; min-height: 142px; padding: .72rem; }
.asset-card-type { display: flex; align-items: center; justify-content: space-between; gap: .45rem; }
.asset-card h3 { display: block; margin: .55rem 0 .3rem; overflow: visible; font-size: .75rem; line-height: 1.35; overflow-wrap: anywhere; }
.asset-card-meta { margin: 0; overflow: hidden; color: var(--muted); font-size: .75rem; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-actions { display: flex; flex-wrap: wrap; gap: .32rem; margin-top: auto; padding-top: .65rem; }
.asset-card-actions .row-button { flex: 1 1 auto; }
.asset-pagination, .picker-pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: .8rem; color: var(--muted); font-size: .75rem; }
.asset-pagination button:disabled, .picker-pagination button:disabled { opacity: .38; cursor: default; }

.selectable-picker { min-width: 0; padding: .65rem; border: 1px solid var(--line-strong); border-radius: 12px; background: #081322; }
.selectable-picker-toolbar { display: flex; align-items: center; gap: .55rem; margin-bottom: .65rem; }
.picker-search { flex: 1; min-width: 120px; }
.picker-search input, .selectable-picker-toolbar select { width: 100%; min-height: 36px; padding: .5rem .58rem; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--text); background: #0e192a; font-size: .75rem; }
.selectable-picker-toolbar select { width: auto; }
.picker-selected-count { flex: 0 0 auto; padding: .35rem .5rem; border-radius: 999px; color: var(--green); background: rgba(56,226,159,.07); font-size: .75rem; }
.selectable-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .48rem; min-height: 120px; }
.account-picker .selectable-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.selectable-card { position: relative; display: grid; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.015); transition: .16s ease; }
.selectable-card:hover { border-color: rgba(67,200,245,.28); }
.selectable-card.selected { border-color: rgba(56,226,159,.48); background: rgba(56,226,159,.06); box-shadow: inset 0 0 0 1px rgba(56,226,159,.12); }
.selectable-card.unavailable { border-style: dashed; opacity: .68; }
.selectable-card.unavailable:not(.selected) > label { cursor: not-allowed; }
.selectable-card.unavailable.selected { opacity: .9; }
.selectable-card.selected::after { content: "✓"; position: absolute; top: .4rem; right: .4rem; z-index: 3; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #06140e; background: var(--green); font-size: .75rem; font-weight: 900; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.selectable-card > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.selectable-card:focus-within { outline: 2px solid rgba(56,226,159,.7); outline-offset: 2px; }
.selectable-card > label { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: .55rem; min-width: 0; padding: .6rem; color: var(--text); cursor: pointer; }
.media-picker .selectable-card > label { grid-template-columns: 1fr; align-content: start; padding: 0; }
.picker-media-thumb { aspect-ratio: 16 / 10; border-bottom: 1px solid var(--line); }
.media-picker .selectable-card-copy { padding: .55rem .55rem .7rem; }
.selectable-card-copy { display: block; min-width: 0; }
.selectable-card-copy strong { display: block; overflow: visible; font-size: .75rem; line-height: 1.35; overflow-wrap: anywhere; white-space: normal; }
.selectable-card-copy small { display: block; margin-top: .18rem; overflow: hidden; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.picker-account-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--green); background: linear-gradient(135deg, rgba(56,226,159,.14), rgba(67,200,245,.07)); font-size: .75rem; font-weight: 850; }
.picker-resource-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--cyan); background: linear-gradient(135deg, rgba(67,200,245,.13), rgba(124,115,255,.07)); font-size: .75rem; font-weight: 850; }
.picker-preview-button { position: absolute; right: .42rem; bottom: .42rem; z-index: 2; padding: .3rem .42rem; border: 1px solid var(--line); border-radius: 7px; color: var(--muted-bright); background: rgba(5,11,20,.86); font-size: .75rem; cursor: zoom-in; }

.schedule-group-picker { display: grid; gap: .72rem; min-width: 0; padding: .72rem; border: 1px solid var(--line-strong); border-radius: 13px; background: #081322; }
.schedule-group-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.schedule-group-picker-heading > div:first-child { min-width: 0; }
.schedule-group-picker-heading > div:first-child > strong,
.schedule-group-panel-heading > div > strong { display: block; color: var(--text); font-size: .8rem; }
.schedule-group-picker-heading > div:first-child > small,
.schedule-group-panel-heading > div > small { display: block; margin-top: .2rem; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.schedule-group-mode-switch { display: grid; grid-template-columns: 1fr 1fr; flex: 0 0 auto; gap: .28rem; padding: .26rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(5,11,20,.48); }
.schedule-group-mode-button { display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 38px; padding: .48rem .68rem; border: 1px solid transparent; border-radius: 8px; color: var(--muted-bright); background: transparent; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.schedule-group-mode-button strong { font-size: .75rem; }
.schedule-group-mode-button small { padding: .14rem .3rem; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.04); font-size: .75rem; }
.schedule-group-mode-button:hover { color: var(--text); background: rgba(67,200,245,.05); }
.schedule-group-mode-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.schedule-group-mode-button.active { color: #b9f6da; border-color: rgba(56,226,159,.34); background: rgba(56,226,159,.09); }
.schedule-group-mode-button.active small { color: var(--green); background: rgba(56,226,159,.09); }
.schedule-group-category-panel,
.schedule-group-custom-panel { min-width: 0; padding: .7rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(5,11,20,.28); }
.schedule-group-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; margin-bottom: .62rem; }
.schedule-group-transition-notice { max-width: 280px; color: var(--amber); font-size: .75rem; line-height: 1.4; text-align: right; }
.schedule-group-category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; }
.schedule-group-category-grid > .empty-state { grid-column: 1 / -1; }
.schedule-group-category-card { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: .58rem; min-width: 0; min-height: 66px; padding: .62rem; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: rgba(255,255,255,.015); cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.schedule-group-category-card:hover { border-color: rgba(67,200,245,.3); transform: translateY(-1px); }
.schedule-group-category-card:focus-within { outline: 2px solid rgba(56,226,159,.7); outline-offset: 2px; }
.entity-field .schedule-group-category-card > input { position: absolute; width: 1px; min-height: 0; height: 1px; padding: 0; opacity: 0; }
.schedule-group-category-card.selected { border-color: rgba(56,226,159,.48); background: rgba(56,226,159,.07); box-shadow: inset 0 0 0 1px rgba(56,226,159,.1); }
.schedule-group-category-card.missing { border-color: rgba(255,113,132,.38); background: rgba(255,113,132,.055); }
.schedule-group-category-card.missing .schedule-group-category-copy small { color: #ffb9c2; }
.schedule-group-category-card.selected::after { content: "✓"; position: absolute; top: .34rem; right: .34rem; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #06140e; background: var(--green); font-size: .75rem; font-weight: 900; }
.schedule-group-category-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--cyan); background: linear-gradient(135deg, rgba(67,200,245,.14), rgba(124,115,255,.08)); font-size: .75rem; font-weight: 850; }
.schedule-group-category-copy { min-width: 0; }
.schedule-group-category-copy strong { display: block; padding-right: .6rem; overflow-wrap: anywhere; font-size: .78rem; line-height: 1.35; }
.schedule-group-category-copy small { display: block; margin-top: .18rem; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.schedule-group-category-count { display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 .42rem; border-radius: 999px; color: var(--cyan); background: rgba(67,200,245,.08); font-size: .75rem; }
.schedule-group-category-card.selected .schedule-group-category-count { color: #06140e; background: var(--green); }
.schedule-group-selection-summary { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: .58rem; margin-top: .62rem; padding: .62rem .7rem; border: 1px solid rgba(56,226,159,.2); border-radius: 10px; background: rgba(56,226,159,.055); }
.schedule-group-selection-summary.empty { border-color: rgba(241,185,73,.22); background: rgba(241,185,73,.055); }
.schedule-group-selection-summary.invalid { border-color: rgba(255,113,132,.34); background: rgba(255,113,132,.07); }
.schedule-group-summary-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--green); background: rgba(56,226,159,.1); font-size: .8rem; font-weight: 900; }
.schedule-group-selection-summary.empty .schedule-group-summary-icon { color: var(--amber); background: rgba(241,185,73,.1); }
.schedule-group-selection-summary.invalid .schedule-group-summary-icon { color: #ffabb6; background: rgba(255,113,132,.12); }
.schedule-group-summary-copy { min-width: 0; }
.schedule-group-summary-copy strong { display: block; color: var(--text); font-size: .78rem; }
.schedule-group-summary-copy small { display: block; margin-top: .2rem; color: var(--muted); font-size: .75rem; line-height: 1.45; overflow-wrap: anywhere; }
.schedule-group-custom-summary { flex: 0 0 auto; text-align: right; }
.schedule-group-custom-summary strong,
.schedule-group-custom-summary small { display: block; }
.schedule-group-custom-summary strong { color: var(--green); font-size: .75rem; }
.schedule-group-custom-summary small { max-width: 280px; margin-top: .16rem; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.schedule-group-custom-host > .selectable-picker { padding: .62rem; }
.schedule-group-table-mapping { display: grid; gap: .35rem; min-width: 180px; }
.schedule-group-table-mapping > .mini-tag { width: max-content; }
.schedule-capacity-summary { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: start; gap: .68rem; grid-column: 1 / -1; padding: .72rem; border: 1px solid rgba(56,226,159,.24); border-radius: 12px; background: rgba(56,226,159,.055); }
.schedule-capacity-summary[data-state="notice"] { border-color: rgba(241,185,73,.3); background: rgba(241,185,73,.065); }
.schedule-capacity-summary[data-state="invalid"] { border-color: rgba(255,113,132,.36); background: rgba(255,113,132,.075); }
.schedule-capacity-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--green); background: rgba(56,226,159,.12); font-size: .78rem; font-weight: 900; }
.schedule-capacity-summary[data-state="notice"] .schedule-capacity-icon { color: var(--amber); background: rgba(241,185,73,.12); }
.schedule-capacity-summary[data-state="invalid"] .schedule-capacity-icon { color: #ffabb6; background: rgba(255,113,132,.12); }
.schedule-capacity-copy { min-width: 0; }
.schedule-capacity-copy > strong { display: block; margin-bottom: .42rem; color: var(--text); font-size: .8rem; }
.schedule-capacity-facts { display: flex; flex-wrap: wrap; gap: .34rem; }
.schedule-capacity-copy > small { display: block; margin-top: .45rem; color: var(--muted-bright); font-size: .75rem; line-height: 1.5; }
.schedule-capacity-summary[data-state="notice"] .schedule-capacity-copy > small { color: #ffd28b; }
.schedule-capacity-summary[data-state="invalid"] .schedule-capacity-copy > small { color: #ffb9c2; }

.entity-backdrop { align-items: stretch; justify-content: flex-end; padding: 0; overflow: hidden; }
.entity-modal { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(900px, 100%); height: 100dvh; max-height: none; padding: 0; overflow: hidden; border-width: 0 0 0 1px; border-radius: 22px 0 0 22px; }
.entity-modal-heading { z-index: 2; padding: 1rem 1.15rem; background: rgba(15,28,45,.97); }
.entity-modal-heading p { max-width: 680px; }
.entity-modal form { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.entity-form-fields { display: block; padding: .9rem 1.15rem 1.2rem; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.entity-section { min-width: 0; margin: 0 0 .85rem; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,14,25,.34); }
.entity-section legend { display: flex; align-items: center; gap: .6rem; width: calc(100% - 1.2rem); margin: 0 .6rem; padding: .55rem .15rem; }
.entity-section legend > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.entity-section legend strong { font-size: .75rem; }
.entity-section legend small { margin-top: .12rem; color: var(--muted); font-size: .75rem; font-weight: 500; line-height: 1.35; }
.entity-section-index { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 9px; color: var(--green); background: rgba(56,226,159,.07); font-size: .75rem; }
.entity-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .72rem; padding: .75rem; border-top: 1px solid var(--line); }
.entity-section-grid .entity-field.full { grid-column: 1 / -1; }
.entity-section-grid .switch-field { min-width: 0; }
.entity-advanced { margin: .85rem 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,14,25,.32); }
.entity-advanced summary { padding: .75rem .85rem; font-size: .75rem; }
.entity-advanced > .entity-field { padding: 0 .85rem .85rem; }
.entity-form-actions { z-index: 3; margin: 0; padding: .75rem 1.15rem; border-top: 1px solid rgba(56,226,159,.16); background: rgba(11,22,37,.97); box-shadow: 0 -12px 35px rgba(0,0,0,.22); }

.media-lightbox-backdrop { z-index: 105; padding: clamp(.5rem, 2vw, 1.5rem); }
.media-lightbox { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(1180px, 100%); height: min(900px, calc(100dvh - 2rem)); overflow: hidden; border: 1px solid rgba(67,200,245,.25); border-radius: 20px; background: #07101c; box-shadow: 0 35px 100px rgba(0,0,0,.6); }
.media-lightbox > header, .media-lightbox > footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; background: rgba(15,28,45,.94); }
.media-lightbox > header { border-bottom: 1px solid var(--line); }
.media-lightbox > footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.media-lightbox > footer > div { display: flex; gap: .4rem; }
.media-lightbox h2 { margin: .2rem 0; overflow: hidden; font-size: .9rem; overflow-wrap: anywhere; }
.media-lightbox p { margin: 0; color: var(--muted); font-size: .75rem; }
.media-lightbox-stage { display: grid; place-items: center; min-height: 0; padding: .75rem; overflow: auto; background: radial-gradient(circle at center, rgba(67,200,245,.05), transparent 60%), #040a12; }
.media-lightbox-stage img, .media-lightbox-stage video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.record-error { max-width: 380px; color: #ffabb6; white-space: normal; }
.post-records-block { margin-bottom: 1.2rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,14,25,.28); }
.post-records-block .panel-heading { margin-bottom: .75rem; }
.post-record-link { display: block; max-width: 360px; color: var(--cyan); overflow-wrap: anywhere; }
.subsection-heading { margin: .25rem 0 .7rem; }
.subsection-heading h3 { margin: .2rem 0 0; font-size: .82rem; }

/* Content-package studio: mirrors the desktop GUI's copy-format guide while
   keeping every cloud field visible, previewable and keyboard accessible. */
.content-workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin: 0 0 .85rem; padding: 0; list-style: none; }
.content-workflow li { display: flex; align-items: flex-start; gap: .65rem; min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, rgba(56,226,159,.045), rgba(67,200,245,.025)); }
.content-workflow li > span, .copy-variant-number { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px; color: var(--green); background: rgba(56,226,159,.08); font-size: .75rem; font-weight: 800; }
.content-workflow li div { min-width: 0; }
.content-workflow strong { display: block; font-size: .75rem; }
.content-workflow small { display: block; margin-top: .22rem; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.content-workflow code, .copy-syntax-item code { color: #b9f6da; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.account-auth-onboarding { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .68rem; margin: -.2rem 0 .9rem; padding: 0; list-style: none; }
.account-auth-onboarding li { position: relative; display: flex; align-items: flex-start; gap: .68rem; min-width: 0; padding: .78rem .82rem; overflow: hidden; border: 1px solid rgba(67,200,245,.16); border-radius: 13px; background: linear-gradient(145deg, rgba(67,200,245,.07), rgba(8,17,29,.58)); }
.account-auth-onboarding li::after { position: absolute; right: -16px; bottom: -24px; width: 62px; height: 62px; border: 1px solid rgba(56,226,159,.08); border-radius: 50%; content: ""; }
.account-auth-onboarding li > span { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid rgba(56,226,159,.22); border-radius: 10px; color: var(--green); background: rgba(56,226,159,.07); font-size: .75rem; font-weight: 800; letter-spacing: .04em; }
.account-auth-onboarding li > div { min-width: 0; }
.account-auth-onboarding strong { display: block; color: var(--muted-bright); font-size: .75rem; }
.account-auth-onboarding small { display: block; margin-top: .22rem; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.package-meta { flex-wrap: wrap; justify-content: flex-start; }
.package-meta span:last-child { margin-left: auto; }

.copy-studio, .formatted-title-studio, .media-variants-studio { display: grid; min-width: 0; gap: .65rem; }
.copy-guidance { padding: .8rem; border: 1px solid rgba(67,200,245,.2); border-radius: 12px; background: linear-gradient(145deg, rgba(67,200,245,.065), rgba(56,226,159,.035)); }
.copy-guidance-title { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.copy-guidance strong { color: var(--text); font-size: .75rem; }
.copy-guidance p { margin: .35rem 0 0; color: var(--muted-bright); font-size: .75rem; line-height: 1.65; }
.compact-guidance { padding: .65rem .72rem; }
.copy-syntax-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin-top: .65rem; }
.copy-syntax-item { display: flex; flex-direction: column; min-width: 0; padding: .45rem .5rem; border: 1px solid rgba(155,180,211,.1); border-radius: 8px; background: rgba(5,12,21,.4); }
.copy-syntax-item code { overflow-wrap: anywhere; font-size: .75rem; font-weight: 700; }
.copy-syntax-item small { margin-top: .15rem; color: var(--muted); font-size: .75rem; }
.copy-variant-list, .title-variant-list, .media-variant-list { display: grid; gap: .75rem; }
.copy-variant-card, .title-variant-card, .media-variant-card { min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(5,12,21,.34); }
.copy-variant-heading, .title-variant-heading, .media-variant-heading { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .65rem .72rem; border-bottom: 1px solid var(--line); background: rgba(15,29,47,.55); }
.copy-variant-heading > div:first-child, .title-variant-heading > div:first-child, .media-variant-heading > div:first-child { display: flex; align-items: center; gap: .55rem; }
.copy-variant-heading strong, .title-variant-heading strong, .media-variant-heading strong { font-size: .75rem; }
.copy-variant-actions { display: flex; align-items: center; gap: .35rem; }
.copy-byte-count { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.copy-byte-count.limit { color: #ffabb6; font-weight: 750; }
.copy-format-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; padding: .55rem .65rem; border-bottom: 1px solid rgba(155,180,211,.08); }
.copy-toolbar-label { margin-right: .2rem; color: var(--muted); font-size: .75rem; }
.copy-format-button { min-height: 31px; padding: .38rem .54rem; border: 1px solid var(--line); border-radius: 7px; color: var(--muted-bright); background: #0d1a2b; cursor: pointer; font-size: .75rem; }
.copy-format-button:hover, .copy-format-button:focus-visible { border-color: rgba(56,226,159,.45); color: var(--text); outline: none; }
.copy-variant-card > textarea { display: block; width: calc(100% - 1.3rem); min-height: 180px; margin: .65rem; padding: .74rem; resize: vertical; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--text); background: #07111e; font: .75rem/1.7 "Microsoft JhengHei UI", sans-serif; }
.copy-variant-card > textarea:focus, .title-variant-card > input:focus { border-color: rgba(56,226,159,.48); box-shadow: 0 0 0 3px rgba(56,226,159,.055); }
.copy-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .65rem .45rem; }
.copy-preview-label { color: var(--cyan); font-size: .75rem; font-weight: 750; letter-spacing: .03em; }
.copy-live-preview { min-height: 76px; margin: 0 .65rem .7rem; padding: .76rem; overflow-wrap: anywhere; border: 1px solid rgba(67,200,245,.16); border-radius: 10px; color: #e9f2ff; background: #0d1726; font-size: .75rem; line-height: 1.65; }
.copy-live-preview .copy-preview-line { margin: 0 0 .35rem; white-space: pre-wrap; }
.copy-live-preview h3.copy-preview-line { margin: 0 0 .42rem; font-size: 1rem; line-height: 1.35; }
.copy-live-preview h4.copy-preview-line { margin: 0 0 .4rem; font-size: .84rem; line-height: 1.4; }
.copy-live-preview blockquote { padding-left: .65rem; border-left: 3px solid rgba(67,200,245,.5); color: var(--muted-bright); }
.copy-live-preview .list-line { padding-left: .5rem; }
.copy-preview-empty { margin: 0; color: var(--muted); font-size: .75rem; }
.copy-studio-actions { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.copy-studio-count { color: var(--muted); font-size: .75rem; }
.title-variant-card > input { display: block; width: calc(100% - 1.3rem); min-height: 44px; margin: .65rem; padding: .68rem .74rem; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--text); background: #07111e; font-size: .75rem; }
.title-variant-card .copy-live-preview { min-height: 52px; }
.copy-preview-refresh { justify-self: start; }
.media-selected-count { padding: .28rem .46rem; border: 1px solid rgba(56,226,159,.2); border-radius: 999px; color: var(--green); background: rgba(56,226,159,.065); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.media-selected-count.empty { border-color: var(--line); color: var(--muted); background: rgba(255,255,255,.025); }
.media-variant-summary { display: grid; gap: .65rem; padding: .68rem; }
.selected-media-empty { padding: .85rem; border: 1px dashed rgba(155,180,211,.2); border-radius: 11px; text-align: center; background: rgba(7,14,25,.28); }
.selected-media-empty strong { display: block; font-size: .75rem; }
.selected-media-empty p { margin: .3rem auto 0; max-width: 520px; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.selected-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .48rem; }
.selected-media-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: rgba(13,26,43,.56); }
.selected-media-item.missing { min-height: 64px; border-color: rgba(255,190,92,.22); }
.selected-media-preview { align-self: stretch; min-height: 64px; padding: 0; overflow: hidden; border: 0; border-right: 1px solid var(--line); color: inherit; background: #07101c; cursor: zoom-in; }
.selected-media-thumb { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 64px; overflow: hidden; color: var(--cyan); background: radial-gradient(circle at 45% 35%, rgba(67,200,245,.1), rgba(5,11,20,.9)); }
.selected-media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selected-media-thumb .asset-play-badge { width: 28px; height: 28px; font-size: .75rem; }
.selected-media-thumb.missing { width: 64px; color: #ffd28b; font-weight: 850; }
.selected-media-copy { min-width: 0; padding: .5rem .58rem; overflow-wrap: anywhere; }
.selected-media-copy strong { display: block; font-size: .75rem; line-height: 1.35; }
.selected-media-copy small { display: block; margin-top: .18rem; overflow: hidden; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.selected-media-remove { align-self: stretch; min-width: 48px; padding: .4rem; border: 0; border-left: 1px solid var(--line); color: #ffabb6; background: rgba(255,113,132,.035); font-size: .75rem; cursor: pointer; }
.selected-media-remove:hover, .selected-media-remove:focus-visible { color: #fff; background: rgba(255,113,132,.13); outline: none; }
.media-variant-summary-actions { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.media-variant-summary-actions > span { color: var(--muted); font-size: .75rem; }
.media-selection-panel { display: grid; gap: .65rem; margin: 0 .68rem .68rem; padding: .68rem; border: 1px solid rgba(67,200,245,.28); border-radius: 12px; background: linear-gradient(145deg, rgba(15,30,49,.97), rgba(7,16,28,.97)); box-shadow: 0 15px 35px rgba(0,0,0,.2); }
.media-selection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .65rem; }
.media-selection-heading strong { display: block; font-size: .78rem; }
.media-selection-heading small { display: block; margin-top: .2rem; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.media-selection-panel > .selectable-picker { padding: .62rem; }
.media-selection-panel .selectable-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.media-selection-actions { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: .45rem; padding-top: .62rem; border-top: 1px solid var(--line); background: linear-gradient(to bottom, transparent, rgba(7,16,28,.98) 34%); }

@media (max-width: 1180px) {
  .admin-workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .automation-grid { grid-template-columns: 1fr; }
  .selectable-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .copy-syntax-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .admin-workspace { display: block; }
  .admin-content { width: 100%; }
  .admin-tabs { position: sticky; top: 68px; z-index: 25; display: flex; flex-direction: row; gap: .35rem; max-height: none; margin-bottom: .9rem; overflow-x: auto; overflow-y: hidden; border-radius: 12px; background: rgba(7,14,25,.96); scrollbar-width: thin; }
  .admin-nav-group { display: contents; }
  .admin-nav-label { display: none; }
  .admin-tab { width: auto; min-width: max-content; }
  .admin-tab > span:last-child { overflow: visible; }
  .upload-layout { grid-template-columns: 1fr; }
  .upload-card { position: static; }
  .automation-safety-card { grid-template-columns: 44px minmax(0, 1fr); }
  .automation-safety-card .control-button { grid-column: 1 / -1; width: 100%; }
  .content-workflow { grid-template-columns: 1fr; }
  .onboarding-layout { grid-template-columns: 1fr; }
  .onboarding-next { padding: .85rem 0 0; border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 980px) and (min-width: 621px) {
  :is(.accounts-resource-table, .groups-resource-table, .schedules-resource-table) :is(th, td):last-child { position: sticky; right: 0; z-index: 2; background: #0d1929; box-shadow: -12px 0 18px rgba(3,8,15,.26); }
  :is(.accounts-resource-table, .groups-resource-table, .schedules-resource-table) th:last-child { z-index: 3; background: #142338; }
}
@media (max-width: 620px) {
  .telegram-test-panel { grid-template-columns: 1fr; }
  .telegram-test-actions { min-width: 0; }
  .telegram-test-panel .row-button { width: 100%; }
  .admin-data-error { align-items: stretch; flex-direction: column; }
  .admin-data-error .row-button { width: 100%; }
  .resource-table-wrap { overflow: visible; border: 0; background: transparent; }
  .resource-table, .groups-resource-table { display: block; width: 100%; min-width: 0; }
  .resource-table thead { display: none; }
  .resource-table tbody { display: grid; gap: .65rem; }
  .resource-table tbody tr { display: block; padding: .3rem .7rem; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(7,14,25,.46); }
  .resource-table tbody td { display: grid; grid-template-columns: minmax(92px, .38fr) minmax(0, 1fr); align-items: start; gap: .7rem; width: 100%; min-width: 0; padding: .62rem 0; border-bottom: 1px solid var(--line); white-space: normal; overflow-wrap: anywhere; }
  .resource-table tbody td:last-child { border-bottom: 0; }
  .resource-table tbody td::before { color: var(--muted); font-size: .75rem; font-weight: 700; content: attr(data-label); }
  .resource-table tbody td[data-label="操作"] { align-items: center; }
  .resource-table tbody .row-actions { justify-content: flex-start; }
  .resource-table tbody .row-actions .row-button { min-height: 40px; }
  .resource-table tbody .group-category-row { padding: 0; border-color: rgba(67,200,245,.16); background: rgba(67,200,245,.035); }
  .resource-table tbody .group-category-row td { display: flex; gap: .45rem; padding: .65rem .7rem; border: 0; }
  .resource-table tbody .group-category-row td::before, .resource-table tbody .empty-cell::before { display: none; }
  .resource-table tbody .empty-cell { display: grid; min-height: 150px; padding: 1rem; place-items: center; border: 0; text-align: center; }
  .resource-table .identity-cell, .resource-table .account-login-status { min-width: 0; }
  .asset-toolbar, .selectable-picker-toolbar { align-items: stretch; flex-wrap: wrap; }
  .asset-toolbar .search-field, .picker-search { flex-basis: 100%; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .selectable-card-grid, .account-picker .selectable-card-grid { grid-template-columns: 1fr; }
  .entity-modal { width: 100%; border: 0; border-radius: 0; }
  .entity-section-grid { grid-template-columns: 1fr; }
  .entity-section-grid .entity-field.full { grid-column: auto; }
  .entity-form-actions { flex-wrap: nowrap; }
  .entity-form-actions > span { display: none; }
  .automation-card { grid-template-columns: 38px minmax(0, 1fr); }
  .automation-card > :last-child { grid-column: 1 / -1; width: 100%; text-align: center; }
  .automation-gates-heading, .automation-rules-heading { align-items: stretch; flex-direction: column; }
  .automation-gate-grid, .automation-rules-form > .form-grid { grid-template-columns: 1fr; }
  .automation-operation-gates, .automation-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automation-manager-list { grid-template-columns: 1fr; }
  .automation-resource-manager > .automation-rules-heading > div:last-child { justify-content: space-between; }
  .onboarding-heading { flex-direction: column; }
  .onboarding-progress { width: 100%; }
  .onboarding-step { grid-template-columns: 32px minmax(0, 1fr); }
  .onboarding-step > .mini-tag { grid-column: 2; justify-self: start; }
  .onboarding-actions { flex-direction: column; }
  .media-lightbox { height: calc(100dvh - 1rem); border-radius: 14px; }
  .media-lightbox > footer { align-items: stretch; flex-direction: column; }
  .media-lightbox > footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .media-variant-heading { align-items: flex-start; }
  .media-variant-heading > div:first-child { align-items: flex-start; flex-wrap: wrap; }
  .selected-media-grid, .media-selection-panel .selectable-card-grid { grid-template-columns: 1fr; }
  .media-variant-summary-actions { align-items: stretch; flex-direction: column; }
  .media-variant-summary-actions .primary-button, .media-variant-summary-actions .ghost-button { width: 100%; }
  .media-selection-panel { margin-inline: .45rem; padding: .5rem; }
  .media-selection-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .media-selection-actions button { width: 100%; }
  .copy-variant-heading { align-items: flex-start; flex-direction: column; }
  .copy-variant-actions { width: 100%; flex-wrap: wrap; }
  .bump-plan-add { grid-template-columns: 1fr; }
  .bump-plan-grid, .bump-plan-account-picker .selectable-card-grid { grid-template-columns: 1fr; }
  .bump-plan-heading { align-items: flex-start; flex-direction: column; }
  .schedule-group-picker { padding: .52rem; }
  .schedule-group-picker-heading, .schedule-group-panel-heading { align-items: stretch; flex-direction: column; }
  .schedule-group-mode-switch { width: 100%; }
  .schedule-group-category-grid { grid-template-columns: 1fr; }
  .schedule-group-transition-notice, .schedule-group-custom-summary { max-width: none; text-align: left; }
  .schedule-capacity-summary { grid-template-columns: 34px minmax(0, 1fr); padding: .6rem; }
  .schedule-capacity-icon { width: 34px; height: 34px; }
}
@media (max-width: 430px) {
  .asset-grid { grid-template-columns: 1fr; }
  .console-stats { grid-template-columns: 1fr; }
  .automation-operation-gates, .automation-option-grid { grid-template-columns: 1fr; }
  .automation-gates-actions { align-items: stretch; flex-direction: column; }
  .automation-gates-actions .primary-button { width: 100%; }
}

/* Fixed-origin Facebook online-login relay. The browser frame remains an
   authenticated, no-store JPEG; these styles never embed a third-party page. */
.row-button.facebook-login-button { color: #a9f4d4; border-color: rgba(56,226,159,.28); background: rgba(56,226,159,.055); }
.row-button.facebook-login-button:hover { color: #d9ffef; border-color: rgba(56,226,159,.55); background: rgba(56,226,159,.1); }
.facebook-login-backdrop { z-index: 120; padding: clamp(.35rem, 1.5vw, 1rem); }
.facebook-login-modal { display: grid; grid-template-areas: "heading" "summary" "security" "message" "diagnostic" "help" "workspace" "controls" "actions"; grid-template-rows: auto auto auto auto auto auto minmax(240px, 1fr) auto auto; width: min(1180px, 100%); height: min(900px, calc(100dvh - 1rem)); max-height: calc(100dvh - 1rem); min-height: min(660px, calc(100dvh - 1rem)); overflow: hidden; border: 1px solid rgba(56,226,159,.24); border-radius: 20px; background: linear-gradient(155deg, #111f31, #07101c 62%); box-shadow: 0 35px 110px rgba(0,0,0,.68); }
.facebook-login-heading { grid-area: heading; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .72rem 1rem; border-bottom: 1px solid var(--line); background: rgba(15,28,45,.97); }
.facebook-login-heading > div { min-width: 0; }
.facebook-login-heading .section-kicker { font-size: .75rem; }
.facebook-login-heading h2 { margin: .22rem 0 .2rem; font-size: 1rem; }
.facebook-login-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.facebook-login-summary { grid-area: summary; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .58rem 1rem; border-bottom: 1px solid rgba(155,180,211,.08); background: rgba(7,16,28,.72); }
.facebook-login-summary > div { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.facebook-login-summary span:not(.facebook-login-state-dot) { color: var(--muted); font-size: .75rem; }
.facebook-login-summary strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.facebook-login-state-wrap { justify-content: flex-end; }
.facebook-login-state-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(255,188,66,.09); animation: pulse 1.5s ease-in-out infinite; }
.facebook-login-state-dot.active { background: var(--cyan); box-shadow: 0 0 0 4px rgba(67,200,245,.09); }
.facebook-login-state-dot.success { background: var(--green); box-shadow: 0 0 0 4px rgba(56,226,159,.1); animation: none; }
.facebook-login-state-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,113,132,.1); animation: none; }
.facebook-login-security { grid-area: security; display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 1.45fr); gap: .65rem; padding: .52rem .9rem; border-top: 1px solid rgba(155,180,211,.07); background: rgba(5,13,23,.58); }
.facebook-login-ttl-card, .facebook-login-privacy-panel { min-width: 0; border: 1px solid rgba(67,200,245,.13); border-radius: 11px; background: rgba(13,26,43,.72); }
.facebook-login-ttl-card { display: grid; align-content: center; gap: .3rem; padding: .55rem .65rem; }
.facebook-login-ttl-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.facebook-login-ttl-card > div:first-child > span { color: var(--muted); font-size: .75rem; font-weight: 700; }
#facebook-login-ttl { flex: 0 0 auto; padding: .22rem .45rem; border: 1px solid rgba(56,226,159,.2); border-radius: 999px; color: #b9f6da; background: rgba(56,226,159,.07); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; font-weight: 800; }
#facebook-login-ttl-note { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.facebook-login-ttl-track { height: 4px; overflow: hidden; border-radius: 99px; background: rgba(155,180,211,.1); }
#facebook-login-ttl-bar { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .35s linear; }
.facebook-login-privacy-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .65rem; padding: .48rem .62rem; }
.facebook-login-privacy-panel > strong { max-width: 120px; color: var(--cyan); font-size: .75rem; line-height: 1.45; }
.facebook-login-privacy-panel ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .48rem; margin: 0; padding: 0; list-style: none; }
.facebook-login-privacy-panel li { position: relative; padding-left: .65rem; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.facebook-login-privacy-panel li::before { position: absolute; top: .42em; left: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--green); content: ""; box-shadow: 0 0 0 3px rgba(56,226,159,.06); }
.facebook-login-privacy-panel code { color: #a7def2; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.facebook-login-message { grid-area: message; min-height: 36px; margin: 0; padding: .42rem 1rem; color: var(--muted-bright); background: rgba(7,14,25,.45); font-size: .76rem; line-height: 1.45; }
.facebook-login-message.error { color: #ffabb6; }
.facebook-login-diagnostic { grid-area: diagnostic; display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin: 0 .8rem .42rem; padding: .48rem .58rem; border: 1px solid rgba(255,188,66,.3); border-radius: 10px; background: rgba(255,188,66,.075); }
.facebook-login-diagnostic[hidden] { display: none; }
.facebook-login-diagnostic > div { min-width: 0; }
.facebook-login-diagnostic strong { color: #ffe0a1; font-size: .76rem; }
.facebook-login-diagnostic p { margin: .1rem 0 0; color: var(--muted-bright); font-size: .75rem; line-height: 1.45; }
.facebook-login-diagnostic.is-error { border-color: rgba(255,113,132,.38); background: rgba(255,113,132,.075); }
.facebook-login-diagnostic.is-error strong { color: #ffb9c2; }
.facebook-login-challenge-help { grid-area: help; margin: 0 .8rem .42rem; border: 1px solid rgba(255,188,66,.2); border-radius: 10px; background: rgba(255,188,66,.045); color: var(--muted-bright); }
.facebook-login-challenge-help summary { display: flex; align-items: center; gap: .55rem; padding: .42rem .58rem; cursor: pointer; list-style: none; }
.facebook-login-challenge-help summary::-webkit-details-marker { display: none; }
.facebook-login-challenge-help summary > span:last-child { display: grid; min-width: 0; gap: .08rem; }
.facebook-login-challenge-help summary strong { color: #ffe0a1; font-size: .76rem; }
.facebook-login-challenge-help summary small { overflow: hidden; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.facebook-login-help-icon { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,188,66,.3); border-radius: 50%; color: var(--amber); font-size: .76rem; font-weight: 900; }
.facebook-login-challenge-help.active { border-color: rgba(255,188,66,.52); background: rgba(255,188,66,.09); box-shadow: 0 0 0 3px rgba(255,188,66,.04); }
.facebook-login-challenge-help.active .facebook-login-help-icon { animation: pulse 1.5s ease-in-out infinite; }
.facebook-login-challenge-help.resolved { border-color: rgba(56,226,159,.28); background: rgba(56,226,159,.055); }
.facebook-login-challenge-help.resolved summary strong { color: #bdf5dc; }
.facebook-login-challenge-body { padding: 0 .7rem .55rem 2.25rem; border-top: 1px solid rgba(255,188,66,.12); }
.facebook-login-challenge-body ol { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .3rem 1.1rem; margin: .48rem 0 0; padding-left: .75rem; }
.facebook-login-challenge-body li { padding-left: .1rem; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.facebook-login-challenge-body li strong { color: var(--muted-bright); }
.facebook-login-workspace { grid-area: workspace; display: grid; grid-template-rows: auto minmax(0,1fr); min-width: 0; min-height: 0; padding: 0 .8rem; }
.facebook-login-workspace-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding: .38rem .08rem; border-radius: 8px 8px 0 0; background: rgba(7,16,28,.96); backdrop-filter: blur(10px); }
.facebook-login-frame-status { display: inline-flex; align-items: center; min-width: 0; gap: .38rem; color: var(--muted-bright); font-size: .75rem; }
.facebook-login-frame-status > span { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 3px rgba(67,200,245,.08); }
.facebook-login-frame-status[data-state="loading"] > span, .facebook-login-frame-status[data-state="working"] > span { animation: pulse 1.2s ease-in-out infinite; }
.facebook-login-frame-status[data-state="challenge"] { color: #ffe0a1; }
.facebook-login-frame-status[data-state="challenge"] > span { background: var(--amber); box-shadow: 0 0 0 3px rgba(255,188,66,.09); }
.facebook-login-frame-status[data-state="ready"] > span { background: var(--green); box-shadow: 0 0 0 3px rgba(56,226,159,.09); }
.facebook-login-frame-status[data-state="error"] { color: #ffabb6; }
.facebook-login-frame-status[data-state="error"] > span { background: var(--danger); }
.facebook-login-frame-status em { flex: 0 0 auto; padding: .15rem .32rem; border: 1px solid rgba(56,226,159,.22); border-radius: 999px; color: #bdf5dc; background: rgba(56,226,159,.07); font-size: .75rem; font-style: normal; font-weight: 800; }
.facebook-login-view-tools, .facebook-login-zoom-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .28rem; }
.login-tool-button { min-height: 34px; padding: .34rem .5rem; border: 1px solid rgba(67,200,245,.22); border-radius: 7px; color: #b9eaff; background: rgba(67,200,245,.055); font: inherit; font-size: .75rem; font-weight: 750; cursor: pointer; }
.login-tool-button:hover:not(:disabled) { border-color: rgba(67,200,245,.52); color: #e1f8ff; background: rgba(67,200,245,.11); }
.login-tool-button[aria-pressed="true"] { border-color: rgba(56,226,159,.42); color: #d7ffec; background: rgba(56,226,159,.11); }
.login-tool-button.warning { border-color: rgba(255,188,66,.24); color: #ffe0a1; background: rgba(255,188,66,.055); }
.login-tool-button.warning:hover:not(:disabled) { border-color: rgba(255,188,66,.5); background: rgba(255,188,66,.11); }
.login-tool-button.icon-only { width: 34px; padding: 0; font-size: .82rem; }
.login-tool-button:disabled { opacity: .38; cursor: wait; }
#facebook-login-zoom-level { min-width: 112px; color: var(--muted-bright); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; text-align: center; }
.facebook-login-frame-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid rgba(67,200,245,.2); border-radius: 13px; background: radial-gradient(circle at center, rgba(67,200,245,.07), transparent 60%), #02070d; scrollbar-color: rgba(67,200,245,.35) rgba(7,16,28,.8); user-select: none; }
.facebook-login-frame-stage img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; cursor: crosshair; transform: scale(var(--facebook-login-frame-zoom, 1)); transform-origin: 0 0; -webkit-user-drag: none; touch-action: manipulation; }
.facebook-login-frame-stage.click-locked img { pointer-events: none; cursor: wait; filter: saturate(.72); }
.facebook-login-frame-stage img[hidden] { display: none; }
.facebook-login-frame-placeholder { display: flex; max-width: 430px; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: 1rem; color: var(--muted-bright); text-align: center; }
.facebook-login-frame-placeholder strong { font-size: .82rem; }
.facebook-login-frame-placeholder small { color: var(--muted); font-size: .75rem; line-height: 1.55; }
.login-frame-spinner { width: 28px; height: 28px; margin-bottom: .2rem; border: 3px solid rgba(67,200,245,.16); border-top-color: var(--cyan); border-radius: 50%; animation: rotate .85s linear infinite; }
.facebook-login-click-marker { position: absolute; z-index: 2; width: 18px; height: 18px; border: 2px solid var(--green); border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); box-shadow: 0 0 0 4px rgba(56,226,159,.12); animation: facebook-login-click .5s ease-out forwards; }
@keyframes facebook-login-click { from { opacity: 1; scale: .65; } to { opacity: 0; scale: 1.45; } }
.facebook-login-controls { grid-area: controls; display: grid; grid-template-columns: minmax(300px, 1fr) auto auto; align-items: end; gap: .65rem; padding: .62rem .8rem; }
.facebook-login-text-form { display: grid; gap: .28rem; min-width: 0; }
.facebook-login-text-form label { color: var(--muted-bright); font-size: .76rem; }
.facebook-login-text-form > div { display: flex; min-width: 0; gap: .4rem; }
.facebook-login-text-form input { width: 100%; min-width: 0; padding: .62rem .68rem; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--text); background: #07111e; font-size: .82rem; }
.facebook-login-text-form input:focus { border-color: rgba(56,226,159,.48); box-shadow: 0 0 0 3px rgba(56,226,159,.055); }
.facebook-login-text-form small { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.facebook-login-text-form .primary-button { flex: 0 0 auto; white-space: nowrap; }
.facebook-login-keyboard, .facebook-login-scroll { display: flex; flex-wrap: wrap; gap: .32rem; }
.facebook-login-controls .row-button { min-height: 34px; font-size: .75rem; }
.facebook-login-keyboard { max-width: 245px; }
.facebook-login-scroll { max-width: 200px; }
.facebook-login-controls button:disabled, .facebook-login-controls input:disabled { opacity: .42; cursor: wait; }
.facebook-login-actions { grid-area: actions; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .62rem .9rem; border-top: 1px solid rgba(56,226,159,.14); background: rgba(15,28,45,.96); }
.facebook-login-actions p { max-width: 760px; margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.facebook-login-actions > div { display: flex; flex: 0 0 auto; gap: .45rem; }
.facebook-login-actions .primary-button { margin: 0; }
.facebook-login-actions button:disabled { opacity: .45; cursor: wait; }
#facebook-login-refresh { color: #a7def2; border-color: rgba(67,200,245,.25); background: rgba(67,200,245,.055); }
#facebook-login-refresh:hover:not(:disabled) { color: #d9f5ff; border-color: rgba(67,200,245,.48); }
.facebook-login-modal.is-focus-mode { width: min(1500px, 100%); height: calc(100dvh - .7rem); }
.facebook-login-modal.is-focus-mode .facebook-login-heading { padding-block: .48rem; }
.facebook-login-modal.is-focus-mode .facebook-login-heading .section-kicker,
.facebook-login-modal.is-focus-mode .facebook-login-heading p,
.facebook-login-modal.is-focus-mode .facebook-login-security { display: none; }
.facebook-login-modal.is-focus-mode .facebook-login-challenge-help:not([open]) { display: none; }
.facebook-login-modal:fullscreen { width: 100vw; height: 100dvh; max-width: none; min-height: 0; border: 0; border-radius: 0; }
.facebook-login-modal:fullscreen .facebook-login-frame-stage { min-height: 300px; }

@media (max-height: 820px) and (min-width: 621px) {
  .facebook-login-modal {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    grid-template-rows: auto auto auto auto auto auto minmax(45dvh, 1fr) auto auto;
  }
  .facebook-login-workspace { min-height: 45dvh; }
}

/* Keep the remote browser usable on short desktop viewports (for example a
   1280×580 CSS viewport produced by 150% Windows display scaling).  The
   explanatory chrome collapses before the interactive frame, and the modal
   itself scrolls when an expanded challenge guide needs extra room. */
@media (max-height: 700px) and (min-width: 621px) {
  .facebook-login-backdrop { padding: .2rem; }
  .facebook-login-modal {
    width: min(1500px, 100%);
    height: calc(100dvh - .4rem);
    max-height: calc(100dvh - .4rem);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    grid-template-rows: auto auto 0 auto auto auto minmax(55dvh, 1fr) auto auto;
  }
  .facebook-login-heading { align-items: center; padding: .38rem .72rem; }
  .facebook-login-heading .section-kicker,
  .facebook-login-heading p,
  .facebook-login-security { display: none; }
  .facebook-login-heading h2 { margin: 0; font-size: .92rem; }
  .facebook-login-summary { padding: .34rem .72rem; }
  .facebook-login-message { min-height: 0; padding: .3rem .72rem; }
  .facebook-login-diagnostic { margin: 0 .65rem .3rem; padding: .36rem .5rem; }
  .facebook-login-challenge-help { margin: 0 .65rem .3rem; }
  .facebook-login-challenge-help summary { padding: .34rem .5rem; }
  .facebook-login-challenge-body { padding-bottom: .4rem; }
  .facebook-login-workspace { min-height: 55dvh; padding: 0 .65rem; }
  .facebook-login-workspace-toolbar { position: sticky; top: 0; }
  .facebook-login-controls { gap: .45rem; padding: .42rem .65rem; }
  .facebook-login-text-form input { padding-block: .48rem; }
  .facebook-login-actions { padding: .42rem .72rem; }
  .facebook-login-actions p { display: none; }
}

@media (max-width: 900px) {
  .account-auth-onboarding { grid-template-columns: 1fr; }
  .facebook-login-modal { min-height: 0; border-radius: 15px; }
  .facebook-login-security { grid-template-columns: 1fr; }
  .facebook-login-privacy-panel > strong { max-width: none; }
  .facebook-login-controls { grid-template-columns: 1fr; align-items: stretch; }
  .facebook-login-keyboard, .facebook-login-scroll { max-width: none; }
  .facebook-login-workspace-toolbar { align-items: flex-start; flex-direction: column; }
  .facebook-login-view-tools { width: 100%; }
  .facebook-login-frame-stage { min-height: 230px; }
  .facebook-login-challenge-body ol { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .account-auth-onboarding { gap: .5rem; margin-top: 0; }
  .account-auth-onboarding li { padding: .65rem; }
  .facebook-login-backdrop { padding: 0; }
  .facebook-login-modal { display: block; width: 100%; height: 100dvh; overflow-x: hidden; overflow-y: auto; border: 0; border-radius: 0; }
  .facebook-login-heading, .facebook-login-summary, .facebook-login-actions { align-items: flex-start; }
  .facebook-login-heading p { display: none; }
  .facebook-login-summary { align-items: center; padding: .48rem .62rem; }
  .facebook-login-state-wrap { justify-content: flex-end; }
  .facebook-login-security { gap: .45rem; padding: .42rem .5rem; }
  .facebook-login-privacy-panel { display: none; }
  .facebook-login-message { padding: .38rem .62rem; }
  .facebook-login-diagnostic { align-items: stretch; flex-direction: column; margin: .35rem .45rem; }
  .facebook-login-diagnostic .login-tool-button { width: 100%; }
  .facebook-login-challenge-help { margin: .35rem .45rem; }
  .facebook-login-challenge-help summary { padding: .5rem; }
  .facebook-login-challenge-help summary small { white-space: normal; }
  .facebook-login-challenge-body { padding: 0 .55rem .5rem 1.45rem; }
  .facebook-login-workspace { height: 52dvh; min-height: 330px; padding: 0 .45rem; }
  .facebook-login-workspace-toolbar { gap: .38rem; padding: .32rem 0; }
  .facebook-login-view-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .facebook-login-zoom-tools { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto 1.5fr; }
  #facebook-login-zoom-readable { grid-column: 1 / -1; }
  .login-tool-button { min-height: 42px; font-size: .75rem; }
  .login-tool-button.icon-only { width: 40px; }
  .facebook-login-frame-stage { min-height: 250px; }
  .facebook-login-controls { gap: .45rem; padding: .55rem; overflow-y: auto; }
  .facebook-login-text-form > div { align-items: stretch; flex-direction: column; }
  .facebook-login-text-form .primary-button { width: 100%; }
  .facebook-login-keyboard .row-button, .facebook-login-scroll .row-button { flex: 1 1 auto; }
  .facebook-login-actions { flex-direction: column; padding: .55rem .65rem; }
  .facebook-login-actions p { font-size: .75rem; }
  .facebook-login-actions > div { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .facebook-login-modal.is-focus-mode .facebook-login-summary,
  .facebook-login-modal.is-focus-mode .facebook-login-message { display: none; }
  .facebook-login-modal.is-focus-mode .facebook-login-workspace { height: 66dvh; min-height: 430px; }
}

/* Theme accessibility -----------------------------------------------------
   The resolved theme is written synchronously by theme.js before this sheet
   loads.  Keeping all light-theme overrides under html[data-theme] makes the
   system preference and an explicit choice share the exact same palette. */
.copy-format-button:focus-visible,
.selected-media-remove:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #edf2f7;
  --panel: rgba(255,255,255,.94);
  --panel-solid: #ffffff;
  --line: rgba(31,55,78,.14);
  --line-strong: rgba(31,55,78,.23);
  --text: #172536;
  --muted: #5c6b7b;
  --muted-bright: #3c4e61;
  --green: #087a52;
  --green-soft: rgba(8,122,82,.09);
  --cyan: #086e91;
  --violet: #6347bd;
  --amber: #8d5900;
  --danger: #c5324a;
  --success-fg: #08734d;
  --info-fg: #086582;
  --warning-fg: #815100;
  --danger-fg: #b92740;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --field-bg: #ffffff;
  --shadow: 0 22px 58px rgba(30,51,72,.14);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 76% -16%, rgba(8,122,82,.12), transparent 32rem),
    linear-gradient(145deg, #f7f9fc 0%, #eef3f8 54%, #f7f9fc 100%);
}
html[data-theme="light"] .ambient-one { background: radial-gradient(circle, rgba(8,122,82,.16), transparent 68%); }
html[data-theme="light"] .ambient-two { background: radial-gradient(circle, rgba(8,110,145,.12), transparent 68%); }
html[data-theme="light"] .topbar {
  border-bottom-color: rgba(31,55,78,.12);
  background: rgba(248,250,253,.88);
  box-shadow: 0 5px 24px rgba(31,55,78,.06);
}
html[data-theme="light"] .skip-link { color: #fff; background: var(--green); }

html[data-theme="light"] .theme-control {
  background: rgba(255,255,255,.9);
  box-shadow: 0 4px 18px rgba(31,55,78,.07), inset 0 1px #fff;
}
html[data-theme="light"] .theme-options { background: #edf2f7; }
html[data-theme="light"] .theme-option:hover { background: rgba(255,255,255,.82); }
html[data-theme="light"] .theme-option[aria-pressed="true"] {
  color: var(--success-fg);
  border-color: rgba(8,122,82,.25);
  background: #fff;
  box-shadow: 0 2px 9px rgba(31,55,78,.11);
}

html[data-theme="light"] :is(
  .privacy-pill, .connection-pill, .source-badge, .soft-badge, .count-badge,
  .icon-button, .admin-link, .ghost-button, .config-sync-state
) { background: rgba(255,255,255,.82); }
html[data-theme="light"] .privacy-pill { color: var(--success-fg); background: rgba(8,122,82,.06); }
html[data-theme="light"] body.admin-route .privacy-pill { color: var(--info-fg); background: rgba(8,110,145,.06); }
html[data-theme="light"] :is(.icon-button, .admin-link, .ghost-button):hover { background: #fff; }

html[data-theme="light"] .status-strip {
  background: linear-gradient(105deg, rgba(255,255,255,.96), rgba(241,246,250,.92));
  box-shadow: 0 12px 35px rgba(31,55,78,.07);
}
html[data-theme="light"] :is(.metric-card, .panel) {
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(246,249,252,.94));
  box-shadow: 0 14px 40px rgba(31,55,78,.08);
}
html[data-theme="light"] .accent-card {
  border-color: rgba(8,122,82,.24);
  background: linear-gradient(145deg, rgba(234,248,241,.98), rgba(250,253,252,.96));
}
html[data-theme="light"] .ring-track { stroke: rgba(31,55,78,.12); }
html[data-theme="light"] progress,
html[data-theme="light"] progress::-webkit-progress-bar { background: rgba(31,55,78,.12); }
html[data-theme="light"] .bar.total {
  border: 1px solid #086e91;
  background: linear-gradient(180deg, rgba(8,110,145,.72), rgba(8,110,145,.28));
}
html[data-theme="light"] .bar.success { border: 1px solid #087a52; }
html[data-theme="light"] .legend-total { background: #086e91; }
html[data-theme="light"] .legend-success { background: #087a52; }
html[data-theme="light"] tbody tr:hover td,
html[data-theme="light"] .resource-table tbody tr:hover { background: rgba(8,110,145,.045); }
html[data-theme="light"] .task-item { background: rgba(246,249,252,.9); }

html[data-theme="light"] .admin-panel {
  border-color: rgba(8,122,82,.2);
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(239,246,246,.96));
}
html[data-theme="light"] .admin-console {
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(244,248,251,.98));
}
html[data-theme="light"] :is(
  .control-card, .revision-card, .health-card, .cloud-card,
  .resource-toolbar, .resource-table-wrap, .settings-card,
  .package-card, .upload-card, .asset-library-card, .queue-card,
  .automation-card, .automation-manager-row, .automation-rules-form,
  .bump-plan-card, .asset-toolbar, .asset-card, .selectable-picker,
  .selectable-card, .entity-section, .entity-advanced, .post-records-block,
  .copy-syntax-item, .copy-variant-card, .title-variant-card,
  .media-variant-card, .selected-media-empty, .selected-media-item
) { background: rgba(255,255,255,.86); }
html[data-theme="light"] .admin-tabs { background: rgba(237,242,247,.9); }
html[data-theme="light"] .admin-nav-group + .admin-nav-group { border-top-color: var(--line); }
html[data-theme="light"] .admin-nav-label { color: #4b5d70; }
html[data-theme="light"] .admin-tab:hover { background: rgba(255,255,255,.8); }
html[data-theme="light"] .admin-tab.active {
  color: var(--success-fg);
  border-color: rgba(8,122,82,.23);
  background: linear-gradient(135deg, rgba(8,122,82,.1), rgba(8,110,145,.055));
  box-shadow: 0 5px 16px rgba(31,55,78,.08);
}
html[data-theme="light"] .console-stats article {
  background: linear-gradient(140deg, rgba(255,255,255,.98), rgba(239,245,249,.92));
}
html[data-theme="light"] .onboarding-step { background: rgba(141,89,0,.035); }
html[data-theme="light"] .onboarding-step.complete { background: rgba(8,122,82,.035); }
html[data-theme="light"] .onboarding-step.complete .onboarding-step-marker { color: #fff; background: var(--success-fg); }
html[data-theme="light"] .admin-data-error { border-color: rgba(185,39,64,.25); background: rgba(185,39,64,.055); }
html[data-theme="light"] .admin-data-error strong { color: var(--danger-fg); }
html[data-theme="light"] .admin-data-error.feed-error { border-color: rgba(141,89,0,.24); background: rgba(141,89,0,.055); }
html[data-theme="light"] .admin-data-error.feed-error strong { color: var(--warning-fg); }
html[data-theme="light"] .queue-create-help[data-state="ready"] { color: var(--success-fg); }
html[data-theme="light"] .resource-table th { background: #f0f4f8; }
html[data-theme="light"] .mini-tag { background: rgba(31,55,78,.035); }
html[data-theme="light"] .mini-tag.category { color: #5845a5; border-color: rgba(88,69,165,.22); background: rgba(88,69,165,.055); }
html[data-theme="light"] .group-category-chip { color: var(--muted-bright); background: rgba(255,255,255,.88); }
html[data-theme="light"] .group-category-chip:hover { color: var(--text); background: #fff; }
html[data-theme="light"] .group-category-chip[aria-pressed="true"] { color: var(--success-fg); border-color: rgba(8,122,82,.3); background: rgba(8,122,82,.08); }
html[data-theme="light"] .group-category-chip[aria-pressed="true"] strong { color: #fff; background: var(--success-fg); }
html[data-theme="light"] .group-category-row td { border-color: rgba(8,110,145,.12); background: rgba(8,110,145,.045); }
html[data-theme="light"] .group-category-row strong { color: var(--info-fg); }
html[data-theme="light"] .schedule-group-picker { background: rgba(245,249,252,.94); }
html[data-theme="light"] :is(.schedule-group-category-panel, .schedule-group-custom-panel) { background: rgba(255,255,255,.78); }
html[data-theme="light"] .schedule-group-mode-switch { background: rgba(31,55,78,.035); }
html[data-theme="light"] .schedule-group-category-card { background: rgba(255,255,255,.9); }
html[data-theme="light"] .schedule-group-category-card.selected { background: rgba(8,122,82,.075); }
html[data-theme="light"] .schedule-group-category-card.selected::after { color: #fff; background: var(--success-fg); }
html[data-theme="light"] .schedule-group-selection-summary.invalid,
html[data-theme="light"] .schedule-capacity-summary[data-state="invalid"] { background: rgba(185,39,64,.055); }
html[data-theme="light"] .schedule-capacity-summary { background: rgba(8,122,82,.055); }
html[data-theme="light"] .schedule-capacity-summary[data-state="notice"] { background: rgba(141,89,0,.055); }
html[data-theme="light"] .schedule-capacity-summary[data-state="notice"] .schedule-capacity-copy > small { color: var(--warning-fg); }
html[data-theme="light"] .schedule-capacity-summary[data-state="invalid"] .schedule-capacity-copy > small { color: var(--danger-fg); }
html[data-theme="light"] .row-button { background: rgba(244,247,250,.92); }
html[data-theme="light"] .row-button:hover { background: #fff; }
html[data-theme="light"] .persistence-tier { background: rgba(247,250,252,.9); }
html[data-theme="light"] .full-snapshot-tier { border-color: rgba(8,122,82,.2); background: linear-gradient(145deg, rgba(8,122,82,.045), rgba(8,110,145,.035)); }
html[data-theme="light"] .persistence-version-tag { color: var(--success-fg); border-color: rgba(8,122,82,.25); background: rgba(8,122,82,.07); }
html[data-theme="light"] .persistence-version-tag.legacy, html[data-theme="light"] .scope-pill { color: var(--muted-bright); background: rgba(31,55,78,.035); }
html[data-theme="light"] .scope-pill.full { color: var(--info-fg); border-color: rgba(8,110,145,.22); background: rgba(8,110,145,.055); }
html[data-theme="light"] .full-snapshot-gate { background: rgba(141,89,0,.055); }
html[data-theme="light"] .full-snapshot-gate strong, html[data-theme="light"] .full-snapshot-gate .text-button { color: var(--warning-fg); }
html[data-theme="light"] .full-snapshot-gate[data-state="ready"] { background: rgba(8,122,82,.055); }
html[data-theme="light"] .full-snapshot-gate[data-state="ready"] strong { color: var(--success-fg); }
html[data-theme="light"] .full-snapshot-row { background: rgba(255,255,255,.82); }
html[data-theme="light"] .full-snapshot-row.selected { border-color: rgba(8,122,82,.3); background: rgba(8,122,82,.065); }
html[data-theme="light"] .full-snapshot-empty.error, html[data-theme="light"] .full-snapshot-status.error { color: var(--danger-fg); }

html[data-theme="light"] select,
html[data-theme="light"] input,
html[data-theme="light"] textarea { color-scheme: light; }
html[data-theme="light"] :is(
  .login-modal input,
  .compact-select select,
  .form-grid input, .form-grid select, .form-grid textarea,
  .full-field textarea,
  .entity-field input, .entity-field select, .entity-field textarea,
  .entity-checkboxes,
  .automation-option-picker,
  .automation-option-picker > .selectable-picker-toolbar > input,
  .bump-plan-add select,
  .bump-plan-field input, .bump-plan-field select,
  .picker-search input, .selectable-picker-toolbar select,
  .copy-variant-card > textarea, .title-variant-card > input,
  .facebook-login-text-form input
) { color: var(--text); background: var(--field-bg); }
html[data-theme="light"] :is(input, textarea)::placeholder { color: #596879; opacity: 1; }
html[data-theme="light"] .search-field input { background: transparent; }
html[data-theme="light"] .switch-field { background: rgba(31,55,78,.025); }
html[data-theme="light"] .switch-control { background: #c8d2dc; }
html[data-theme="light"] .switch-control::after { background: #fff; box-shadow: 0 1px 4px rgba(31,55,78,.24); }
html[data-theme="light"] .switch-field input:checked + .switch-control { background: rgba(8,122,82,.23); }
html[data-theme="light"] .switch-field input:checked + .switch-control::after { background: var(--green); }
html[data-theme="light"] :is(.advanced-card textarea, .resource-json-field textarea) { color: #126442; }
html[data-theme="light"] .sticky-save {
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 35px rgba(31,55,78,.16);
}

html[data-theme="light"] .automation-safety-card {
  background: linear-gradient(135deg, rgba(141,89,0,.08), rgba(255,255,255,.9));
}
html[data-theme="light"] .automation-safety-card[data-armed="true"] {
  background: linear-gradient(135deg, rgba(8,122,82,.09), rgba(255,255,255,.92));
}
html[data-theme="light"] .automation-gates-card {
  background: linear-gradient(145deg, rgba(8,110,145,.055), rgba(255,255,255,.94));
}
html[data-theme="light"] .automation-resource-manager {
  background: linear-gradient(145deg, #f2f8fa, #fff);
}
html[data-theme="light"] .automation-operation-gates label,
html[data-theme="light"] .automation-option-card { background: rgba(255,255,255,.78); }
html[data-theme="light"] .mini-tag.info { color: var(--info-fg); border-color: rgba(8,110,145,.24); background: rgba(8,110,145,.065); }
html[data-theme="light"] .automation-operation-gates .lead-scan-gate { border-color: rgba(8,110,145,.24); background: rgba(8,110,145,.055); }
html[data-theme="light"] .lead-scan-gate small { color: var(--info-fg); }
html[data-theme="light"] .automation-card.lead-scan-card { border-color: rgba(8,110,145,.2); background: rgba(8,110,145,.035); }
html[data-theme="light"] .automation-option-card.selected,
html[data-theme="light"] .selectable-card.selected { background: rgba(8,122,82,.065); }
html[data-theme="light"] .bump-plan-heading,
html[data-theme="light"] :is(.copy-variant-heading, .title-variant-heading, .media-variant-heading) { background: #edf3f7; }
html[data-theme="light"] .selectable-card.selected::after { color: #fff; box-shadow: 0 2px 8px rgba(31,55,78,.2); }

html[data-theme="light"] :is(.asset-preview-button, .selected-media-preview) { background: #e8eef3; }
html[data-theme="light"] :is(.asset-thumb, .picker-media-thumb, .selected-media-thumb) {
  background: radial-gradient(circle at 45% 35%, rgba(8,110,145,.1), #e5ecf2);
}
html[data-theme="light"] .picker-preview-button { color: #fff; background: rgba(23,37,54,.82); }
html[data-theme="light"] .copy-live-preview { color: var(--text); background: #f8fafc; }
html[data-theme="light"] .account-auth-onboarding li {
  background: linear-gradient(145deg, rgba(8,110,145,.07), rgba(255,255,255,.94));
}
html[data-theme="light"] .copy-format-button {
  color: var(--muted-bright);
  border-color: var(--line-strong);
  background: #f1f5f8;
}
html[data-theme="light"] .copy-format-button:hover {
  color: var(--text);
  border-color: rgba(8,122,82,.5);
  background: #fff;
}
html[data-theme="light"] .media-selection-panel {
  background: linear-gradient(145deg, #f4f8fb, #fff);
  box-shadow: 0 12px 30px rgba(31,55,78,.12);
}
html[data-theme="light"] .media-selection-actions { background: linear-gradient(to bottom, transparent, #fff 34%); }

html[data-theme="light"] .modal-backdrop { background: rgba(35,48,62,.47); }
html[data-theme="light"] :is(.login-modal, .entity-modal, .confirm-modal) {
  background: linear-gradient(155deg, #ffffff, #f2f6fa);
  box-shadow: 0 32px 90px rgba(25,43,61,.25);
}
html[data-theme="light"] .entity-modal-heading { background: rgba(247,250,252,.98); }
html[data-theme="light"] .entity-form-actions {
  background: rgba(250,252,254,.98);
  box-shadow: 0 -10px 28px rgba(31,55,78,.1);
}
html[data-theme="light"] .modal-close { background: rgba(239,244,248,.92); }
html[data-theme="light"] .toast { background: #fff; box-shadow: var(--shadow); }

html[data-theme="light"] .media-lightbox { background: #f7fafc; box-shadow: 0 30px 90px rgba(25,43,61,.28); }
html[data-theme="light"] .media-lightbox > header,
html[data-theme="light"] .media-lightbox > footer { background: rgba(246,249,252,.98); }
html[data-theme="light"] .media-lightbox-stage {
  background: radial-gradient(circle at center, rgba(8,110,145,.06), transparent 60%), #e6edf3;
}

html[data-theme="light"] .facebook-login-modal {
  background: linear-gradient(155deg, #ffffff, #eef4f8 62%);
  box-shadow: 0 32px 100px rgba(25,43,61,.3);
}
html[data-theme="light"] .facebook-login-heading,
html[data-theme="light"] .facebook-login-actions { background: rgba(248,250,252,.98); }
html[data-theme="light"] .facebook-login-summary { background: rgba(239,244,248,.9); }
html[data-theme="light"] .facebook-login-security { background: rgba(231,238,244,.72); }
html[data-theme="light"] .facebook-login-ttl-card,
html[data-theme="light"] .facebook-login-privacy-panel { background: rgba(255,255,255,.88); }
html[data-theme="light"] .facebook-login-message { background: rgba(246,249,251,.94); }
html[data-theme="light"] .facebook-login-workspace-toolbar { background: rgba(245,248,251,.97); }
html[data-theme="light"] .facebook-login-frame-stage {
  background: radial-gradient(circle at center, rgba(8,110,145,.06), transparent 60%), #e4ebf1;
  scrollbar-color: rgba(8,110,145,.42) #e4ebf1;
}
html[data-theme="light"] .login-tool-button {
  color: var(--info-fg);
  border-color: rgba(8,110,145,.24);
  background: rgba(8,110,145,.065);
}
html[data-theme="light"] .login-tool-button:hover:not(:disabled) { color: #064c63; background: rgba(8,110,145,.12); }
html[data-theme="light"] .login-tool-button[aria-pressed="true"] { color: var(--success-fg); background: rgba(8,122,82,.1); }
html[data-theme="light"] .login-tool-button.warning { color: var(--warning-fg); background: rgba(141,89,0,.07); }
html[data-theme="light"] #facebook-login-refresh { color: var(--info-fg); background: rgba(8,110,145,.06); }

/* Status foregrounds use darker accents on white rather than the luminous
   text colors used by the dark dashboard. */
html[data-theme="light"] :is(
  .config-sync-state.online,
  .account-login-status.verified .account-login-status-detail,
  .entity-status.enabled,
  .row-button.facebook-login-button,
  #facebook-login-ttl,
  .facebook-login-challenge-help.resolved summary strong,
  .facebook-login-frame-status em,
  .content-workflow code, .copy-syntax-item code
) { color: var(--success-fg); }
html[data-theme="light"] :is(
  .queue-primary .queue-operation-title,
  .queue-primary .queue-operation-detail,
  .queue-notice, .task-notice-summary, .task-notice-resume,
  .queue-formatting-evidence, .queue-formatting-evidence strong,
  .queue-event-chip,
  .facebook-login-privacy-panel code
) { color: var(--info-fg); }
html[data-theme="light"] :is(
  .queue-runtime-banner strong,
  .task-error-retry,
  .queue-formatting-evidence.partial,
  .queue-formatting-evidence.partial strong,
  .queue-blocked-reason,
  #automation-executor-status[data-state="pending"],
  .facebook-login-diagnostic strong,
  .facebook-login-challenge-help summary strong,
  .facebook-login-frame-status[data-state="challenge"]
) { color: var(--warning-fg); }
html[data-theme="light"] :is(
  .mini-tag.danger,
  .account-login-status.reauth .account-login-status-detail,
  .account-login-status.missing .account-login-status-detail,
  .entity-status.failed,
  .queue-runtime-banner[data-state="unhealthy"] strong,
  .queue-error, .task-error-summary, .task-error-stage,
  .record-error, .copy-byte-count.limit,
  .facebook-login-message.error,
  .facebook-login-diagnostic.is-error strong,
  .facebook-login-frame-status[data-state="error"]
) { color: var(--danger-fg); }
/* Keep actionable danger controls outside the mixed :is() list above.  The
   most-specific status selector in that list includes a trailing element,
   which would otherwise make its foreground beat the controls' hover/state
   rules and can produce danger text on the same danger background. */
html[data-theme="light"] .selected-media-remove { color: var(--danger-fg); }
html[data-theme="light"] .selected-media-remove:hover,
html[data-theme="light"] .selected-media-remove:focus-visible { color: #fff; background: var(--danger); }
html[data-theme="light"] .selected-media-thumb.missing { color: var(--warning-fg); }
html[data-theme="light"] .selected-media-item.missing { border-color: rgba(141,89,0,.42); }
html[data-theme="light"] .control-button,
html[data-theme="light"] .primary-button { color: #fff; background: linear-gradient(135deg, #08734d, #0a805c); }
html[data-theme="light"] .control-button.resume { color: #fff; background: linear-gradient(135deg, #8d5900, #986000); }
html[data-theme="light"] .control-button.danger { color: #fff; background: #b92740; }

@media (max-width: 1120px) {
  .theme-control-label { display: none; }
}
@media (max-width: 980px) and (min-width: 621px) {
  html[data-theme="light"] :is(.accounts-resource-table, .groups-resource-table, .schedules-resource-table) td:last-child { background: #fff; box-shadow: -12px 0 18px rgba(31,55,78,.12); }
  html[data-theme="light"] :is(.accounts-resource-table, .groups-resource-table, .schedules-resource-table) th:last-child { background: #f0f4f8; }
}
@media (max-width: 760px) {
  .top-actions { gap: .4rem; }
  .theme-control { gap: 0; padding: .22rem; }
  .theme-options { padding: .08rem; }
  .theme-option { width: 31px; min-height: 31px; padding: .25rem; }
  .theme-option-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .theme-option-icon { font-size: .86rem; }
}
@media (max-width: 620px) {
  html[data-theme="light"] .resource-table tbody tr { background: rgba(255,255,255,.88); }
  html[data-theme="light"] .resource-table tbody .group-category-row { background: rgba(8,110,145,.045); }
}
@media (max-width: 430px) {
  .topbar { padding-inline: .65rem; }
  .top-actions { gap: .28rem; }
  .theme-option { width: 29px; min-height: 30px; }
  .brand-copy { display: none; }
}

/* The light palette needs a ring that remains visible even where component
   rules deliberately set outline: 0/none.  A white separator plus the dark
   blue outline keeps the indicator above 3:1 on cards and colored buttons. */
html[data-theme="light"] :is(
  button, a, input, select, textarea, summary,
  [role="button"], [role="tab"], [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 3px solid #064c68 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #fff !important;
}
html[data-theme="light"] :is(
  .selectable-card, .automation-option-card, .asset-card,
  .drop-zone, .switch-field, .file-row-button
):focus-within {
  outline: 3px solid #064c68 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #fff !important;
}
