:root {
  color: #172033;
  background: #f3f6fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --primary: #2f67d8;
  --primary-dark: #2456bd;
  --border: #dde4ed;
  --muted: #758095;
  --surface: #ffffff;
  --success: #158252;
  --warning: #b65b19;
  --danger: #bd352f;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body { min-height: 100vh; margin: 0; background: #f3f6fa; }
button, input, select, textarea { font: inherit; }
button, select, label.file-button { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 12%, rgba(47, 103, 216, 0.1), transparent 34%),
    #f3f6fa;
}

.auth-card {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid #dce4ee;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(27, 42, 66, 0.13);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 22px;
  border-bottom: 1px solid #edf0f4;
}
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { font-size: 15px; }
.auth-brand div > span { margin-top: 2px; color: #8992a2; font-size: 10px; }
.auth-checking { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #6d788b; text-align: center; }
.auth-checking strong { margin-top: 13px; font-size: 13px; }
.auth-checking small { margin-top: 4px; color: #98a0ad; }
.login-form { padding: 26px 22px 23px; }
.auth-heading h1 { margin: 4px 0 0; font-size: 21px; letter-spacing: -0.02em; }
.auth-heading > p:last-child { margin: 7px 0 0; color: #778195; font-size: 11px; }
.auth-field { display: block; margin-top: 20px; }
.auth-field input { height: 43px; }
.auth-message { margin: 11px 0 0; padding: 8px 10px; border: 1px solid #f0c8c3; border-radius: 8px; color: #9f3932; background: #fff4f3; font-size: 10px; line-height: 1.5; }
.auth-message.success { border-color: #bfe5d1; color: #176d48; background: #effaf4; }
.login-button { width: 100%; min-height: 42px; margin-top: 14px; }
.auth-footnote { margin: 13px 0 0; color: #929aa8; font-size: 9px; text-align: center; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid #dfe5ed;
  background: #fff;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--primary);
  box-shadow: 0 6px 16px rgba(47, 103, 216, 0.22);
}
.brand-mark svg { width: 27px; height: 27px; fill: rgba(255, 255, 255, 0.18); stroke: #fff; stroke-width: 1.7; stroke-linejoin: round; }
.brand-mark .brand-check { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: #8a93a3; font-size: 11px; }

.main-nav { display: grid; gap: 6px; margin-top: 31px; }
.nav-item {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: #5e697c;
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.nav-item > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #758096;
  background: #f0f3f7;
  font-size: 11px;
  font-weight: 750;
}
.nav-item:hover { color: #2c4672; background: #f5f8fd; }
.nav-item.active { color: #2055bd; background: #edf3ff; font-weight: 700; }
.nav-item.active > span { color: #fff; background: var(--primary); }

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid #dce7f9;
  border-radius: 10px;
  background: #f6f9fe;
}
.online-dot { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 4px; border: 2px solid #c9eddb; border-radius: 50%; background: #27a769; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { color: #35445c; font-size: 12px; }
.sidebar-note small { margin-top: 3px; color: #7f899a; font-size: 10px; line-height: 1.45; }

.workspace { min-width: 0; }
.topbar {
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 3vw, 38px);
  border-bottom: 1px solid #e0e6ed;
  background: rgba(255, 255, 255, 0.92);
}
.topbar h1 { margin: 1px 0 0; font-size: 20px; letter-spacing: -0.02em; }
.eyebrow { margin: 0; color: #7c8799; font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.identity-chip {
  max-width: 200px;
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 999px;
  color: #5f6b7f;
  background: #f0f3f7;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #dfe5ed;
  border-radius: 999px;
  color: #657084;
  background: #fff;
  font-size: 11px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #99a3b3; }
.sync-status.ready .status-dot { background: #1d9b60; box-shadow: 0 0 0 3px #dcf4e7; }
.sync-status.error .status-dot { background: #d44e42; box-shadow: 0 0 0 3px #fbe2df; }
.sync-status.loading .status-dot { background: #e0972f; animation: pulse 1s ease infinite; }

.main-content { max-width: 1340px; margin: 0 auto; padding: clamp(18px, 2.6vw, 34px); }

.page-loading {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #697487;
  text-align: center;
}
.page-loading strong { margin-top: 13px; font-size: 14px; }
.page-loading small { margin-top: 5px; color: #959dab; }
.spinner { width: 28px; height: 28px; border: 3px solid #dce5f5; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid #f0c6c2;
  border-radius: 11px;
  color: #8f302a;
  background: #fff5f4;
}
.error-banner strong { font-size: 13px; }
.error-banner p { margin: 3px 0 0; color: #a1514a; font-size: 11px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 16px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(20, 34, 56, 0.035);
}
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #3d72de; }
.stat-card.accent-green::before { background: #259566; }
.stat-card.accent-orange::before { background: #d47c28; }
.stat-card.accent-violet::before { background: #7b5dc7; }
.stat-card.accent-red::before { background: #d64545; }
.stat-card.accent-yellow::before { background: #d6a315; }
.stat-card span, .stat-card small, .stat-card strong { display: block; }
.stat-card span { color: #717d90; font-size: 11px; }
.stat-card strong { margin-top: 3px; overflow: hidden; font-size: 23px; letter-spacing: -0.02em; text-overflow: ellipsis; white-space: nowrap; }
.stat-card small { margin-top: 3px; overflow: hidden; color: #929aaa; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.feature-control { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 14px; padding: 17px 19px; }
.feature-control h2 { margin: 3px 0 0; font-size: 15px; }
.feature-control p { max-width: 760px; margin: 5px 0 0; color: #758095; font-size: 11px; line-height: 1.55; }
.feature-kicker { color: #2d64cc; font-size: 10px; font-weight: 750; }
.feature-switch { min-width: 112px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 8px 10px; border: 1px solid #cddcf7; border-radius: 999px; color: #2459bd; background: #f4f8ff; cursor: pointer; }
.feature-switch-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #3971dc; transition: background 0.18s ease; }
.feature-switch-track span { position: absolute; top: 3px; left: 17px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 38, 70, 0.25); transition: left 0.18s ease; }
.feature-switch[aria-checked="false"] { color: #6f7785; border-color: #d8dde5; background: #f5f6f8; }
.feature-switch[aria-checked="false"] .feature-switch-track { background: #aab2be; }
.feature-switch[aria-checked="false"] .feature-switch-track span { left: 3px; }
.feature-switch:disabled { cursor: wait; opacity: 0.65; }

.card { border: 1px solid var(--border); border-radius: 13px; background: #fff; box-shadow: 0 3px 12px rgba(20, 34, 56, 0.035); }
.version-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-top: 14px; padding: 15px 17px; }
.version-summary { min-width: 0; display: flex; align-items: center; gap: 10px; }
.version-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; font-size: 11px; font-weight: 800; }
.version-icon.draft { color: #a45a16; background: #fff1df; }
.version-icon.published { color: #16744a; background: #e8f8f0; }
.version-summary small, .version-summary strong, .version-summary span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version-summary small { color: #8a93a3; font-size: 10px; }
.version-summary strong { margin-top: 1px; font-size: 13px; }
.version-summary span { margin-top: 2px; color: #858fa0; font-size: 10px; }
.version-arrow { color: #a5adba; }

.lexicon-card, .history-card { margin-top: 14px; overflow: hidden; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 18px 14px; }
.section-header h2, .view-heading h2 { margin: 0; font-size: 16px; }
.section-header p, .view-heading > div > p:last-child { margin: 4px 0 0; color: #818b9c; font-size: 11px; }
.section-actions { display: flex; gap: 8px; }

.primary-button, .secondary-button, .ghost-button, .danger-button, .icon-button, .page-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.primary-button { border: 1px solid var(--primary); color: #fff; background: var(--primary); box-shadow: 0 3px 8px rgba(47, 103, 216, 0.16); }
.primary-button:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.secondary-button, .page-button { border: 1px solid #d6dee8; color: #425068; background: #fff; }
.secondary-button:hover, .page-button:hover:not(:disabled) { border-color: #b9c6d8; background: #f8fafc; }
.ghost-button { border: 1px solid transparent; color: #5f6a7e; background: transparent; }
.ghost-button:hover { background: #f2f4f7; }
.danger-button { border: 1px solid #bd3d36; color: #fff; background: #c5433b; }
.danger-button:hover { background: #ad332d; }
.icon-button { width: 36px; padding: 0; border: 1px solid #dce3ec; color: #506078; background: #fff; font-size: 18px; }
.icon-button:hover { background: #f5f7fa; }
.logout-button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  color: #657084;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}
.logout-button:hover { color: #9c3f39; border-color: #e7c8c4; background: #fff8f7; }
button:disabled, label.file-button:has(input:disabled) { opacity: 0.48; cursor: not-allowed; box-shadow: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, label.file-button:has(input:focus-visible) { outline: 3px solid rgba(47, 103, 216, 0.18); outline-offset: 2px; }
.button-busy { color: transparent !important; position: relative; pointer-events: none; }
.button-busy::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.secondary-button.button-busy::after, .ghost-button.button-busy::after { border-color: #d4dbe5; border-top-color: #4c668f; }
.logout-button.button-busy::after { border-color: #d4dbe5; border-top-color: #4c668f; }

.file-button { position: relative; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 150px 170px; gap: 9px; padding: 12px 18px; border-top: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; background: #fafbfd; }
.search-box { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #d8e0ea; border-radius: 8px; color: #8590a2; background: #fff; }
.search-box:focus-within { border-color: #7d9fe7; box-shadow: 0 0 0 3px rgba(47, 103, 216, 0.08); }
.search-box input { width: 100%; height: 36px; border: 0; outline: 0; color: #253149; background: transparent; font-size: 12px; }
.select-field select { width: 100%; height: 38px; padding: 0 29px 0 10px; border: 1px solid #d8e0ea; border-radius: 8px; color: #4e5a6e; background: #fff; font-size: 12px; }

.table-meta { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; color: #828c9d; font-size: 10px; }
.table-wrap { min-height: 190px; overflow-x: auto; border-top: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { padding: 10px 12px; color: #7d8798; background: #f7f9fb; font-size: 10px; font-weight: 650; text-align: left; }
td { padding: 11px 12px; border-top: 1px solid #edf0f4; color: #445067; font-size: 11px; vertical-align: middle; overflow-wrap: anywhere; }
tbody tr:hover { background: #fbfcfe; }
th:nth-child(1) { width: 17%; }
th:nth-child(2) { width: 12%; }
th:nth-child(3) { width: 12%; }
th:nth-child(4) { width: 21%; }
th:nth-child(5) { width: 10%; }
th:nth-child(6) { width: 15%; }
th:nth-child(7) { width: 13%; }
.term-cell strong { color: #202b3d; font-size: 12px; }
.muted-text { color: #98a0ad; }
.category-tag { display: inline-flex; padding: 2px 7px; border-radius: 999px; color: #6250a1; background: #f1eefb; font-size: 10px; }
.severity-badge, .risk-count-chip, .occurrence-badge { display: inline-flex; align-items: center; border-radius: 999px; font-size: 10px; font-weight: 700; }
.severity-badge { padding: 3px 8px; white-space: nowrap; }
.risk-count-chip, .occurrence-badge { padding: 2px 7px; }
.severity-high { color: #a51d1d; background: #fee2e2; }
.severity-medium { color: #ad4d0b; background: #ffead5; }
.severity-low { color: #805600; background: #fff3bf; }
.status-button { min-height: 28px; padding: 4px 8px; border: 1px solid; border-radius: 999px; font-size: 10px; font-weight: 700; cursor: pointer; }
.status-button.enabled { border-color: #bce7d2; color: #147248; background: #effaf4; }
.status-button.disabled { border-color: #dce2e9; color: #747f91; background: #f5f6f8; }
.edit-button { min-height: 29px; padding: 4px 9px; border: 1px solid #d8e0e9; border-radius: 7px; color: #44526a; background: #fff; font-size: 10px; cursor: pointer; }
.edit-button:hover { border-color: #9db1d2; color: #2557b5; }
.action-cell { text-align: right; }

.empty-state { padding: 42px 20px; color: #8791a2; text-align: center; }
.empty-state > span { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 9px; border-radius: 13px; color: #6f7e97; background: #eef2f7; font-size: 16px; }
.empty-state strong { display: block; color: #536078; font-size: 13px; }
.empty-state p { margin: 5px 0 12px; font-size: 11px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; color: #778195; font-size: 10px; }
.page-button { min-height: 30px; padding: 4px 9px; font-size: 10px; }

.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.view-heading h2 { margin-top: 3px; font-size: 20px; }
.version-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.release-card { position: relative; min-height: 154px; overflow: hidden; padding: 20px; }
.release-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -42px; bottom: -52px; border-radius: 50%; background: rgba(56, 108, 218, 0.06); }
.release-card.live-card::after { background: rgba(28, 145, 91, 0.07); }
.release-label { display: inline-flex; padding: 3px 8px; border-radius: 999px; color: #995319; background: #fff0df; font-size: 10px; font-weight: 700; }
.live-card .release-label { color: #146c46; background: #e8f8f0; }
.release-card strong { display: block; margin-top: 13px; font-size: 21px; }
.release-card p { margin: 5px 0; color: #697489; font-size: 12px; }
.release-card small { color: #939baa; font-size: 10px; }
.history-card { margin-top: 13px; }
.history-list { border-top: 1px solid #edf0f4; }
.history-item { display: grid; grid-template-columns: minmax(150px, 1fr) 140px 100px auto; align-items: center; gap: 16px; padding: 13px 18px; border-bottom: 1px solid #edf0f4; }
.history-item:last-child { border-bottom: 0; }
.history-name strong, .history-name small { display: block; }
.history-name strong { font-size: 12px; }
.history-name small, .history-meta { margin-top: 2px; color: #8b94a3; font-size: 10px; }
.current-badge { display: inline-flex; padding: 2px 7px; border-radius: 999px; color: #147148; background: #eaf8f1; font-size: 10px; }

.trigger-log-heading { align-items: center; }
.trigger-log-controls { display: flex; align-items: flex-end; gap: 8px; }
.date-field span { display: block; margin-bottom: 5px; color: #788397; font-size: 10px; font-weight: 650; }
.date-field input { height: 36px; padding: 0 9px; border: 1px solid #d6dee8; border-radius: 8px; color: #3f4c62; background: #fff; font-size: 11px; }
.daily-card, .trigger-log-card { overflow: hidden; }
.daily-card { margin-bottom: 13px; }
.daily-list { display: flex; gap: 9px; padding: 0 18px 17px; overflow-x: auto; scrollbar-width: thin; }
.daily-item { min-width: 222px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 11px; border: 1px solid #dde4ed; border-radius: 10px; color: #4c586d; background: #fff; text-align: left; cursor: pointer; }
.daily-item:hover { border-color: #9bb3e7; background: #f8faff; }
.daily-item.active { border-color: #6d92e4; background: #f1f5ff; box-shadow: 0 0 0 2px rgba(47, 103, 216, 0.08); }
.daily-date strong, .daily-date small, .daily-totals strong, .daily-totals small { display: block; }
.daily-date strong, .daily-totals strong { font-size: 11px; }
.daily-date small, .daily-totals small { margin-top: 2px; color: #8b94a4; font-size: 9px; }
.daily-totals { text-align: right; }
.daily-risk-counts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.inline-empty { padding: 0 18px 18px; color: #8b94a4; font-size: 11px; }
.trigger-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 13px; }
.inline-loading { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #728096; font-size: 11px; }
.inline-loading .spinner { width: 20px; height: 20px; }
.inline-error { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 18px 15px; padding: 11px 12px; border: 1px solid #f0c6c2; border-radius: 9px; color: #9e3d35; background: #fff6f5; font-size: 11px; }
.trigger-log-list { border-top: 1px solid #edf0f4; }
.trigger-log-item { border-bottom: 1px solid #edf0f4; }
.trigger-log-summary { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(210px, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 18px; }
.trigger-log-identity { min-width: 0; }
.trigger-log-identity strong, .trigger-log-identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trigger-log-identity strong { font-size: 12px; }
.trigger-log-identity span { margin-top: 3px; color: #808b9d; font-size: 9px; }
.trigger-log-metadata, .trigger-log-counts, .occurrence-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.device-chip, .version-chip, .ai-chip, .occurrence-total-chip { display: inline-flex; padding: 2px 7px; border-radius: 999px; color: #667287; background: #f0f3f7; font-size: 9px; }
.ai-chip.used { color: #176f49; background: #e8f8f0; font-weight: 700; }
.log-toggle { min-height: 30px; padding: 4px 9px; font-size: 10px; }
.trigger-log-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 14px; padding: 14px 18px 17px; border-top: 1px dashed #dce3ec; background: #fafbfd; }
.detail-label { display: block; margin-bottom: 6px; color: #798598; font-size: 10px; font-weight: 700; }
.logged-content p { max-height: 260px; margin: 0; overflow: auto; color: #344057; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.occurrence-badges { align-items: flex-start; }
.trigger-log-pagination { border-top: 1px solid #edf0f4; }
.trigger-log-pagination > span:first-child { margin-right: auto; }

.installer-report-heading { align-items: center; }
.installer-report-controls { display: flex; align-items: flex-end; gap: 8px; }
.installer-report-controls select { min-width: 132px; height: 36px; padding: 0 9px; border: 1px solid #d6dee8; border-radius: 8px; color: #3f4c62; background: #fff; font-size: 11px; }
.installer-report-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 13px; }
.installer-report-card { overflow: hidden; }
.installer-report-list { border-top: 1px solid #edf0f4; }
.installer-report-item { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px 14px; padding: 14px 18px; border-bottom: 1px solid #edf0f4; border-left: 3px solid #80b79d; }
.installer-report-item.status-error { border-left-color: #d86a61; background: #fffafa; }
.installer-report-identity strong, .installer-report-identity span { display: block; }
.installer-report-identity strong { font-size: 12px; }
.installer-report-identity span { margin-top: 3px; color: #808b9d; font-size: 9px; }
.installer-status { align-self: start; padding: 3px 8px; border-radius: 999px; color: #176f49; background: #e8f8f0; font-size: 9px; font-weight: 700; }
.installer-status.status-error { color: #a33c34; background: #fff0ee; }
.installer-status.status-info { color: #355f9c; background: #edf4ff; }
.installer-report-metadata { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.installer-report-message { grid-column: 1 / -1; margin: 0; color: #58657a; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }

.device-heading { align-items: center; }
.device-refresh-button { min-height: 44px; }
.device-stat-grid { margin-bottom: 13px; }
.device-policy-control { margin: 0 0 13px; border-color: #d8e4f7; }
.device-policy-control .feature-switch[aria-checked="false"] strong { color: #23734d; }
.desktop-release-card { margin-bottom: 13px; overflow: hidden; }
.desktop-release-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 17px 18px; }
.release-status-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: #245cbe; background: #edf4ff; font-size: 13px; font-weight: 800; }
.desktop-release-summary h2 { margin: 3px 0 0; font-size: 15px; }
.desktop-release-summary p { margin: 4px 0 0; color: #7c8798; font-size: 10px; }
.desktop-release-link { min-height: 44px; text-decoration: none; }
.adoption-area { padding: 13px 18px 16px; border-top: 1px solid #edf0f4; background: #fafbfd; }
.adoption-area > span { display: block; margin-bottom: 9px; color: #6f7b8f; font-size: 10px; font-weight: 700; }
.adoption-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 9px 13px; }
.adoption-row { min-width: 0; }
.adoption-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.adoption-label strong { color: #344157; font-size: 10px; }
.adoption-label span { color: #8791a2; font-size: 9px; }
.adoption-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e7ecf3; }
.adoption-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #356fdf, #6d92e5); }
.release-empty { margin: 0; padding: 0; }
.device-card { overflow: hidden; }
.device-filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 170px; gap: 9px; padding: 12px 18px; border-top: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; background: #fafbfd; }
.device-filter-bar .search-box input { min-height: 44px; }
.device-filter-bar .select-field select { min-height: 44px; }
.device-table-wrap { min-height: 230px; }
.device-table th:nth-child(1) { width: 17%; }
.device-table th:nth-child(2) { width: 14%; }
.device-table th:nth-child(3) { width: 15%; }
.device-table th:nth-child(4) { width: 11%; }
.device-table th:nth-child(5) { width: 11%; }
.device-table th:nth-child(6) { width: 8%; }
.device-table th:nth-child(7) { width: 12%; }
.device-table th:nth-child(8) { width: 12%; }
.device-identity strong, .device-identity span, .device-detail strong, .device-detail span, .device-version-stack strong, .device-version-stack small { display: block; }
.device-identity strong, .device-detail strong, .device-version-stack strong { overflow: hidden; color: #273248; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.device-identity span, .device-detail span, .device-version-stack small { margin-top: 3px; overflow: hidden; color: #8a93a2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.device-update-state { display: inline-flex; margin-top: 4px; padding: 2px 6px; border-radius: 999px; color: #397151; background: #eaf7f0; font-size: 9px; }
.device-update-state.needs-update { color: #a95a16; background: #fff0df; }
.device-online-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.device-online-badge.online { color: #16744b; background: #e9f8f1; }
.device-online-badge.offline { color: #707b8d; background: #f0f2f5; }
.device-online-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.device-name-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.device-name-line strong { min-width: 0; flex: 1; }
.device-inline-action, .device-policy-reset, .device-policy-refresh { min-height: 28px; padding: 4px 7px; border: 1px solid #dbe3ed; border-radius: 7px; color: #52617a; background: #fff; font-size: 9px; cursor: pointer; white-space: nowrap; }
.device-inline-action:hover, .device-policy-reset:hover, .device-policy-refresh:hover { border-color: #9ab2df; color: #285dbb; background: #f6f9ff; }
.device-policy { display: grid; gap: 5px; justify-items: start; }
.device-policy-switch { min-height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #cfe7da; border-radius: 999px; color: #176b47; background: #ecf8f2; cursor: pointer; }
.device-policy-switch[aria-checked="false"] { border-color: #dce2e9; color: #647084; background: #f2f4f7; }
.device-policy-switch:disabled, .device-inline-action:disabled, .device-policy-reset:disabled, .device-policy-refresh:disabled { opacity: .55; cursor: wait; }
.device-policy-track { width: 23px; height: 14px; position: relative; flex: 0 0 auto; border-radius: 999px; background: #aeb8c6; transition: background .16s ease; }
.device-policy-track::after { content: ""; width: 10px; height: 10px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(22, 34, 51, .25); transition: transform .16s ease; }
.device-policy-switch[aria-checked="true"] .device-policy-track { background: #2aa26b; }
.device-policy-switch[aria-checked="true"] .device-policy-track::after { transform: translateX(9px); }
.device-policy-switch strong { font-size: 9px; }
.device-policy small { color: #8a93a2; font-size: 8px; line-height: 1.35; }
.device-policy-apply-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 999px; font-size: 8px; font-weight: 750; line-height: 1.35; }
.device-policy-apply-status::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.device-policy-apply-status.applied { color: #16744b; background: #e9f8f1; }
.device-policy-apply-status.pending { color: #8a5b11; background: #fff3d9; }
.device-policy-apply-status.offline { color: #667287; background: #eef1f5; }
.device-policy-apply-status.failed { color: #a33c34; background: #fff0ee; }
.device-policy-error { max-width: 170px; color: #a33c34; font-size: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.device-policy-refresh { min-height: 32px; color: #8a352f; border-color: #efc8c4; background: #fff8f7; }
.device-policy-reset { min-height: 26px; padding: 3px 6px; }
.device-pagination > span:first-child { margin-right: auto; }
.device-pagination .page-button { min-height: 44px; }
.device-card .inline-error .secondary-button { min-height: 44px; }

.modal {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 15px;
  color: #1b2537;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 31, 49, 0.25);
}
.modal::backdrop { background: rgba(19, 29, 45, 0.48); backdrop-filter: blur(2px); }
.compact-modal { width: min(480px, calc(100vw - 28px)); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 20px 14px; border-bottom: 1px solid #edf0f4; }
.modal-header h2 { margin: 2px 0 0; font-size: 17px; }
.close-button { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #7a8495; background: #f3f5f8; font-size: 20px; cursor: pointer; }
.close-button:hover { color: #3d4a60; background: #e9edf2; }
.modal-body { padding: 19px 20px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid #edf0f4; background: #fafbfd; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.full-field { grid-column: 1 / -1; }
.field > span { display: block; margin-bottom: 6px; color: #46536a; font-size: 11px; font-weight: 650; }
.field em { color: #c93d35; font-style: normal; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d7dfe9; border-radius: 8px; color: #243048; background: #fff; outline: 0; }
.field input, .field select { height: 39px; padding: 0 10px; }
.field textarea { min-height: 82px; padding: 9px 10px; line-height: 1.55; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #7498e6; box-shadow: 0 0 0 3px rgba(47, 103, 216, 0.08); }
.field small { display: block; margin-top: 5px; color: #8a93a2; font-size: 10px; }
.confirm-illustration { width: 51px; height: 51px; display: grid; place-items: center; margin: 2px auto 12px; border-radius: 15px; color: #315fae; background: #eaf1ff; font-size: 17px; font-weight: 800; }
.confirm-illustration.publish { color: #177149; background: #e8f8f0; }
.confirm-illustration.rollback { color: #a85c19; background: #fff0df; font-size: 23px; }
.confirm-title { margin: 0; color: #2c374b; font-size: 14px; font-weight: 700; text-align: center; }
.confirm-copy { margin: 6px 0 0; color: #778195; font-size: 11px; line-height: 1.55; text-align: center; }
.notice-box, .warning-box { margin-top: 15px; padding: 9px 11px; border-radius: 8px; font-size: 10px; line-height: 1.55; }
.notice-box { color: #4d6283; background: #f0f4fa; }
.warning-box { color: #8e4828; background: #fff3eb; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 10000; width: min(340px, calc(100vw - 36px)); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid #d9e2ed; border-radius: 10px; color: #344158; background: #fff; box-shadow: 0 10px 30px rgba(28, 41, 63, 0.16); font-size: 11px; animation: toast-in .2s ease; }
.toast::before { content: "✓"; width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: #1b9560; font-size: 10px; }
.toast.error::before { content: "!"; background: #c7443d; }
.toast strong { display: block; font-size: 11px; }
.toast span { display: block; margin-top: 2px; color: #778195; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 1080px) {
  .identity-chip { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .version-strip { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .version-strip > .primary-button { grid-column: 1 / -1; width: 100%; }
  .filter-bar { grid-template-columns: minmax(230px, 1fr) 140px 150px; }
  .trigger-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trigger-log-summary { grid-template-columns: minmax(220px, 1fr) minmax(190px, 1fr) auto; }
  .trigger-log-summary .log-toggle { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 12px 16px 0; border-right: 0; border-bottom: 1px solid #dfe5ed; }
  .brand { padding: 0; }
  .brand-mark { width: 35px; height: 35px; border-radius: 10px; }
  .brand-mark svg { width: 23px; height: 23px; }
  .main-nav { display: flex; gap: 4px; margin-top: 11px; overflow-x: auto; }
  .nav-item { width: auto; min-height: 38px; flex: 0 0 auto; padding: 6px 10px; border-radius: 8px 8px 0 0; }
  .nav-item > span { display: none; }
  .sidebar-note { display: none; }
  .topbar { min-height: 64px; padding: 11px 16px; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 18px; }
  .main-content { padding: 16px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .device-filter-bar { grid-template-columns: 1fr 160px; }
}

@media (max-width: 680px) {
  .feature-control { align-items: flex-start; flex-direction: column; }
  .sync-status { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { padding: 13px; }
  .stat-card strong { font-size: 20px; }
  .version-strip { grid-template-columns: 1fr; gap: 10px; }
  .version-arrow { display: none; }
  .section-header { align-items: flex-start; flex-direction: column; padding: 15px; }
  .section-actions { width: 100%; }
  .section-actions > * { flex: 1; }
  .filter-bar { padding: 11px 15px; }
  .table-meta { padding: 9px 15px; }
  .table-meta span:last-child { display: none; }
  .table-wrap { padding: 0 12px 12px; border-top: 0; background: #f8fafc; }
  table, tbody { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 9px; }
  tbody tr { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid #dfe5ed; border-radius: 10px; background: #fff; }
  tbody tr:hover { background: #fff; }
  td { display: grid; grid-template-columns: 75px minmax(0, 1fr); align-items: center; gap: 7px; padding: 8px 10px; border-top: 1px solid #edf0f4; font-size: 10px; }
  td::before { content: attr(data-label); color: #8a93a3; font-size: 9px; }
  td:nth-child(1), td:nth-child(4), td:nth-child(7), td:nth-child(8) { grid-column: 1 / -1; }
  td:first-child { border-top: 0; }
  td:nth-child(2), td:nth-child(3) { border-top: 0; }
  .action-cell { text-align: left; }
  .edit-button { width: 100%; }
  .pagination { justify-content: center; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .view-heading .primary-button { width: 100%; }
  .version-card-grid { grid-template-columns: 1fr; }
  .history-item { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 15px; }
  .history-meta { grid-column: 1; }
  .current-badge { grid-column: 2; grid-row: 1; }
  .history-item .secondary-button { grid-column: 2; grid-row: 1 / span 2; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .trigger-log-controls { width: 100%; }
  .date-field { flex: 1; }
  .date-field input { width: 100%; }
  .trigger-log-summary { grid-template-columns: 1fr auto; }
  .trigger-log-metadata, .trigger-log-counts { grid-column: 1; }
  .trigger-log-summary .log-toggle { grid-column: 2; grid-row: 1 / span 3; }
  .trigger-log-detail { grid-template-columns: 1fr; }
  .installer-report-controls { width: 100%; }
  .installer-report-controls .date-field { flex: 1; }
  .installer-report-controls select { width: 100%; }
  .device-heading { align-items: stretch; }
  .device-heading .device-refresh-button { width: 100%; }
  .desktop-release-summary { grid-template-columns: auto minmax(0, 1fr); }
  .desktop-release-link { grid-column: 1 / -1; width: 100%; }
  .device-filter-bar { grid-template-columns: 1fr; padding: 11px 15px; }
  .device-filter-bar .search-box { grid-column: auto; }
  .device-pagination { flex-wrap: wrap; }
  .device-pagination > span:first-child { width: 100%; margin-right: 0; text-align: center; }
  .device-policy-switch, .device-policy-refresh, .device-policy-reset { min-height: 44px; }
  .device-policy-error { max-width: none; }
}

@media (max-width: 420px) {
  .auth-screen { padding: 14px; }
  .auth-card { border-radius: 14px; }
  .auth-brand { padding: 17px 18px; }
  .login-form { padding: 22px 18px 20px; }
  .brand small { display: none; }
  .sync-status { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .section-actions { flex-direction: column; }
  .trigger-stat-grid { grid-template-columns: 1fr 1fr; }
  .trigger-log-summary { padding: 12px; }
  .trigger-log-detail { padding: 12px; }
  .modal-header, .modal-body { padding-right: 16px; padding-left: 16px; }
  .modal-footer { padding-right: 16px; padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
