:root {
  --bg: #0b0e13;
  --sidebar: #0d1117;
  --panel: #11161e;
  --panel-2: #151b24;
  --panel-3: #1a212c;
  --input: #0c1117;
  --result: #0a0f15;
  --border: #2a3442;
  --text: #f5f7fa;
  --text-strong: #ffffff;
  --text-soft: #d4dbe4;
  --muted: #a4afbd;
  --eyebrow: #9aa6b5;
  --table-head: #a5afbc;
  --accent: #5b8cff;
  --accent-2: #82a8ff;
  --success: #43d19e;
  --danger: #ff7c89;
  --shadow: 0 20px 60px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 245px; flex: 0 0 245px; border-right: 1px solid var(--border); background: var(--sidebar); padding: 20px 14px; display: flex; flex-direction: column; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 24px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--text-strong); font-weight: 800; }
.brand-name { font-size: 14px; font-weight: 750; }
.brand-sub { color: var(--muted); font-size: 11px; margin-top: 3px; }
.nav-label, .eyebrow { color: var(--eyebrow); letter-spacing: .12em; font-size: 10px; font-weight: 750; }
.nav-label { padding: 0 10px 8px; }
.nav-item { width: 100%; border: 0; background: transparent; color: var(--text-soft); border-radius: 9px; padding: 10px 11px; display: flex; gap: 10px; align-items: center; text-align: left; margin: 2px 0; }
.nav-item:hover:not(.disabled), .nav-item.active { background: var(--panel-2); color: var(--text-strong); }
.nav-item.active { box-shadow: inset 2px 0 0 var(--accent); }
.nav-item.disabled { opacity: .42; cursor: not-allowed; }
.nav-icon { width: 18px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.connection-pill { margin: 8px 5px 0; border: 1px solid var(--border); background: var(--panel); border-radius: 9px; padding: 8px 9px; color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #6c7684; }
.status-dot.ok { background: var(--success); }
.status-dot.bad { background: var(--danger); }
.main { flex: 1; min-width: 0; }
.topbar { padding: 31px 34px 23px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
h1 { font-size: 27px; margin: 5px 0 5px; letter-spacing: -.03em; }
h2 { font-size: 17px; margin: 5px 0 0; }
h3 { margin: 0 0 6px; font-size: 15px; }
.topbar p, .panel-empty p { color: var(--muted); margin: 0; font-size: 12px; }
.topbar-actions { display: flex; gap: 8px; }
.secondary-btn { background: var(--panel-2); color: var(--text-soft); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; }
.secondary-btn:hover { background: var(--panel-3); }
.secondary-btn.small { padding: 7px 10px; font-size: 11px; }
.account-bar { margin: 22px 34px 0; padding: 14px 16px; border: 1px solid var(--border); background: var(--panel); border-radius: 12px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.account-select-wrap { min-width: 270px; }
.account-select-row { display:flex; align-items:flex-end; gap:8px; }
.account-select-row select { flex:1 1 auto; min-width:0; }
label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
select, input, textarea { width: 100%; background: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: #5f8fff; }
.muted { color: var(--muted); font-size: 11px; }
.notice { margin: 14px 34px 0; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border); font-size: 12px; }
.notice.success { border-color: rgba(67,209,158,.35); background: rgba(67,209,158,.08); }
.notice.error { border-color: rgba(255,111,125,.35); background: rgba(255,111,125,.08); }
.hidden { display: none !important; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; padding: 24px 34px 40px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 12px; }
.section-note { color: var(--muted); font-size: 11px; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.action-card { min-height: 135px; text-align: left; position: relative; border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 12px; padding: 17px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.action-card:hover { transform: translateY(-1px); border-color: #465568; background: var(--panel-2); }
.action-card .star { position: absolute; right: 12px; top: 10px; color: #ffd76b; font-size: 12px; }
.action-icon { font-size: 21px; color: var(--accent-2); }
.action-card strong { font-size: 13px; }
.action-card small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.zones-heading { margin-top: 28px; }
.table-card { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border); font-size: 11px; }
th { color: var(--table-head); font-weight: 650; background: rgba(255,255,255,.015); }
td { color: var(--text-soft); }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 26px; }
.details-panel { border: 1px solid var(--border); background: var(--panel); border-radius: 12px; min-height: 520px; overflow: hidden; box-shadow: var(--shadow); }
.panel-empty { min-height: 520px; display: grid; place-items: center; align-content: center; text-align: center; padding: 40px; }
.empty-icon { width: 52px; height: 52px; border-radius: 15px; background: var(--panel-3); display: grid; place-items: center; font-size: 24px; margin-bottom: 15px; color: var(--accent-2); }
.panel-inner { padding: 20px; }
.panel-inner .panel-title { margin: 5px 0 5px; font-size: 17px; }
.panel-inner .panel-description { color: var(--muted); font-size: 11px; line-height: 1.5; margin-bottom: 20px; }
.form-group { margin-bottom: 12px; }
.primary-btn { width: 100%; border: 0; border-radius: 8px; padding: 10px 12px; background: var(--accent); color: var(--text-strong); font-weight: 700; margin-top: 5px; }
.primary-btn:hover { background: var(--accent-2); }
.danger-btn { background: transparent; color: var(--danger); border: 1px solid rgba(255,111,125,.25); }
.result-box { margin-top: 15px; background: var(--result); border: 1px solid var(--border); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; }
.result-box pre { margin: 0; white-space: pre-wrap; word-break: break-word; color: #d1d9e3; font-size: 10px; line-height: 1.45; }
.inline-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.help { color: var(--muted); font-size: 10px; line-height: 1.45; margin-top: 5px; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(620px, calc(100vw - 30px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.modal-header h2 { font-size: 18px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 24px; }
#modalBody { padding: 20px; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 999px; font-size: 9px; background: rgba(67,209,158,.1); color: var(--success); }
@media (max-width: 1050px) {
  .content-grid { grid-template-columns: 1fr; }
  .details-panel { min-height: 0; }
  .panel-empty { min-height: 240px; }
}
@media (max-width: 800px) {
  .sidebar { width: 190px; flex-basis: 190px; }
  .content-grid, .topbar { padding-left: 18px; padding-right: 18px; }
  .account-bar, .notice { margin-left: 18px; margin-right: 18px; }
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-item.disabled { display: none; }
  .action-grid { grid-template-columns: 1fr; }
  .account-bar { align-items: stretch; flex-direction: column; }
  .account-select-row { width:100%; }
}

.settings-body { padding: 20px; }
.settings-section { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: 0; margin-bottom: 0; }
.settings-title { font-size: 13px; font-weight: 750; margin-bottom: 6px; }
.settings-help { color: var(--muted); font-size: 11px; line-height: 1.5; margin-bottom: 14px; }
.security-status { border: 1px solid var(--border); background: var(--input); border-radius: 8px; padding: 10px; color: var(--muted); font-size: 11px; }
.login-screen { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.login-card { width: min(390px, 100%); border: 1px solid var(--border); background: var(--panel); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); }
.login-mark { margin-bottom: 18px; }
.login-card h1 { font-size: 24px; margin: 6px 0; }
.login-card p { color: var(--muted); font-size: 12px; margin: 0 0 22px; }
.login-help { color: var(--eyebrow); font-size: 10px; line-height: 1.5; margin-top: 14px; text-align: center; }
.login-error { margin-top: 10px; border: 1px solid rgba(255,111,125,.35); background: rgba(255,111,125,.08); color: #ff9da7; border-radius: 8px; padding: 9px; font-size: 11px; }


/* Appearance themes */
html[data-theme="light"] {
  --bg: #f5f7fa;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-2: #f0f3f7;
  --panel-3: #e7ecf2;
  --input: #ffffff;
  --result: #f3f6f9;
  --border: #d5dce5;
  --text: #17202b;
  --text-strong: #101720;
  --text-soft: #354252;
  --muted: #5e6b7a;
  --eyebrow: #596779;
  --table-head: #526070;
  --shadow: 0 18px 50px rgba(30,45,65,.12);
}
html[data-theme="light"] .modal-backdrop { background: rgba(15,23,35,.42); }
html[data-theme="light"] .nav-item:hover:not(.disabled),
html[data-theme="light"] .nav-item.active { color: var(--text-strong); }
html[data-theme="light"] .notice.success { background: rgba(28,166,117,.08); }
html[data-theme="light"] .notice.error { background: rgba(210,55,70,.08); }
html[data-theme="light"] .security-status { background: #f4f6f8; }
html[data-theme="light"] .badge { background: rgba(28,166,117,.10); }

.theme-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-option { border: 1px solid var(--border); background: var(--panel-2); color: var(--text-soft); border-radius: 8px; padding: 9px 12px; font-size: 11px; font-weight: 700; }
.theme-option:hover { border-color: var(--accent); }
.theme-option.active { background: var(--accent); border-color: var(--accent); color: #fff; }


/* Version 1.2 clean action results */
.success-card { margin-top: 15px; padding: 14px; border: 1px solid rgba(67,209,158,.28); background: rgba(67,209,158,.07); border-radius: 10px; }
.success-title { font-size: 13px; font-weight: 750; margin-bottom: 10px; color: var(--text-strong); }
.success-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.success-row:last-of-type { border-bottom: 0; }
.success-row span { color: var(--muted); }
.success-row strong { text-align: right; word-break: break-word; }
.error-card { margin-top: 15px; padding: 11px; border: 1px solid rgba(255,111,125,.3); background: rgba(255,111,125,.08); border-radius: 9px; color: var(--danger); font-size: 11px; }
.clean-result { margin-top: 15px; }
.result-heading { font-size: 12px; font-weight: 750; margin-bottom: 8px; }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 11px; }
.copy-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 7px; padding: 9px 10px; border: 1px solid var(--border); background: var(--result); border-radius: 8px; }
.copy-row code { display: block; width: 100%; color: var(--text-soft); font-size: 10px; word-break: normal; overflow-wrap: anywhere; white-space: normal; }
.copy-row .copy-btn { width: 100%; }
.small { padding: 7px 9px; font-size: 10px; margin-top: 0; width: auto; }
.result-actions { display: flex; gap: 8px; margin-top: 11px; }
.button-link { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.link-block { margin-top: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--result); }
.link-block span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 4px; }
.link-block a { color: var(--accent-2); font-size: 10px; word-break: break-all; }
.subsection { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.subsection-title { font-size: 12px; font-weight: 750; margin-bottom: 4px; }
.destination-list { margin-top: 10px; display: grid; gap: 7px; }
.destination-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--result); cursor: pointer; }
.destination-option input { margin: 0; }
.destination-option span { font-size: 10px; word-break: break-all; }
.destination-option small { color: var(--muted); font-size: 9px; }
.selected-destination { padding: 9px 10px; border: 1px solid var(--border); background: var(--result); border-radius: 8px; color: var(--text-soft); font-size: 10px; word-break: break-all; }
.empty-inline { margin-top: 10px; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); text-align: center; font-size: 10px; }
.email-address-row { display: flex; align-items: center; gap: 7px; }
.email-address-row input { flex: 1; }
.email-address-row span, .email-address-row strong { color: var(--muted); font-size: 11px; }
.mini-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mini-row { display: grid; grid-template-columns: .55fr 1.1fr 1.7fr .55fr; gap: 8px; padding: 8px 9px; border-bottom: 1px solid var(--border); font-size: 9px; }
.mini-row:last-child { border-bottom: 0; }
.mini-row > span { min-width: 0; word-break: break-word; }
.mini-head { background: var(--panel-2); color: var(--table-head); font-weight: 700; }
.type-badge { display: inline-block; padding: 3px 5px; border-radius: 5px; background: var(--panel-3); color: var(--text-soft); font-weight: 700; }

/* Version 1.4 three-column command center layout */
.command-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 34px 40px;
  align-items: start;
}

.function-sidebar {
  min-width: 0;
  height: calc(100vh - 225px);
  min-height: 460px;
  position: sticky;
  top: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.function-sidebar-header {
  flex: 0 0 auto;
  padding: 17px 16px 13px;
  border-bottom: 1px solid var(--border);
}
.function-sidebar-header h2 { margin-top: 4px; font-size: 16px; }
.function-sidebar-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }

.function-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 7px;
  scrollbar-width: thin;
}

.function-nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  border-radius: 8px;
  padding: 10px 10px;
  margin: 2px 0;
  text-align: left;
  display: block;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.function-nav-item:hover {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text-strong);
}
.function-nav-item.active {
  background: var(--panel-2);
  border-color: rgba(91,140,255,.42);
  box-shadow: inset 2px 0 0 var(--accent);
  color: var(--text-strong);
}
.function-nav-name { display: block; font-size: 11px; font-weight: 700; }
.function-nav-description { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.function-nav-item.active .function-nav-description { color: var(--text-soft); }

.command-workspace {
  min-width: 0;
  min-height: calc(100vh - 225px);
  overflow: hidden;
}
.command-workspace .panel-empty { min-height: calc(100vh - 225px); }
.command-workspace .panel-inner { min-height: calc(100vh - 225px); }

.domain-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.domain-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border-bottom: 1px solid var(--border); background: var(--result); }
.domain-row:last-child { border-bottom: 0; }
.domain-row strong { display: block; font-size: 10px; color: var(--text-strong); }
.domain-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

@media (max-width: 1050px) {
  .command-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .function-sidebar { height: calc(100vh - 215px); }
  .command-workspace, .command-workspace .panel-empty, .command-workspace .panel-inner { min-height: calc(100vh - 215px); }
}

@media (max-width: 800px) {
  .command-layout { grid-template-columns: 190px minmax(0, 1fr); padding-left: 18px; padding-right: 18px; }
  .function-sidebar { height: calc(100vh - 210px); }
  .command-workspace, .command-workspace .panel-empty, .command-workspace .panel-inner { min-height: calc(100vh - 210px); }
}

@media (max-width: 600px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-item.disabled { display: none; }
  .account-bar { align-items: stretch; flex-direction: column; }
  .command-layout { grid-template-columns: 1fr; padding: 14px 18px 30px; }
  .function-sidebar { position: static; height: 270px; min-height: 270px; }
  .command-workspace, .command-workspace .panel-empty, .command-workspace .panel-inner { min-height: 500px; }
}


/* Version 2.0 finalized Cloudflare workflow */
.drag-handle { display:inline-flex; width:14px; color:var(--muted); font-size:12px; cursor:grab; vertical-align:top; margin-right:5px; opacity:.8; }
.function-nav-copy { display:inline-block; width:calc(100% - 22px); vertical-align:top; }
.function-nav-item { cursor:pointer; }
.function-nav-item:active { cursor:pointer; }
.function-nav-item.dragging { opacity:.45; }
.function-nav-item.drag-over { border-color:var(--accent); box-shadow:inset 0 -2px 0 var(--accent); }
.upload-zone { margin:14px 0; border:1.5px dashed var(--border); background:var(--result); border-radius:12px; padding:24px 18px; text-align:center; transition:.15s ease; }
.upload-zone.dragover { border-color:var(--accent); background:rgba(91,140,255,.07); }
.upload-zone .upload-icon { width:38px; height:38px; display:grid; place-items:center; margin:0 auto 8px; border-radius:10px; background:var(--panel-2); color:var(--accent); font-size:20px; font-weight:800; }
.upload-zone strong { display:block; font-size:13px; }
.upload-zone span { display:block; margin:5px 0 12px; color:var(--muted); font-size:10px; }
.upload-zone button { width:auto; display:inline-flex; }
.file-name { margin-top:10px; color:var(--text-soft)!important; font-size:10px!important; word-break:break-all; }
.picker-block { margin-bottom:4px; }
.search-input { margin-bottom:8px; }
.nameserver-box { margin-top:15px; padding:14px; border:1px solid var(--border); border-radius:10px; background:var(--result); }
.nameserver-box h3 { font-size:12px; margin:0 0 8px; }
.nameserver-box .secondary-btn { width:100%; margin-top:10px; }
.status-message { margin-top:10px; padding:10px; border-radius:8px; border:1px solid var(--border); font-size:10px; color:var(--muted); background:var(--panel); }
.status-message.success { border-color:rgba(67,209,158,.35); color:#15815c; background:rgba(67,209,158,.08); }
.status-message.pending { border-color:rgba(230,170,45,.35); background:rgba(230,170,45,.08); }
.status-message.error { border-color:rgba(255,111,125,.3); color:var(--danger); background:rgba(255,111,125,.08); }
.email-two-col { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.dns-toolbar { display:flex; justify-content:flex-end; margin:14px 0 10px; }
.dns-toolbar .primary-btn { width:auto; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:700px){.email-two-col,.form-grid{grid-template-columns:1fr}.drag-handle{display:none}}

.input-error { border-color: #ef4444 !important; }
.inline-info { color: var(--muted); font-size: 13px; margin: -4px 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.inline-info a { margin-left: 4px; }

/* Version 2.4 combobox and drag behavior */
.command-workspace { overflow: visible; }
.combo-picker { position: relative; }
.combo-input { padding-right: 38px; }
.combo-toggle { position: absolute; top: 1px; right: 1px; width: 38px; height: calc(100% - 2px); border: 0; border-radius: 0 8px 8px 0; background: transparent; color: var(--text-soft); font-size: 17px; }
.combo-toggle:hover { background: var(--panel-2); }
.combo-options { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); box-shadow: var(--shadow); padding: 4px; scrollbar-width: thin; }
.combo-option { display: block; width: 100%; border: 0; border-radius: 6px; background: transparent; color: var(--text-soft); text-align: left; padding: 8px 9px; font-size: 11px; line-height: 1.25; }
.combo-option:hover, .combo-option:focus { background: var(--panel-2); color: var(--text-strong); outline: none; }
.combo-option.combo-action { border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 6px 6px; color: var(--accent-2); }
.combo-empty { padding: 9px; color: var(--muted); font-size: 10px; }

/* Version 4.1 UI fixes */
.dns-add-section { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.section-title { font-size: 13px; font-weight: 800; margin-bottom: 12px; color: var(--text-strong); }
.dns-existing { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.dns-existing summary { cursor: pointer; padding: 12px 14px; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.dns-existing[open] summary { border-bottom: 1px solid var(--border); }
.dns-existing #dnsRecords { padding: 12px; }
.zip-preview { margin-top: 14px; border-top: 1px solid var(--border); overflow: hidden; text-align: left; }
.zip-preview-title { padding: 10px 12px; font-size: 12px; font-weight: 800; color: var(--text-strong); border-bottom: 1px solid var(--border); }
.zip-preview-title span { float: right; color: var(--muted); font-weight: 600; }
.zip-preview-loading, .zip-preview-empty, .zip-preview-note { padding: 10px 12px; color: var(--muted); font-size: 11px; }
.zip-preview-warning { margin: 10px 12px; padding: 9px 10px; border: 1px solid rgba(230,170,45,.4); border-radius: 8px; background: rgba(230,170,45,.08); color: var(--text-soft); font-size: 11px; }
.zip-tree { max-height: 280px; overflow-y: auto; padding: 6px 0; }
.zip-tree-row { display: flex; align-items: center; gap: 7px; padding: 5px 12px 5px calc(12px + (var(--depth) * 18px)); font-size: 11px; color: var(--text-soft); }
.zip-tree-row:hover { background: var(--panel-2); }
.zip-tree-icon { width: 16px; flex: 0 0 16px; }

.settings-tabs { display:flex; gap:6px; padding:12px 20px 0; border-bottom:1px solid var(--border); }
.settings-tab { border:1px solid transparent; background:transparent; color:var(--muted); padding:8px 12px; border-radius:8px 8px 0 0; font-size:11px; font-weight:700; cursor:pointer; }
.settings-tab:hover { color:var(--text-strong); background:var(--panel-2); }
.settings-tab.active { color:var(--text-strong); background:var(--panel-2); border-color:var(--border); border-bottom-color:var(--panel); margin-bottom:-1px; }
.settings-toolbar, .form-actions { display:flex; gap:8px; align-items:center; margin-top:12px; }
.user-list { display:grid; gap:8px; }
.user-row { display:flex; justify-content:space-between; align-items:center; gap:12px; border:1px solid var(--border); border-radius:9px; padding:10px 12px; background:var(--panel-2); }
.user-row > div:first-child { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.role-badge, .master-badge { font-size:9px; text-transform:uppercase; letter-spacing:.05em; border:1px solid var(--border); border-radius:999px; padding:3px 6px; color:var(--muted); }
.master-badge { color:var(--accent); }
.user-actions { display:flex; gap:6px; }
.danger-btn { color:#d85b68; }
.user-form-card { border:1px solid var(--border); border-radius:10px; padding:14px; background:var(--panel-2); }
.permission-list { display:grid; gap:7px; margin-top:14px; }
.permission-row { display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid var(--border); border-radius:9px; padding:10px 12px; background:var(--panel-2); }
.permission-row > div { min-width:0; }
.permission-row strong { display:block; font-size:11px; }
.permission-row span:not(.permission-switch span) { display:block; color:var(--muted); font-size:10px; margin-top:2px; }
.permission-switch { min-width:58px; border:0; border-radius:999px; padding:5px 9px; font-size:10px; font-weight:800; cursor:pointer; transition:.15s ease; }
.permission-switch.on { background:var(--accent); color:#fff; }
.permission-switch.off { background:var(--border); color:var(--muted); }
.function-empty { color:var(--muted); font-size:11px; padding:18px 14px; text-align:center; }

/* Version 4.7 UI fixes */
.topbar-actions { align-items: center; flex-wrap: wrap; }
.topbar-control { white-space: nowrap; }
.topbar-connection { margin: 0; min-height: 38px; padding: 9px 11px; white-space: nowrap; }
.topbar-connection.connected { border-color: rgba(67,209,158,.35); color: var(--success); background: rgba(67,209,158,.08); }
.topbar-connection.disconnected { border-color: rgba(255,111,125,.35); color: var(--danger); background: rgba(255,111,125,.08); }
.account-meta { display: flex; align-items: center; gap: 10px; }
.account-refresh { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--text-soft); font-size: 19px; line-height: 1; }
.account-refresh:hover { background: var(--panel-3); color: var(--text-strong); }

@media (min-width: 601px) {
  html, body { height: 100%; overflow: hidden; }
  .app-shell { height: 100vh; min-height: 0; overflow: hidden; }
  .sidebar { height: 100vh; overflow-y: auto; }
  .main { height: 100vh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .topbar, .account-bar { flex: 0 0 auto; }
  .command-layout { flex: 1 1 auto; min-height: 0; overflow: hidden; padding-bottom: 18px; }
  .function-sidebar { height: 100%; min-height: 0; position: static; }
  .command-workspace { height: 100%; min-height: 0; overflow: auto; }
  .command-workspace .panel-empty, .command-workspace .panel-inner { min-height: 100%; }
}

@media (max-width: 800px) {
  .topbar-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 600px) {
  .topbar-actions { width: auto; justify-content: flex-start; }
  .topbar-connection { width: auto; }
}

/* Account-switch loading state: never expose stale data while a new account loads. */
.panel-loading { min-height: 100%; display: grid; place-items: center; align-content: center; text-align: center; padding: 40px; }
.panel-loading-spinner { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); color: var(--accent); font-size: 24px; margin-bottom: 14px; }
.panel-loading strong { font-size: 16px; }
.panel-loading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.function-nav-item:disabled { cursor: wait; opacity: .65; }
