:root{color-scheme:dark;--bg:#080807;--panel:#151411;--line:#3c3326;--gold:#e0bc79;--muted:#aba393;--text:#f5efe5;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{border:1px solid var(--line);background:#201d17;color:var(--text);border-radius:10px;padding:12px 18px;min-height:44px;cursor:pointer;font-weight:600}button:hover{border-color:var(--gold)}button:disabled{opacity:.5;cursor:wait}a{color:var(--gold);text-decoration:none}input,select,textarea{width:100%;border:1px solid var(--line);background:#0e0d0b;color:var(--text);border-radius:10px;padding:13px 14px;min-height:46px;font-size:16px;outline:none}input:focus,select:focus,textarea:focus{border-color:var(--gold)}input[type=checkbox]{width:21px;height:21px;min-height:21px;accent-color:var(--gold)}label{display:block;color:#d9cfbd;font-size:14px}label>input,label>select{margin-top:9px}.app-header{height:88px;border-bottom:1px solid #302a21;padding:0 32px;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#0d0c0a}.wordmark{display:flex;align-items:center;gap:13px;min-width:0}.brand-mark{font-size:31px;border:1px solid #6b5431;border-radius:12px;color:var(--gold);width:46px;height:46px;text-align:center;line-height:43px;background:linear-gradient(135deg,#332819,#17130d)}.wordmark strong{font-size:22px;letter-spacing:1px;display:block}.wordmark small{display:block;color:var(--muted);margin-top:6px;max-width:55vw;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.app-header>a{font-size:13px;white-space:nowrap}.main-tabs{height:64px;display:flex;align-items:center;gap:8px;padding:8px 30px;border-bottom:1px solid #302a21}.main-tabs button{min-width:110px;background:none;border-color:transparent;color:var(--muted);font-size:15px}.main-tabs .active{background:#2c2417;border-color:#6b5431;color:var(--gold)}#workspace{height:calc(100dvh - 152px);height:calc(100vh - 152px);overflow:auto;position:relative}.module-frame{display:block;width:100%;height:100%;border:0;background:var(--bg)}.panel{border:1px solid var(--line);border-radius:16px;background:var(--panel);padding:28px}.manager-grid{max-width:1440px;padding:36px 32px;margin:auto;display:grid;grid-template-columns:340px minmax(0,1fr);gap:32px}.create-panel{align-self:start;position:sticky;top:24px}.eyebrow{font-size:12px;letter-spacing:3px;color:var(--gold)}h1{font-size:24px;margin:10px 0 28px}h2{font-size:20px;margin:0}form>label{margin-bottom:22px}fieldset{border:1px solid var(--line);border-radius:12px;padding:8px 15px;margin:4px 0 25px}legend{font-size:13px;color:var(--muted);padding:0 6px}.checkline{display:flex;align-items:center;gap:13px;padding:13px 0;cursor:pointer}.checkline input{margin:0;flex-shrink:0}.checkline b{color:var(--text);font-size:14px}.checkline small{display:block;color:var(--muted);font-size:12px;margin-top:6px}.fixed{opacity:.65}.primary{background:linear-gradient(115deg,#ad8143,#e0c185);border:1px solid #b9975e;color:#21190d}.create-panel .primary{width:100%}.ghost{background:transparent}.section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.section-title span{color:var(--gold);font-size:15px;margin-left:8px}.customer-card{background:var(--panel);border:1px solid var(--line);padding:22px 24px;border-radius:14px;margin-bottom:16px}.customer-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.customer-title h3{margin:0;font-size:18px;overflow-wrap:anywhere}.tag{font-size:12px;color:var(--gold);border:1px solid #574429;padding:5px 9px;border-radius:6px;white-space:nowrap}.tag.off{color:#d69a8d;border-color:#633c33}.meta{display:flex;gap:16px;flex-wrap:wrap;color:var(--muted);font-size:13px;margin:15px 0 20px}.card-actions{display:flex;gap:8px;flex-wrap:wrap}.card-actions button{font-size:13px;padding:9px 12px}.permission-switch{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:13px;margin-left:auto}.permission-switch input{margin:0}.empty{min-height:180px;display:flex;align-items:center;justify-content:center;color:var(--muted);padding:30px;text-align:center}.permission-empty{height:100%;color:#e2c486;font-size:20px;display:flex;align-items:center;justify-content:center;padding:30px;text-align:center}.screen-grid{max-width:1100px;margin:auto;display:grid;grid-template-columns:1fr 1fr;gap:24px;padding:28px}.screen-grid h2{margin-bottom:22px}.mode-list{display:grid;gap:12px}.mode-option{text-align:left;display:flex;justify-content:space-between;align-items:center;min-height:64px}.mode-option.selected{border-color:var(--gold);background:#33291b;color:var(--gold)}.mode-option small{font-size:12px;font-weight:400}.screen-grid .sub{line-height:1.8;font-size:13px;color:var(--muted)}.screen-grid form label{margin-bottom:16px}.code-input{letter-spacing:8px;font-size:24px;text-align:center}.device{border-top:1px solid var(--line);padding:17px 0;display:flex;gap:12px;align-items:center}.device>div{flex:1;min-width:0;overflow-wrap:anywhere}.device small{display:block;color:var(--muted);margin-top:6px}.device button{font-size:12px;min-height:40px;padding:8px 10px}.error{color:#efa89a;font-size:13px;line-height:1.6;min-height:20px}.success{color:var(--gold)}#notice{display:none;position:fixed;bottom:calc(24px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);border:1px solid #77603a;background:#30271a;padding:13px 20px;max-width:90vw;border-radius:10px;box-shadow:0 8px 40px #0008;z-index:20;font-size:14px}dialog{background:var(--panel);color:var(--text);border:1px solid #685235;border-radius:16px;max-width:600px;width:calc(100% - 32px);padding:24px}dialog::backdrop{background:#000b}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.dialog-head button{background:none;border:0;font-size:24px;padding:0;min-width:44px}dialog textarea{resize:none;line-height:1.8;font-size:14px;margin-bottom:18px}dialog>.primary{width:100%}@media(max-width:780px){.app-header{height:78px;padding:0 16px}.wordmark strong{font-size:19px}.brand-mark{width:40px;height:40px;line-height:37px;font-size:27px}.app-header>a{font-size:12px}.main-tabs{height:60px;padding:8px 12px;gap:4px;justify-content:space-between}.main-tabs button{min-width:0;flex:1;padding:10px 7px;font-size:14px}#workspace{height:calc(100dvh - 138px)}.manager-grid{padding:20px 16px;grid-template-columns:1fr;gap:26px}.create-panel{position:static}.panel{padding:22px}.customer-card{padding:19px 17px}.customer-title h3{font-size:17px}.meta{gap:9px 15px}.card-actions button{flex:1;white-space:nowrap}.permission-switch{width:100%;margin:9px 0 0;padding-top:13px;border-top:1px solid var(--line)}.screen-grid{padding:18px 14px;grid-template-columns:1fr;gap:18px}.screen-grid .panel{padding:22px 18px}.section-title h2{font-size:19px}}
/* Keep the live controls within a desktop workspace, with a persistent module menu. */
.customer.needs-login .header-actions,.customer.needs-login .main-tabs{display:none!important}
.customer.needs-login #workspace{height:auto;min-height:0;width:100%;display:grid;place-items:center;padding:28px 16px;flex:1;overflow:auto}
.login-panel{width:100%;max-width:420px;padding:28px;border:1px solid #66502f;border-radius:18px;background:#17140e;box-shadow:0 20px 60px #0004}
.login-logo{display:block;width:76px;height:76px;border-radius:14px;margin:0 auto 18px;object-fit:cover}
.login-panel h1{text-align:center;font-size:24px;margin:0 0 10px;letter-spacing:1px}
.login-hint{text-align:center;font-size:13px;color:var(--muted);line-height:1.7;margin:0 0 26px}
.login-panel input{margin-top:10px;min-height:50px;letter-spacing:3px}
.login-panel .error{margin:10px 0;min-height:22px}
.login-panel button{width:100%;min-height:50px;font-size:16px}
@media (min-width: 1024px) {
  body.customer { display: grid; grid-template-columns: 176px minmax(0,1fr); grid-template-rows: 72px minmax(0,1fr); height: 100dvh; overflow: hidden; }
  .customer .app-header { grid-column: 1 / -1; grid-row: 1; height: 72px; padding: 0 24px; }
  .customer .wordmark strong { font-size: 20px; }
  .customer .wordmark small { margin-top: 4px; font-size: 12px; }
  .customer .main-tabs { grid-column: 1; grid-row: 2; height: 100%; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 10px; padding: 24px 12px; border-bottom: 0; border-right: 1px solid #302a21; background: #0d0c0a; }
  .customer .main-tabs button { width: 100%; min-width: 0; padding: 14px 12px; font-size: 14px; text-align: left; }
  .customer #workspace { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; height: calc(100dvh - 72px); overflow: auto; }
}
@media (min-width: 1024px) and (max-width: 1179px) {
  body.customer { grid-template-columns: 156px minmax(0,1fr); }
  .customer .main-tabs { padding: 18px 10px; }
  .customer .main-tabs button { padding: 12px 8px; font-size: 13px; }
}
@supports not (height: 100dvh) {
  @media (min-width: 1024px) {
    body.customer { height: 100vh; }
    .customer #workspace { height: calc(100vh - 72px); }
  }
  @media (max-width: 780px) {
    .customer #workspace { height: calc(100vh - 138px); }
  }
}
/* Six functional sections share a persistent desktop sidebar. */
.workspace-view { height:100%; min-height:0; position:relative; }
.workspace-view[hidden] { display:none !important; }
.module-loading { position:absolute; inset:0; background:var(--bg); font-size:15px; }
.settings-page-title { max-width:1420px; margin:0 auto; padding:30px 28px 0; }
.settings-page-title h1 { margin:0 0 12px; font-size:25px; }
.settings-page-title p { margin:0; color:var(--muted); font-size:14px; line-height:1.8; }
.connection-grid { max-width:1420px; }
.apk-link { display:inline-block; color:var(--gold); margin-top:18px; font-size:14px; }
.display-grid { max-width:1420px; margin:auto; padding:28px; display:grid; grid-template-columns:310px minmax(0,1fr); gap:24px; align-items:start; }
.display-grid .panel { min-width:0; padding:22px; }
.display-grid h2 { margin-bottom:22px; }
.display-grid .sub { color:var(--muted); font-size:13px; line-height:1.8; }
.tv-preview { width:100%; aspect-ratio:16/9; overflow:hidden; border-radius:10px; background:#080807; position:relative; }
.tv-preview iframe { width:100%; height:100%; border:0; display:block; }
@supports not (aspect-ratio:16/9) { .tv-preview { height:0; padding-top:56.25%; }.tv-preview iframe { position:absolute; inset:0; } }
@media (max-width:1023px) {
 .customer .main-tabs { height:104px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:8px 12px; }
 .customer .main-tabs button { width:100%; min-width:0; padding:10px 3px; font-size:13px; white-space:nowrap; }
 .customer #workspace { height:calc(100vh - 192px); height:calc(100dvh - 192px); }
 .display-grid { grid-template-columns:1fr; }
}
@media (max-width:780px) {
 .customer #workspace { height:calc(100vh - 182px); height:calc(100dvh - 182px); }
 .settings-page-title { padding:22px 16px 0; }.settings-page-title h1 { font-size:22px; }
 .display-grid { padding:20px 14px; gap:18px; }.display-grid .panel { padding:18px; }
}
/* Independent blind-template library and new-template editor. */
.blind-template-page { max-width:1460px; margin:auto; padding:28px; }
.template-page-header { display:flex; justify-content:space-between; align-items:center; gap:24px; margin-bottom:18px; }
.template-page-header h1 { margin:0 0 8px; font-size:26px; }
.template-page-header p,.blind-template-page .sub { color:var(--muted); font-size:14px; line-height:1.7; margin:0; }
.create-template-button { min-height:54px; padding:14px 26px; font-size:16px; box-shadow:0 5px 20px #b9975e24; white-space:nowrap; }
.template-card-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.blind-template-card { padding:24px; border:1px solid var(--line); border-radius:14px; background:var(--panel); min-width:0; }
.template-card-top { display:flex; justify-content:space-between; color:var(--gold); font-size:12px; margin-bottom:18px; }
.template-card-top small { color:var(--muted); font-size:12px; }
.blind-template-card h2 { overflow-wrap:anywhere; font-size:25px; }
.blind-template-card p { color:var(--muted); font-size:14px; margin:12px 0 22px; }
.template-card-actions,.template-level-actions { display:flex; gap:10px; flex-wrap:wrap; }
.template-card-actions button { flex:1; }
.template-section-title { display:flex; align-items:center; gap:14px; margin:30px 0 18px; flex-wrap:wrap; }
.template-section-title h2 { margin:0; font-size:19px; }
.template-section-title > span { color:var(--muted); font-size:13px; }
.template-level-actions { margin-left:auto; }
.template-library-empty { padding:32px 20px; color:var(--muted); font-size:14px; text-align:center; border:1px dashed var(--line); border-radius:12px; grid-column:1/-1; }
.template-editor-grid { display:grid; grid-template-columns:310px minmax(0,1fr); gap:22px; align-items:start; }
.template-editor-grid .panel { min-width:0; padding:24px; }
.template-editor-grid h2 { margin-bottom:24px; font-size:19px; }
.template-info-panel label { margin-bottom:22px; }
.template-generator-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.template-level-panel { margin-top:22px; padding:24px; }
.template-level-panel .template-section-title { margin:0 0 20px; }
.template-level-scroll { overflow-x:auto; }
.template-level-table { width:100%; min-width:650px; border-collapse:collapse; }
.template-level-table th { color:var(--muted); font-weight:400; font-size:13px; text-align:left; padding:12px 8px; }
.template-level-table td { padding:10px 8px; border-top:1px solid var(--line); }
.template-level-table td input { min-width:80px; padding:11px; }
.template-level-table td:first-child { width:60px; color:var(--gold); }
.template-level-table td:last-child { width:76px; }
.template-level-panel > h2 { margin-bottom:20px; }
.template-editor-footer { display:flex; justify-content:flex-end; padding:10px 0 20px; }
@media(max-width:1100px) { .template-editor-grid { grid-template-columns:1fr; }.template-generator-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:650px) {
 .blind-template-page { padding:20px 14px; }.template-page-header { align-items:stretch; flex-direction:column; gap:18px; }.template-page-header h1 { font-size:23px; }
 .template-page-header .create-template-button { width:100%; }.template-card-grid { grid-template-columns:1fr; gap:14px; }.blind-template-card { padding:20px; }
 .template-generator-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.template-editor-grid .panel,.template-level-panel { padding:18px; }
 .template-level-actions { margin-left:0; width:100%; }.template-editor-footer .primary { width:100%; }
}
/* A compact table editor, opened over the current controller page. */
dialog.blind-template-dialog { width:calc(100vw - 40px); max-width:820px; max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px); padding:0; overflow:hidden; border:1px solid #675334; border-radius:14px; background:var(--panel); color:var(--text); }
dialog.blind-template-dialog::backdrop { background:#000b; }
.blind-template-dialog form { display:flex; flex-direction:column; max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px); min-height:0; margin:0; }
.template-dialog-header { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:18px 24px; border-bottom:1px solid var(--line); flex-shrink:0; }
.template-dialog-header h2 { margin:0; font-size:20px; }
.template-dialog-header button { border:0; background:none; min-height:32px; width:32px; font-size:26px; padding:0; color:var(--muted); }
.template-dialog-body { padding:20px 24px 4px; overflow:auto; min-height:0; }
.template-dialog-info { display:grid; grid-template-columns:minmax(0,1fr) 150px; gap:18px; margin-bottom:24px; }
.template-dialog-info label { font-size:13px; margin:0; min-width:0; }
.template-dialog-info select { -webkit-appearance:none; appearance:none; width:100%; height:46px; padding:10px 32px 10px 14px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--text); font:inherit; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23b6ad9c' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; }
.template-table-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; }
.template-table-heading h3 { font-size:15px; margin:0; }
.template-table-heading > div { display:flex; gap:8px; }
.template-table-heading button { min-height:36px; padding:7px 12px; font-size:12px; }
.blind-template-dialog .template-level-table { min-width:600px; }
.blind-template-dialog .template-level-table th { padding:10px 6px; font-size:12px; white-space:nowrap; }
.blind-template-dialog .template-level-table td { padding:8px 6px; }
.blind-template-dialog .template-level-table input { min-width:65px; padding:10px 8px; font-size:14px; }
.blind-template-dialog .template-level-table td:first-child { width:48px; font-size:13px; }
.blind-template-dialog .template-level-table td:last-child { width:60px; }
.blind-template-dialog .template-level-table button { padding:8px 10px; min-height:36px; font-size:12px; }
.template-dialog-hint { color:var(--muted); font-size:12px; line-height:1.8; margin:10px 0 14px; }






.blind-template-dialog .error { margin:14px 0 8px; }
.template-dialog-footer { display:flex; align-items:center; justify-content:flex-end; gap:14px; padding:15px 24px; border-top:1px solid var(--line); flex-shrink:0; }
.template-dialog-footer > div { display:flex; gap:10px; flex-shrink:0; }
.template-dialog-footer button { min-height:42px; padding:10px 22px; font-size:14px; }
@media(max-width:650px) {
 dialog.blind-template-dialog { width:calc(100vw - 24px); max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); }
 .blind-template-dialog form { max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); }
 .template-dialog-header { padding:15px 18px; }.template-dialog-header h2 { font-size:18px; }.template-dialog-body { padding:18px 16px 2px; }
 .template-dialog-info { grid-template-columns:minmax(0,1fr) 94px; gap:12px; margin-bottom:20px; }
 .template-dialog-info label { font-size:12px; }.template-dialog-info input { font-size:14px; padding:11px; }
 .template-table-heading h3 { font-size:14px; }.template-table-heading button { font-size:11px; padding:7px 9px; }
 .blind-template-dialog .template-level-table { min-width:520px; }
 .template-dialog-footer { padding:14px 16px; gap:10px; }.template-dialog-footer > div { gap:8px; }.template-dialog-footer button { padding:10px 16px; }
}

.blind-template-dialog .error:empty { display:none; }
dialog.blind-template-preview[open] { display:flex; flex-direction:column; }
.blind-template-preview .template-dialog-body { flex:1; padding-bottom:18px; }
.blind-template-preview .template-level-table { min-width:480px; }
.blind-template-preview .template-level-table th:not(:first-child),.blind-template-preview .template-level-table td:not(:first-child) { text-align:right; }
.blind-template-preview .template-level-table td { font-size:14px; padding:12px 6px; }
.template-card-actions button { padding:10px 12px; font-size:13px; }

/* The phone is the primary controller: one scroll area and usable touch targets. */
@media(max-width:1023px){
 body.customer{display:flex;flex-direction:column;width:100%;height:100vh;height:100dvh;height:var(--controller-height,100dvh);min-height:0;overflow:hidden}
 .customer .app-header{flex:none;min-height:64px;height:auto;padding:10px max(14px,env(safe-area-inset-right)) 10px max(14px,env(safe-area-inset-left));gap:10px}
 .customer .wordmark{gap:10px}.customer .wordmark strong{font-size:18px;letter-spacing:.3px}.customer .wordmark small{font-size:11px;margin-top:4px;max-width:52vw}
 .customer .brand-mark{flex:none;width:36px;height:36px;line-height:33px;font-size:25px;border-radius:10px}
 .customer .app-header>a{display:flex;align-items:center;min-height:44px;font-size:12px}
 .customer .main-tabs{flex:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));height:auto;padding:6px 10px 8px;gap:5px;border-bottom:1px solid var(--line)}
 .customer .main-tabs button{min-width:0;min-height:44px;padding:8px 3px;font-size:13px;line-height:1.35;border-radius:9px}
 .customer #workspace{flex:1;min-height:0;height:auto!important;width:100%;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
 .customer .workspace-view{min-width:0}.customer .module-frame{width:100%;height:100%}
 .customer.controller-keyboard .app-header,.customer.controller-keyboard .main-tabs{display:none}
 .customer #notice{z-index:1000;bottom:calc(12px + env(safe-area-inset-bottom));font-size:14px;line-height:1.5;pointer-events:none}
 .customer :is(button,a,input,select,textarea):focus-visible{outline:2px solid #e0bc79;outline-offset:3px}
 .customer .settings-page-title{padding:20px 14px 0}.customer .settings-page-title h1{font-size:22px;margin-bottom:8px}.customer .settings-page-title p{font-size:13px;line-height:1.7}
 .customer :is(.connection-grid,.display-grid){padding:16px 12px calc(24px + env(safe-area-inset-bottom));gap:14px}
 .customer .screen-grid .panel,.customer .display-grid .panel{padding:18px 16px;border-radius:12px}
 .customer .screen-grid h2,.customer .display-grid h2{font-size:18px;margin-bottom:18px}
 .customer .screen-grid .code-input{font-size:26px;letter-spacing:7px;min-height:58px;font-variant-numeric:tabular-nums}
 .customer .mode-option{gap:12px;min-height:64px;padding:14px 12px;line-height:1.5}.customer .mode-option span{min-width:0;overflow-wrap:anywhere}.customer .mode-option small{flex:none}
 .customer .device{gap:10px;align-items:center}.customer .device button{min-height:44px;flex:none}.customer .error:empty{min-height:0;margin:0}
 .blind-template-page{padding:20px 12px calc(24px + env(safe-area-inset-bottom))}
 .template-card-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.template-card-actions button{min-width:0;min-height:44px}.template-card-actions .primary{grid-column:1/-1}
 .blind-template-card{padding:18px 16px}.blind-template-card h2{font-size:23px}.blind-template-card p{line-height:1.6;margin:10px 0 16px}
 dialog.blind-template-dialog{width:calc(100vw - 20px);max-height:calc(100vh - 20px);max-height:calc(var(--controller-height,100dvh) - 20px);border-radius:14px}
 .blind-template-dialog form{max-height:calc(100vh - 20px);max-height:calc(var(--controller-height,100dvh) - 20px)}
 .template-dialog-header{padding:12px 14px;gap:10px}.template-dialog-header h2{font-size:18px;line-height:1.5;min-width:0;overflow-wrap:anywhere}.template-dialog-header button{min-height:44px;min-width:44px;width:44px;flex:none}
 .template-dialog-body{padding:16px 14px 8px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
 .template-dialog-info{grid-template-columns:minmax(0,1fr) 94px;gap:12px;margin-bottom:18px}.template-dialog-info input,.template-dialog-info select{font-size:16px}
 .template-table-heading{align-items:center;flex-wrap:wrap;gap:10px}.template-table-heading>div{gap:8px}.template-table-heading button{min-height:44px;font-size:12px;padding:8px 10px}
 .blind-template-dialog .template-level-scroll{overflow:visible}
 .blind-template-dialog .template-level-table{display:block;min-width:0;width:100%;border:0}
 .blind-template-dialog .template-level-table thead{display:none}
 .blind-template-dialog .template-level-table tbody{display:grid;gap:12px}
 .blind-template-dialog .template-level-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#0f0e0b}
 .blind-template-dialog .template-level-table td{display:block;width:auto!important;min-width:0;padding:0;border:0;text-align:left}
 .blind-template-dialog .template-level-table td:first-child{grid-column:1;grid-row:1;align-self:center;color:var(--gold);font-size:14px;font-weight:600}
 .blind-template-dialog .template-level-table td:first-child:before{content:'级别 '}.blind-template-dialog .template-break-row td:first-child:before{content:''}
 .blind-template-dialog .template-level-table td:last-child{grid-column:2;grid-row:1;justify-self:end}
 .blind-template-dialog .template-level-table td[data-label]:before{display:block;content:attr(data-label);color:var(--muted);font-size:12px;line-height:1.5;margin-bottom:6px}
 .blind-template-dialog .template-level-table input{width:100%;min-width:0;min-height:46px;padding:10px;font-size:16px;line-height:1.4;font-variant-numeric:tabular-nums}
 .blind-template-dialog .template-level-table button{min-height:44px;padding:8px 14px;font-size:13px}
 .blind-template-dialog .template-break-row td input:disabled{opacity:.35}
 .template-dialog-footer{flex:none;padding:12px 14px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--panel)}
 .template-dialog-footer>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);width:100%;gap:10px}.template-dialog-footer button{min-width:0;min-height:46px;padding:10px;font-size:14px}
 .blind-template-preview .template-level-table td:first-child{grid-column:1/-1}.blind-template-preview .template-level-table td:last-child{grid-column:auto;grid-row:auto;justify-self:stretch}
 .blind-template-preview .template-level-table td[data-label]{font-size:16px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
}
@media(max-width:359px){.customer .wordmark strong{font-size:16px}.customer .main-tabs button{font-size:12px}.template-dialog-info{grid-template-columns:minmax(0,1fr)}.template-table-heading>div{width:100%;display:grid;grid-template-columns:1fr 1fr}}
@media(max-height:520px) and (max-width:1023px){.customer .app-header{display:none}.customer .main-tabs{grid-template-columns:repeat(6,minmax(0,1fr));padding:4px 8px}.customer .main-tabs button{font-size:11px;white-space:normal;min-height:44px}}

