:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #dfe5ee;
  --accent: #155eef;
  --accent-soft: #eaf1ff;
  --green-head: #eaf8ef;
  --yellow-head: #fff7d6;
  --pink-head: #fdeef4;
  --gray-head: #eef1f5;
  --shadow: 0 10px 30px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 15%, #dfe9ff 0, transparent 35%), linear-gradient(145deg, #f8fafc, #eef3fb); }
.login-card { width: min(480px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 34px; display: grid; gap: 22px; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: #152238; color: white; font-weight: 800; letter-spacing: .06em; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 10px; font-size: 12px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .14em; color: var(--accent); font-weight: 700; }
h1 { margin: 0; font-size: 30px; }
.login-card p { line-height: 1.6; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
input { width: 100%; border: 1px solid #cfd7e3; border-radius: 10px; padding: 10px 12px; background: white; color: var(--text); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21, 94, 239, .12); }
button { border: 0; border-radius: 9px; padding: 9px 13px; font-weight: 700; }
.primary { background: var(--accent); color: white; min-height: 42px; }
.secondary { background: #edf2f8; color: #26344d; border: 1px solid #d7dee9; }
.ghost { background: transparent; color: #344054; border: 1px solid #d6dce6; }
.ghost.danger { color: #b42318; }
.error-text { color: #b42318; margin: 0; min-height: 20px; font-size: 13px; }

.app-shell { min-height: 100vh; }
.topbar { height: 64px; background: #152238; color: white; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 40; box-shadow: 0 3px 14px rgba(0,0,0,.15); }
.topbar-brand, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-brand > div { display: flex; align-items: baseline; gap: 8px; }
.version { font-size: 11px; opacity: .7; }
.user-badge { font-size: 13px; color: #d9e2f0; }
.topbar .ghost { color: white; border-color: #40516a; }
.topbar .danger { color: #ffd3cf; }
.tabs { display: flex; gap: 6px; background: white; padding: 10px 18px 0; border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 35; }
.tab { border-radius: 10px 10px 0 0; background: transparent; color: #5b6578; padding: 11px 17px; border: 1px solid transparent; border-bottom: 0; }
.tab.active { background: var(--bg); color: var(--accent); border-color: var(--line); }
.workspace { padding: 16px 18px 26px; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.search-wrap { display: flex; align-items: center; gap: 10px; width: min(760px, 70vw); }
.search-wrap input { background: white; }
.row-count { white-space: nowrap; color: var(--muted); font-size: 13px; }
.toolbar-actions { display: flex; gap: 8px; }
.column-panel { background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px; padding: 14px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.panel-head > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.panel-head .muted { font-size: 12px; }
.panel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.column-options { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 310px; overflow: auto; padding-right: 4px; }
.column-option { border: 1px solid #e3e7ee; border-radius: 9px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; background: #fbfcfe; }
.column-option span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-option label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.column-option input { width: auto; margin: 0; }

.table-card { background: white; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: 0 4px 18px rgba(16, 24, 40, .05); position: relative; }
.table-viewport { width: 100%; max-height: calc(100vh - 190px); overflow: auto; }
table { border-collapse: separate; border-spacing: 0; min-width: max-content; width: 100%; table-layout: fixed; font-size: 12px; }
th, td { border-right: 1px solid #e3e7ee; border-bottom: 1px solid #e6eaf0; padding: 7px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 34px; background: white; }
th { position: sticky; top: 0; z-index: 8; background: #f3f6fa; text-align: left; font-weight: 800; color: #344054; box-shadow: inset 0 -1px 0 #cfd6e0; }
th.head-green { background: var(--green-head); }
th.head-yellow { background: var(--yellow-head); }
th.head-pink { background: var(--pink-head); }
th.head-gray { background: var(--gray-head); }
th.pinned { z-index: 16; }
td.pinned { position: sticky; z-index: 7; box-shadow: 1px 0 0 #d3dae4; }
tr:hover td { background: #f7faff; }
tr.sub-row td { background: #fbfcff; color: #4e5b70; }
tr.sub-row td[data-key="system_no"] { padding-left: 22px; }
tr.selected td { background: #eef4ff; }
.cell-link { color: #155eef; text-decoration: none; font-weight: 700; }
.cell-link:hover { text-decoration: underline; }
.loading, .notice { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); padding: 9px 14px; border-radius: 10px; z-index: 25; box-shadow: var(--shadow); }
.loading { background: #152238; color: white; }
.notice { background: #fff7d6; color: #6b4f00; border: 1px solid #ead88d; }

@media (max-width: 800px) {
  .topbar { padding: 0 12px; }
  .user-badge { display: none; }
  .workspace { padding: 10px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-wrap { width: 100%; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .table-viewport { max-height: calc(100vh - 235px); }
}

/* ===== Web v0.2：總表新增／修改編輯器 ===== */
button:disabled { cursor: not-allowed; opacity: .52; }
.primary.compact { min-height: 36px; padding: 8px 12px; }
.project-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.selection-hint { color: var(--muted); font-size: 12px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice[data-kind="success"] { background: #ecfdf3; color: #027a48; border-color: #abefc6; }
.notice[data-kind="error"] { background: #fef3f2; color: #b42318; border-color: #fecdca; }

.modal-open { overflow: hidden; }
.editor-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .48); display: grid; place-items: center; padding: 18px; }
.editor-modal { width: min(1180px, 96vw); max-height: 94vh; background: #fff; border: 1px solid #d9e0ea; border-radius: 18px; box-shadow: 0 24px 70px rgba(15, 23, 42, .28); display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; overflow: hidden; }
.editor-head { padding: 18px 20px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e4e8ef; }
.editor-head h2 { margin: 0; font-size: 21px; }
.editor-head p { margin: 5px 0 0; font-size: 12px; }
.editor-title-row { display: flex; align-items: center; gap: 10px; }
.mode-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 10px; background: #f2f4f7; color: #475467; font-size: 22px; line-height: 1; }
.editor-warning, .editor-error { margin: 10px 20px 0; border-radius: 9px; padding: 9px 12px; font-size: 13px; }
.editor-warning { background: #fff7d6; color: #7a5400; border: 1px solid #ead88d; }
.editor-error { color: #b42318; min-height: 0; padding-top: 0; padding-bottom: 0; }
.editor-error:not(:empty) { background: #fef3f2; border: 1px solid #fecdca; padding-top: 9px; padding-bottom: 9px; }
.editor-scroll { overflow: auto; padding: 14px 20px 20px; }
.editor-section { border: 1px solid #e2e8f0; border-radius: 13px; background: #fbfcfe; padding: 13px; margin-bottom: 12px; }
.editor-section h3 { margin: 0 0 10px; font-size: 14px; color: #344054; }
.editor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.editor-field { display: grid; gap: 5px; min-width: 0; }
.editor-field.wide { grid-column: span 2; }
.editor-field > span { color: #475467; font-size: 12px; font-weight: 700; }
.editor-field input, .editor-field select, .editor-field textarea { width: 100%; min-width: 0; border: 1px solid #cfd7e3; border-radius: 8px; padding: 8px 9px; background: white; color: var(--text); outline: none; font: inherit; font-size: 13px; }
.editor-field textarea { resize: vertical; line-height: 1.5; }
.editor-field input:focus, .editor-field select:focus, .editor-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21, 94, 239, .10); }
.editor-field .readonly { background: #f0f3f7; color: #667085; }
.editor-footer { border-top: 1px solid #e4e8ef; padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; background: white; }

@media (max-width: 1000px) {
  .toolbar-actions { align-items: flex-end; flex-direction: column; }
  .editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .editor-backdrop { padding: 0; }
  .editor-modal { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-field.wide { grid-column: auto; }
  .editor-head { padding: 14px; }
  .editor-scroll { padding: 10px 12px 16px; }
  .editor-footer { padding: 10px 12px; }
  .project-actions { width: 100%; }
  .project-actions button { flex: 1; }
  .selection-hint { width: 100%; max-width: none; }
}

/* ===== Web v0.3：總表儲存格直接編輯 ===== */
.editable-cell { cursor: cell; position: relative; }
.editable-cell:hover { box-shadow: inset 0 0 0 1px rgba(21, 94, 239, .42); }
.editable-cell:focus { outline: 2px solid rgba(21, 94, 239, .45); outline-offset: -2px; }
.editing-cell { padding: 2px 3px !important; overflow: visible; z-index: 20 !important; }
.inline-cell-input { width: 100%; height: 29px; min-width: 0; padding: 3px 6px; border: 2px solid var(--accent); border-radius: 5px; background: #fff; color: var(--text); font: inherit; font-size: 12px; outline: none; }
select.inline-cell-input { padding-right: 20px; }
tr.dirty-row td { box-shadow: inset 0 1px 0 #fdb022, inset 0 -1px 0 #fdb022; }
tr.dirty-row td:first-child::before { content: "●"; color: #f79009; margin-right: 4px; font-size: 9px; }
tr.dirty-row.selected td { background: #fff8e7; }
tr.dirty-row.selected td.pinned { background: #fff8e7 !important; }

/* ===== Web v0.4：樹狀子列／群組與右鍵選單 ===== */
.row-context-menu {
  min-width: 220px;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
  padding: 6px;
  z-index: 90;
}
.row-context-menu { position: fixed; z-index: 120; }
.row-context-menu button {
  width: 100%;
  display: block;
  text-align: left;
  background: transparent;
  color: #26344d;
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 13px;
}
.row-context-menu button:hover:not(:disabled) { background: #eef4ff; color: #155eef; }
.row-context-menu button:disabled { color: #98a2b3; opacity: 1; }
.context-menu-title {
  padding: 5px 10px 7px;
  margin-bottom: 4px;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  border-bottom: 1px solid #edf0f4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-system-cell { display: table-cell; }
.tree-branch { color: #98a2b3; margin-right: 5px; font-weight: 900; }
.group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 4px;
  border-radius: 999px;
  background: #eef4ff;
  color: #155eef;
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}
tr.group-row td { background: #f8fbff; }
tr.group-row.selected td { background: #eef4ff; }
tr.group-row.dirty-row.selected td { background: #fff8e7; }


/* ===== Web v0.5：刪除、提示自動消失、欄寬拖曳 ===== */
.danger-button { background: #fff; color: #b42318; border: 1px solid #fda29b; }
.danger-button:hover:not(:disabled) { background: #fef3f2; color: #912018; }
.danger-button:disabled { color: #98a2b3; border-color: #d0d5dd; background: #f9fafb; }
.row-context-menu .context-danger { color: #b42318; border-top: 1px solid #f1f3f5; margin-top: 4px; padding-top: 10px; }
.row-context-menu .context-danger:hover:not(:disabled) { background: #fef3f2; color: #912018; }
th { position: sticky; }
.column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 30;
  user-select: none;
  touch-action: none;
}
.column-resizer:hover, body.resizing-column .column-resizer { background: rgba(21, 94, 239, .18); }
body.resizing-column { cursor: col-resize !important; user-select: none !important; }
body.resizing-column * { cursor: col-resize !important; }


/* ===== Web v0.6：總表右鍵出入庫 ===== */
.context-menu-section-label {
  margin: 5px 4px 3px;
  padding: 7px 6px 3px;
  border-top: 1px solid #edf0f4;
  color: #667085;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.inventory-modal {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .24);
  border: 1px solid #e4e7ec;
}
.inventory-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 18px 4px;
}
.inventory-summary > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #eaecf0;
  border-radius: 9px;
  background: #f9fafb;
}
.inventory-summary span { display: block; color: #667085; font-size: 11px; margin-bottom: 4px; }
.inventory-summary strong { display: block; color: #101828; font-size: 13px; overflow-wrap: anywhere; }
.inventory-qty-field { display: block; padding: 14px 18px 4px; color: #344054; font-size: 12px; font-weight: 800; }
.inventory-qty-field input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: #101828;
  background: #fff;
  outline: none;
}
.inventory-qty-field input:focus { border-color: #84adff; box-shadow: 0 0 0 3px rgba(21, 94, 239, .10); }
@media (max-width: 620px) { .inventory-summary { grid-template-columns: 1fr; } }

/* ===== Web v0.7：客戶／供應商／庫存／帳號主檔 ===== */
.tabs { overflow-x: auto; scrollbar-width: thin; }
.tab { flex: 0 0 auto; white-space: nowrap; }
#masterActions .selection-hint { max-width: 220px; }
@media (max-width: 900px) {
  .tabs { padding-left: 10px; padding-right: 10px; }
  #masterActions { width: 100%; }
  #masterActions button { flex: 1; }
  #masterActions .selection-hint { width: 100%; max-width: none; }
}

/* ===== Web v0.8：表單建立／下載與多選合併 ===== */
.row-context-menu { max-height: min(82vh, 720px); overflow-y: auto; overscroll-behavior: contain; }
.select-column {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  padding: 0 !important;
  text-align: center !important;
  position: sticky;
  left: 0;
  z-index: 18;
  background: #fff;
  border-right: 1px solid #e4e7ec;
}
.select-column-head { z-index: 42; background: #f5f7fa; }
.row-select-checkbox { width: 16px; height: 16px; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--accent); }
tr.batch-selected-row td { background: #f3f6ff; box-shadow: inset 0 1px 0 rgba(21,94,239,.24), inset 0 -1px 0 rgba(21,94,239,.24); }
tr.batch-selected-row.sub-row td { background: #f1f5ff; }
tr.batch-selected-row .select-column { background: #eef4ff; }
tr.batch-selected-row.selected td { background: #e5edff; }
tr.batch-selected-row.selected .select-column { background: #e5edff; }

th.pinned, td.pinned { z-index: 16; }
th.pinned { z-index: 35; }

.document-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #abefc6;
  border-radius: 10px;
  background: #ecfdf3;
}
.document-result-main { min-width: 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.document-result-main strong { color: #05603a; font-size: 14px; }
.document-type-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; background: #d1fadf; color: #05603a; font-size: 12px; font-weight: 900; }
.document-result-actions { display: flex; gap: 7px; flex: 0 0 auto; }
@media (max-width: 720px) {
  .document-result { align-items: stretch; flex-direction: column; }
  .document-result-actions button { flex: 1; }
}

/* ===== Web v0.9：大量表格效能優化 ===== */
/* sticky 欄位背景交給 CSS 狀態處理，不再每次選列用 JS 掃描整張表。 */
td.pinned, td.pinned-select { background: #fff; }
tr.sub-row td.pinned, tr.sub-row td.pinned-select { background: #fbfcff; }
tr.group-row td.pinned, tr.group-row td.pinned-select { background: #f8fbff; }
tr.selected td.pinned, tr.selected td.pinned-select { background: #eef4ff; }
tr.batch-selected-row td.pinned, tr.batch-selected-row td.pinned-select { background: #f3f6ff; }
tr.batch-selected-row.sub-row td.pinned, tr.batch-selected-row.sub-row td.pinned-select { background: #f1f5ff; }
tr.batch-selected-row.selected td.pinned, tr.batch-selected-row.selected td.pinned-select { background: #e5edff; }
tr.dirty-row.selected td.pinned, tr.dirty-row.selected td.pinned-select { background: #fff8e7 !important; }


/* ===== Web v0.9.3：總表虛擬列 ===== */
.virtual-spacer-row, .virtual-spacer-row:hover { pointer-events: none; }
.virtual-spacer-row td, .virtual-spacer-row:hover td {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  height: 0;
  min-height: 0;
}

/* ===== Web v0.9.4：更新 / 日期排序 ===== */
.search-wrap { flex-wrap: wrap; }
.sort-controls {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}
.sort-controls .sort-label { color: var(--muted); font-size: 13px; }
.sort-controls select {
  min-height: 34px;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 5px 28px 5px 9px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.sort-controls select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, .10);
}
@media (max-width: 900px) {
  .sort-controls { width: 100%; flex-wrap: wrap; }
  .sort-controls select { flex: 1 1 150px; }
}

/* ===== Web v0.11：系統設定 ===== */
.system-settings-panel { display: grid; gap: 14px; }
.settings-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: 0 4px 18px rgba(16, 24, 40, .05); }
.settings-head h2 { margin: 0; font-size: 23px; }
.settings-head p { margin: 6px 0 0; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.settings-inline-notice { border-radius: 10px; padding: 10px 13px; border: 1px solid #d7dee9; background: #f8fafc; font-size: 13px; }
.settings-inline-notice[data-kind="success"] { background: #ecfdf3; color: #027a48; border-color: #abefc6; }
.settings-inline-notice[data-kind="warn"] { background: #fff7d6; color: #7a5400; border-color: #ead88d; }
.settings-inline-notice[data-kind="error"] { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-section { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px 18px; box-shadow: 0 4px 18px rgba(16, 24, 40, .04); min-width: 0; }
.settings-section.span-full { grid-column: 1 / -1; }
.settings-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.settings-section-title .muted { font-size: 12px; text-align: right; }
.settings-fields { display: grid; gap: 11px; }
.settings-fields.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-field { display: grid; gap: 6px; color: #344054; font-size: 13px; font-weight: 700; min-width: 0; }
.settings-field.span-2 { grid-column: 1 / -1; }
.settings-field input { font-weight: 500; }
.path-input { font-family: Consolas, "Microsoft JhengHei", monospace; font-size: 12px; }
.effective-row { margin-top: 2px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; font-size: 12px; color: var(--muted); }
.effective-row code, .settings-effective-grid code { display: block; min-width: 0; overflow-wrap: anywhere; white-space: normal; color: #344054; background: #f6f8fb; border: 1px solid #e4e8ef; border-radius: 7px; padding: 6px 8px; font-family: Consolas, monospace; }
.settings-effective-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.settings-effective-grid > div { display: grid; gap: 5px; font-size: 11px; color: var(--muted); min-width: 0; }
.settings-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 9px; }
.settings-status-item { display: flex; gap: 9px; align-items: flex-start; border: 1px solid #e3e7ee; border-radius: 10px; padding: 10px 11px; background: #fbfcfe; min-width: 0; }
.settings-status-icon { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.settings-status-item.ok .settings-status-icon { background: #dcfae6; color: #067647; }
.settings-status-item.bad .settings-status-icon { background: #fee4e2; color: #b42318; }
.settings-status-item .status-copy { min-width: 0; display: grid; gap: 2px; }
.settings-status-item strong { font-size: 12px; }
.settings-status-item span { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .settings-head { flex-direction: column; }
  .settings-actions { justify-content: flex-start; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-section.span-full { grid-column: auto; }
  .settings-fields.two-col, .settings-effective-grid { grid-template-columns: 1fr; }
  .settings-field.span-2 { grid-column: auto; }
  .settings-section-title { align-items: flex-start; flex-direction: column; }
  .settings-section-title .muted { text-align: left; }
}


/* ===== Web v0.12.1：檔案總管式表單管理中心 ===== */
.document-center-panel { display: grid; gap: 12px; }
.document-center-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px 19px;
  box-shadow: 0 4px 18px rgba(16, 24, 40, .05);
}
.document-center-head h2 { margin: 0; font-size: 23px; }
.document-center-head p { margin: 6px 0 0; }
.document-center-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.document-explorer { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: start; }
.document-folder-pane {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px;
  box-shadow: 0 4px 18px rgba(16, 24, 40, .04); display: grid; gap: 4px; position: sticky; top: 8px;
}
.document-folder-title { padding: 8px 10px 9px; color: #667085; font-size: 12px; font-weight: 900; border-bottom: 1px solid #eef1f5; margin-bottom: 3px; }
.document-folder {
  width: 100%; min-height: 44px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: #344054; padding: 7px 9px; cursor: pointer; text-align: left;
}
.document-folder:hover { background: #f7f9fc; }
.document-folder.active { background: #eef4ff; border-color: #c7d7fe; color: #1849a9; }
.document-folder-icon { font-size: 18px; line-height: 1; }
.document-folder-name { font-weight: 850; font-size: 13px; }
.document-folder-count { min-width: 25px; padding: 2px 7px; border-radius: 999px; background: #f2f4f7; color: #667085; text-align: center; font-size: 11px; font-weight: 900; }
.document-folder.active .document-folder-count { background: #dbe7ff; color: #1849a9; }
.document-file-pane { min-width: 0; display: grid; gap: 10px; }
.document-breadcrumb {
  display: flex; align-items: center; gap: 7px; min-height: 38px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 11px; color: #667085; font-size: 12px; overflow: hidden; white-space: nowrap;
}
.document-breadcrumb strong { color: #344054; overflow: hidden; text-overflow: ellipsis; }
.document-breadcrumb-sep { color: #98a2b3; }
.document-center-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.document-center-filters input, .document-center-filters select {
  min-height: 36px; border: 1px solid #cfd7e3; border-radius: 8px; background: #fff; color: var(--text);
  padding: 6px 10px; font: inherit; font-size: 13px; outline: none;
}
.document-center-filters input { flex: 1 1 320px; min-width: 180px; }
.document-center-filters select { min-width: 135px; }
.document-center-filters input:focus, .document-center-filters select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21,94,239,.10); }
.document-center-table-wrap {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: auto;
  box-shadow: 0 4px 18px rgba(16, 24, 40, .04); max-width: 100%;
}
.document-center-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1080px; font-size: 12px; }
.document-center-table th {
  position: sticky; top: 0; z-index: 2; background: #f6f8fb; color: #344054; font-weight: 900;
  text-align: left; padding: 9px 10px; border-bottom: 1px solid #dfe4ec; white-space: nowrap;
}
.document-center-table td { padding: 9px 10px; border-bottom: 1px solid #edf0f4; vertical-align: middle; color: #344054; }
.document-center-table tbody tr:hover td { background: #fafcff; }
.document-center-table tbody tr.document-missing-row td { background: #fffaf5; }
.document-center-table tbody tr.document-missing-row:hover td { background: #fff5eb; }
.document-no-cell { font-weight: 900; color: #1d4ed8 !important; white-space: nowrap; }
.document-systems-cell { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-file-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; font-weight: 900; font-size: 11px; white-space: nowrap; }
.document-file-badge.ok { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.document-file-badge.missing { background: #fff4ed; color: #b54708; border: 1px solid #ffd6ae; }
.document-center-row-actions { display: flex; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.document-center-empty { padding: 28px !important; text-align: center; color: var(--muted) !important; }
.document-file-cell { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.document-excel-icon { width: 28px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 5px; background: #e9f7ef; color: #107c41; border: 1px solid #b7dfc5; font-size: 12px; font-weight: 950; }
.document-file-text { min-width: 0; display: grid; gap: 2px; }
.document-file-subtext { color: #98a2b3; font-size: 10px; }
@media (max-width: 760px) {
  .document-center-head { flex-direction: column; }
  .document-explorer { grid-template-columns: 1fr; }
  .document-folder-pane { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-folder-title { grid-column: 1 / -1; }
  .document-center-actions { width: 100%; }
  .document-center-actions button { flex: 1; }
  .document-center-filters > * { flex: 1 1 100%; }
}


/* ===== Web v0.13：備份與系統維護 ===== */
.system-maintenance-panel { min-width: 0; }
.maintenance-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:14px 0; }
.maintenance-stat { border:1px solid var(--border); border-radius:12px; background:#fff; padding:14px; min-width:0; }
.maintenance-stat span { display:block; color:var(--muted); font-size:12px; font-weight:700; margin-bottom:7px; }
.maintenance-stat strong { display:block; font-size:20px; color:var(--text); overflow-wrap:anywhere; }
.maintenance-stat small { display:block; margin-top:7px; color:var(--muted); font-size:11px; line-height:1.45; overflow-wrap:anywhere; }
.maintenance-backup-section { margin-bottom:12px; }
.maintenance-backup-path-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; }
.maintenance-count-grid { display:grid; grid-template-columns:repeat(8,minmax(100px,1fr)); gap:9px; }
.maintenance-count-item { border:1px solid #e4e7ec; border-radius:9px; padding:10px 12px; background:#f9fafb; }
.maintenance-count-item span { display:block; color:#667085; font-size:11px; font-weight:700; }
.maintenance-count-item strong { display:block; margin-top:4px; font-size:19px; }
.maintenance-table-wrap { overflow:auto; border:1px solid var(--border); border-radius:10px; }
.maintenance-table { width:100%; border-collapse:collapse; min-width:650px; background:#fff; }
.maintenance-table th,.maintenance-table td { padding:10px 12px; border-bottom:1px solid #eaecf0; text-align:left; font-size:12px; }
.maintenance-table th { background:#f8fafc; color:#475467; font-weight:800; position:sticky; top:0; }
.maintenance-empty { text-align:center !important; color:#98a2b3; padding:24px !important; }
@media (max-width: 1050px) { .maintenance-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .maintenance-count-grid { grid-template-columns:repeat(3,minmax(100px,1fr)); } }
@media (max-width: 650px) { .maintenance-summary-grid { grid-template-columns:1fr; } .maintenance-backup-path-row { grid-template-columns:1fr; } .maintenance-count-grid { grid-template-columns:repeat(2,minmax(100px,1fr)); } }

.maintenance-auto-section { margin-bottom:12px; }
.maintenance-auto-grid { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(150px,.6fr) minmax(180px,.7fr) auto; gap:10px; align-items:end; }
.maintenance-auto-grid label { display:grid; gap:6px; color:#475467; font-size:12px; font-weight:700; }
.maintenance-auto-grid input[type="number"], .maintenance-auto-grid select { min-height:38px; border:1px solid var(--border); border-radius:8px; padding:7px 9px; background:#fff; color:var(--text); }
.maintenance-switch-row { display:flex !important; align-items:center; gap:9px !important; min-height:38px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:#fff; }
.maintenance-switch-row input { width:18px; height:18px; }
.maintenance-auto-status { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:10px; }
.maintenance-auto-status > div { border:1px solid #e4e7ec; border-radius:9px; padding:10px 12px; background:#f9fafb; min-width:0; }
.maintenance-auto-status span { display:block; color:#667085; font-size:11px; font-weight:700; }
.maintenance-auto-status strong { display:block; margin-top:4px; font-size:14px; overflow-wrap:anywhere; }
.maintenance-auto-status small { display:block; margin-top:4px; color:#b42318; overflow-wrap:anywhere; }
.maintenance-backup-type { font-weight:800; font-size:11px; white-space:nowrap; }
@media (max-width: 900px) { .maintenance-auto-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .maintenance-auto-status { grid-template-columns:1fr; } }
@media (max-width: 560px) { .maintenance-auto-grid { grid-template-columns:1fr; } }

/* ===== Web v0.14：操作紀錄／稽核日誌 ===== */
.audit-log-panel { min-width:0; }
.audit-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:12px; }
.audit-head h2 { margin:2px 0 5px; }
.audit-actions { display:flex; gap:8px; flex-wrap:wrap; }
.audit-filters { display:grid; grid-template-columns:150px 150px minmax(160px,.8fr) minmax(150px,.7fr) minmax(150px,.7fr) minmax(240px,1.4fr); gap:9px; align-items:end; margin:12px 0; }
.audit-filters label { display:grid; gap:5px; color:#475467; font-size:11px; font-weight:800; }
.audit-filters input,.audit-filters select { min-height:38px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); padding:7px 9px; font:inherit; font-size:12px; outline:none; min-width:0; }
.audit-filters input:focus,.audit-filters select:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(21,94,239,.10); }
.audit-summary-row { display:flex; justify-content:space-between; align-items:center; gap:10px; margin:8px 0; }
.audit-table-wrap { overflow:auto; border:1px solid var(--border); border-radius:12px; background:#fff; max-width:100%; }
.audit-table { width:100%; min-width:1180px; border-collapse:collapse; font-size:12px; }
.audit-table th,.audit-table td { padding:9px 10px; border-bottom:1px solid #eaecf0; text-align:left; vertical-align:middle; }
.audit-table th { position:sticky; top:0; z-index:2; background:#f8fafc; color:#475467; font-weight:900; white-space:nowrap; }
.audit-table tbody tr:hover td { background:#fafcff; }
.audit-time { white-space:nowrap; color:#475467; font-variant-numeric:tabular-nums; }
.audit-user-sub { display:block; color:#98a2b3; font-size:10px; margin-top:2px; }
.audit-target { color:#1d4ed8; font-weight:800; white-space:nowrap; }
.audit-summary { max-width:430px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.audit-badge { display:inline-flex; align-items:center; min-height:23px; padding:2px 8px; border-radius:999px; font-size:10px; font-weight:900; white-space:nowrap; border:1px solid #d0d5dd; background:#f9fafb; color:#475467; }
.audit-badge.category { background:#f2f4f7; color:#344054; }
.audit-badge.action.success { background:#ecfdf3; color:#027a48; border-color:#abefc6; }
.audit-badge.action.danger { background:#fef3f2; color:#b42318; border-color:#fecdca; }
.audit-empty { text-align:center !important; color:#98a2b3; padding:28px !important; }
.audit-load-more { display:flex; justify-content:center; padding:12px 0 2px; }
.audit-detail-card { border:1px solid #d0d5dd; border-radius:12px; background:#fff; margin:10px 0 12px; overflow:hidden; }
.audit-detail-head { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:11px 13px; background:#f8fafc; border-bottom:1px solid #eaecf0; }
.audit-detail-head > div { min-width:0; display:grid; gap:3px; }
.audit-detail-head strong { overflow-wrap:anywhere; }
.audit-change-list { display:grid; gap:0; }
.audit-change-item { display:grid; grid-template-columns:minmax(130px,220px) minmax(0,1fr); gap:14px; padding:9px 13px; border-bottom:1px solid #f0f2f5; }
.audit-change-item:last-child { border-bottom:0; }
.audit-change-item > strong { color:#344054; }
.audit-change-values { display:grid; grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr); gap:6px; align-items:start; min-width:0; }
.audit-old-value,.audit-new-value { padding:6px 8px; border-radius:7px; background:#f9fafb; border:1px solid #eaecf0; overflow-wrap:anywhere; white-space:pre-wrap; }
.audit-old-value { color:#667085; }
.audit-new-value { color:#101828; background:#f0f7ff; border-color:#cfe0ff; }
.audit-arrow { text-align:center; color:#98a2b3; padding-top:6px; font-weight:900; }
.audit-change-empty { padding:14px; color:#667085; }
.audit-technical { padding:9px 13px; border-top:1px solid #eaecf0; background:#fcfcfd; overflow-wrap:anywhere; font-size:10px; }
@media (max-width: 1180px) { .audit-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } .audit-search { grid-column:span 2; } }
@media (max-width: 700px) { .audit-head { flex-direction:column; } .audit-filters { grid-template-columns:1fr 1fr; } .audit-search { grid-column:1 / -1; } .audit-change-item { grid-template-columns:1fr; gap:6px; } }

/* ===== Web v0.14.3：多人即時協作 Presence / 診斷 ===== */
.presence-menu { position: relative; }
.presence-button { min-height: 34px; padding: 6px 10px; border-radius: 999px; border: 1px solid #40516a; background: rgba(255,255,255,.06); color: #f8fafc; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; }
.presence-button:hover { background: rgba(255,255,255,.12); }
.presence-button[data-status="offline"] { opacity: .72; }
.presence-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #7dd3a8; box-shadow: 0 0 0 3px rgba(125,211,168,.15); }
.presence-button[data-status="connecting"] .presence-status-dot { background: #f6c453; box-shadow: 0 0 0 3px rgba(246,196,83,.14); }
.presence-button[data-status="offline"] .presence-status-dot { background: #a8b2c1; box-shadow: none; }
.presence-popover { position: absolute; right: 0; top: calc(100% + 9px); width: min(360px, 82vw); max-height: 420px; overflow: auto; z-index: 160; background: white; color: #1d2939; border: 1px solid #d8dee8; border-radius: 13px; box-shadow: 0 16px 38px rgba(15,23,42,.22); padding: 10px; }
.presence-popover-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 5px 9px; border-bottom: 1px solid #edf0f4; }
.presence-popover-head span { color: #667085; font-size: 11px; }
.presence-list { display: grid; gap: 5px; padding-top: 7px; }
.presence-person { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 7px 6px; border-radius: 8px; }
.presence-person:hover { background: #f7f9fc; }
.presence-person-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--person-color, #667085); }
.presence-person-main { min-width: 0; }
.presence-person-main strong, .presence-person-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence-person-main strong { font-size: 12px; }
.presence-person-main span { margin-top: 2px; color: #667085; font-size: 11px; }
.presence-person small { color: #98a2b3; font-size: 10px; white-space: nowrap; }
.presence-empty { color: #667085; font-size: 12px; padding: 10px 6px; }
td.presence-remote-focus, td.presence-remote-edit { position: relative; overflow: hidden !important; isolation: isolate; }
td.presence-remote-focus { outline: 2px solid var(--presence-color, #667085); outline-offset: -2px; box-shadow: inset 0 0 0 2px var(--presence-color, #667085) !important; }
td.presence-remote-edit { outline: 3px solid var(--presence-color, #667085); outline-offset: -3px; box-shadow: inset 0 0 0 3px var(--presence-color, #667085) !important; }
.presence-cell-badge { position: absolute; right: 2px; top: 2px; z-index: 32; max-width: min(150px, 72%); padding: 1px 5px; border-radius: 999px; background: var(--presence-color, #667085); color: white; font-size: 9px; font-weight: 800; line-height: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 4px rgba(15,23,42,.22); }
td.presence-remote-focus .presence-cell-badge { opacity: .90; }
@media (max-width: 800px) { .presence-button { padding: 6px 9px; } .presence-popover { right: -52px; } }

.presence-diagnostic { margin: 8px 5px 2px; padding: 8px 9px; border-radius: 8px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 11px; line-height: 1.45; white-space: normal; }
.presence-retry-row { display:flex; justify-content:flex-end; padding:6px 5px 0; }
.presence-retry-row .small { min-height:28px; padding:4px 9px; font-size:11px; }

/* Web v0.15：資料管理 */
.data-management-panel{display:flex;flex-direction:column;gap:16px}.data-management-panel.hidden{display:none}.data-management-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.data-management-head h2{margin:2px 0 6px}.data-management-table-wrap,.data-import-preview-table-wrap{overflow:auto;border:1px solid var(--line,#d9dee7);border-radius:12px;background:#fff}.data-management-table,.data-import-preview-table{width:100%;border-collapse:collapse}.data-management-table th,.data-management-table td,.data-import-preview-table th,.data-import-preview-table td{padding:10px 12px;border-bottom:1px solid #e8ebf0;text-align:left;vertical-align:middle;white-space:nowrap}.data-management-table th,.data-import-preview-table th{background:#f7f9fc;font-weight:700}.data-management-table td:last-child{white-space:normal;min-width:260px}.data-management-actions{display:flex;gap:8px;flex-wrap:wrap}.data-management-badge{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;background:#eef4ff;font-size:12px}.data-management-badge.export-only{background:#f1f3f5}.data-import-preview{border:1px solid #d9dee7;border-radius:14px;padding:14px;background:#fff;display:flex;flex-direction:column;gap:12px}.data-import-preview.hidden{display:none}.data-import-preview-head,.data-import-preview-actions{display:flex;justify-content:space-between;gap:14px;align-items:center}.data-import-preview-head>div{display:flex;flex-direction:column;gap:3px}.data-import-message{padding:10px 12px;border-radius:9px;background:#f5f8ff}.data-import-message.warn{background:#fff6df}.data-import-preview-table-wrap{max-height:330px}.data-import-preview-table{font-size:13px}.data-import-preview-table th,.data-import-preview-table td{max-width:240px;overflow:hidden;text-overflow:ellipsis}.data-import-file-name{font-size:12px;color:#687386;margin-top:4px}@media(max-width:760px){.data-management-head,.data-import-preview-actions{flex-direction:column;align-items:stretch}.data-management-table-wrap{overflow-x:auto}}

/* Web v0.15.3：Excel 安全更新 / 完全取代 */
.data-import-title-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.data-import-mode-badge{display:inline-flex;align-items:center;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:700;border:1px solid transparent}.data-import-mode-badge.upsert{background:#eef4ff;color:#175cd3;border-color:#b2ccff}.data-import-mode-badge.replace{background:#fef3f2;color:#b42318;border-color:#fecdca}.data-import-message{white-space:pre-line}.data-import-errors{padding:11px 13px;border:1px solid #fda29b;border-radius:10px;background:#fef3f2;color:#912018}.data-import-errors.hidden{display:none}.data-import-errors strong{display:block;margin-bottom:6px}.data-import-errors ul{margin:0;padding-left:22px}.data-import-errors li+li{margin-top:4px}.data-management-actions .danger-button{white-space:nowrap}.data-import-preview-actions .danger-button{font-weight:700}


/* ===== Web v0.15.6：Firefox 表格相容模式 =====
   Firefox 不使用總表虛擬 spacer rows，並改用 auto table layout，避免寬表格 + sticky + fixed layout 出現空白/尺寸異常。 */
.browser-firefox #dataTable {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
.browser-firefox #dataTable th,
.browser-firefox #dataTable td {
  box-sizing: border-box;
}

/* v0.15.7：總表 全部／未完成／已完成 */
.project-status-filter { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.project-status-btn { border: 0; min-height: 30px; padding: 5px 10px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.project-status-btn:hover { background: #f2f5f8; color: var(--text); }
.project-status-btn.active { background: #e9f2ff; color: #174f8f; box-shadow: inset 0 0 0 1px #cbdff7; }
@media (max-width: 900px) { .project-status-filter { order: 3; } }

/* ===== LeDuo Total Web Demo Edition ===== */
.demo-login-card { position: relative; overflow: hidden; }
.demo-login-card::after {
  content: "DEMO";
  position: absolute;
  right: -34px;
  top: 22px;
  transform: rotate(34deg);
  padding: 7px 42px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
}
.demo-login-note {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid #c7d7fe;
  border-radius: 10px;
  background: #f4f7ff;
  color: #344054;
  font-size: 13px;
}
.demo-login-note strong { color: #155eef; }
.demo-login-footnote { grid-column: 1 / -1; margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.demo-banner {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 18px;
  border-bottom: 1px solid #f6d58e;
  background: #fff8e7;
  color: #7a4d00;
  font-size: 12px;
}
.demo-banner strong {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f79009;
  color: white;
  font-size: 10px;
  letter-spacing: .08em;
}
.demo-reset { border-color: #d0d5dd; color: #344054; }
.context-demo-message {
  margin: 4px 6px 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff8e7;
  color: #7a4d00;
  font-size: 11px;
  line-height: 1.55;
  white-space: normal;
}
.demo-context-label { color: #b54708; }
@media (max-width: 800px) {
  .demo-banner { align-items: flex-start; justify-content: flex-start; }
  .demo-reset { display: none; }
}