/* Persistent, easy-to-find screen actions. */
.customer .header-actions{display:flex;align-items:center;gap:12px;flex:none}
.customer .header-action{min-width:128px;min-height:44px;padding:10px 20px;font-size:14px;white-space:nowrap;border-radius:10px}
.customer .header-actions .primary{box-shadow:0 3px 16px #c99d4930}
.customer .header-actions .primary.active{outline:2px solid #ffe4a6;outline-offset:2px}
.customer .header-fullscreen{border-color:#a8864e;background:#292216;color:#f0d39d}
.customer .header-fullscreen:hover{background:#3a2d19;border-color:#e0bc79}
@media(max-width:1023px){
 .customer .app-header{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding-top:max(10px,env(safe-area-inset-top))}
 .customer .wordmark small{max-width:78vw}
 .customer .header-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:10px}
 .customer .header-action{width:100%;min-width:0;min-height:46px;padding:10px;font-size:15px}
 .customer .main-tabs{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
 .customer .main-tabs button{white-space:normal;line-height:1.4}
}
@media(max-height:520px) and (max-width:1023px){
 .customer .app-header{display:flex;padding:4px 10px;min-height:0;gap:10px}
 .customer .wordmark{display:none}.customer .header-actions{display:flex;justify-content:flex-end;gap:8px}
 .customer .header-action{width:auto;min-width:104px;min-height:40px;font-size:13px;padding:8px 14px}
 .customer .main-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}
}
.customer.controller-keyboard .app-header{display:none}
dialog.screen-fullscreen{position:fixed;inset:0;width:100vw;max-width:none;height:100vh;height:100dvh;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#080807;overflow:hidden}
dialog.screen-fullscreen::backdrop{background:#080807}
.screen-fullscreen iframe{display:block;width:100%;height:100%;border:0}
.screen-fullscreen .fullscreen-close{position:absolute;top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));min-height:44px;padding:10px 16px;border-color:#a8864e;background:#17130de8;color:#f5dfb5;z-index:2;font-size:14px}

.screen-fullscreen .fullscreen-content{position:relative;width:100%;height:100%;background:#080807}

/* The supplied artwork is displayed as a trophy mark beside the system name. */
.wordmark>div{min-width:0}.wordmark strong{line-height:1.3;overflow-wrap:anywhere}
.brand-mark.has-logo{position:relative;display:block;flex:none;width:54px;height:54px;overflow:hidden;border:1px solid #715a34;border-radius:11px;background:#02021c;line-height:normal}
.brand-mark.has-logo img{position:absolute;display:block;width:180%;height:180%;max-width:none;left:-40%;top:-9%;object-fit:contain}
@media(max-width:1023px){.customer .brand-mark.has-logo{width:48px;height:48px}.customer .wordmark strong{font-size:18px;letter-spacing:0}}
@media(max-width:359px){.customer .wordmark strong{font-size:16px}}
@media(max-width:780px){.manager .app-header{height:auto;min-height:78px;padding:12px 16px;flex-wrap:wrap;gap:12px}.manager .wordmark{gap:10px}.manager .wordmark strong{font-size:18px}.manager .brand-mark.has-logo{width:48px;height:48px}.manager .app-header>a{margin-left:auto}}
body.customer.needs-login{display:flex;flex-direction:column;min-height:0;height:100vh;height:var(--controller-height,100dvh);overflow:auto}
.customer.needs-login .app-header{height:auto;min-height:78px;flex:none}
@media(max-width:759px){.login-panel{padding:24px 20px}.customer.needs-login #workspace{padding-bottom:calc(24px + env(safe-area-inset-bottom))}}
/* Local UI preview only: no small-program connection or seating requests. */
.linkage-page{width:100%;max-width:960px;margin:auto;padding:28px}
.linkage-page-heading{margin-bottom:22px}.linkage-page-heading h1{margin:0 0 10px;font-size:25px}.linkage-page-heading p{margin:0;color:var(--muted);font-size:13px;line-height:1.7}
.linkage-panel{padding:0 26px}.linkage-panel h2{font-size:17px;line-height:1.5;margin:0}
.linkage-option-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:24px 0}.linkage-auto-seat{border-bottom:1px solid var(--line)}
.linkage-option-row>div{min-width:0}.linkage-option-row h2{overflow-wrap:anywhere}.linkage-option-row p{font-size:13px;color:var(--muted);margin:8px 0 0}
.linkage-switch{position:relative;display:flex;align-items:center;flex:none;width:60px;height:44px;cursor:pointer}
.linkage-switch input{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;opacity:0;cursor:pointer;z-index:1}
.linkage-switch>span{display:block;position:relative;width:56px;height:32px;border-radius:20px;border:1px solid #766247;background:#302b23;transition:background .2s}
.linkage-switch>span:after{content:'';position:absolute;top:4px;left:4px;width:22px;height:22px;background:#c1b7a6;border-radius:50%;transition:transform .2s,background .2s}
.linkage-switch input:checked+span{background:#be9656;border-color:#e0bc79}.linkage-switch input:checked+span:after{transform:translateX(24px);background:#fff1d4}
.linkage-switch input:focus-visible+span{outline:2px solid var(--gold);outline-offset:3px}
.linkage-animation-settings{padding:0}.linkage-animation-options{padding-bottom:14px}.linkage-animation-options[hidden]{display:none!important}.linkage-animation-field{max-width:420px;margin:0;font-size:13px;line-height:1.5}.linkage-animation-field select{display:block;margin-top:8px;min-height:46px}
.linkage-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:22px 0 10px;color:var(--muted);font-size:13px}.linkage-preview-heading button{min-height:44px;font-size:13px;padding:8px 16px}
 .linkage-seat-preview{display:block;width:100%;min-height:0;padding:0;border:1px solid #4d402b;border-radius:12px;overflow:hidden;aspect-ratio:16/9}
.linkage-effect-description{margin:9px 0 0;font-size:12px;color:var(--muted);line-height:1.7}
.linkage-preview-heading>div{display:flex;gap:8px;flex-wrap:wrap}.linkage-preview-heading{flex-wrap:wrap}.linkage-preview-heading>div>button{padding:8px 12px}
.linkage-preview-status{margin:10px 0 0;min-height:24px;font-size:12px;color:var(--muted);line-height:1.7}
.linkage-gallery-link{display:inline-block;min-height:44px;padding:10px 0;font-size:13px;line-height:1.7}
@media(max-width:1023px){
 .customer .main-tabs{grid-template-columns:repeat(5,minmax(0,1fr))}
 .customer .main-tabs button{font-size:12px;padding:8px 2px;overflow-wrap:anywhere}
 .linkage-page{padding:20px 12px calc(24px + env(safe-area-inset-bottom))}.linkage-page-heading{margin-bottom:16px}.linkage-page-heading h1{font-size:22px}.linkage-panel{padding:0 16px;border-radius:12px}
 .linkage-panel h2{font-size:15px}.linkage-option-row{gap:12px;padding:20px 0}.linkage-animation-field{max-width:none}
 .linkage-seat-preview{min-height:0;padding:0}.linkage-preview-heading>div{width:100%;display:grid;grid-template-columns:1fr 1fr}.linkage-preview-heading>div>button{min-height:44px}
}
@media(prefers-reduced-motion:reduce){.linkage-page *, .linkage-page *:after{animation:none!important;transition:none!important}}

/* Event Logo upload sits beside the product name on every control page. */
.customer.needs-login .header-logo{display:none!important}
.customer .header-logo{position:relative;flex:none;margin-right:auto;align-self:center}
.customer .header-logo-button{min-height:44px;padding:10px 16px;border-color:#a8864e;background:#292216;color:#f0d39d;white-space:nowrap;font-size:13px}
.customer #header-logo-status:empty{display:none}
.customer #header-logo-status{position:absolute;z-index:4;top:calc(100% + 5px);left:0;width:max-content;max-width:240px;padding:7px 10px;border:1px solid #66502f;border-radius:7px;background:#1c170fed;color:#eed3a2;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
@media(max-width:1023px){
 .customer .app-header{grid-template-columns:minmax(0,1fr) auto;gap:10px}
 .customer .header-logo{margin:0;justify-self:end}
 .customer .header-logo-button{padding:9px 12px;font-size:13px}
 .customer .header-actions{grid-column:1/-1}
 .customer .wordmark small{max-width:100%}
 .customer #header-logo-status{left:auto;right:0;max-width:220px}
}
@media(max-width:359px){.customer .wordmark{gap:8px}.customer .brand-mark.has-logo{width:40px;height:40px}.customer .wordmark strong{font-size:15px}.customer .header-logo-button{padding:9px;font-size:12px}}
@media(max-height:520px) and (max-width:1023px){.customer .header-logo{margin-right:auto}.customer .header-logo-button{min-height:40px;padding:8px 12px}.customer .header-actions{flex:1;min-width:0}.customer .header-action{flex:1;min-width:0}}
