:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #17324d;
  --muted: #5f7488;
  --line: #d6e7f3;
  --teal: #2f9fe3;
  --teal-dark: #1677b8;
  --amber: #b7791f;
  --red: #c2414a;
  --navy: #145d91;
  --shadow: 0 18px 50px rgba(35, 95, 135, 0.12);
}

* {
  box-sizing: border-box;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html.is-busy body::before {
  content: "";
  position: fixed;
  z-index: 10001;
  top: 0;
  left: 0;
  width: 42%;
  height: 4px;
  background: var(--teal);
  box-shadow: 0 1px 8px rgba(47, 159, 227, 0.36);
  animation: global-loading-bar 1.05s ease-in-out infinite;
}

.global-busy-indicator {
  position: fixed;
  z-index: 10000;
  top: 14px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 14px;
  transform: translateX(-50%);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #b9ddf4;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(35, 95, 135, 0.2);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.global-busy-spinner,
.button-feedback-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(47, 159, 227, 0.25);
  border-top-color: var(--teal-dark);
  border-radius: 50%;
  animation: loading-spinner 0.72s linear infinite;
}

@keyframes global-loading-bar {
  0% { transform: translateX(-105%); }
  55% { transform: translateX(95%); }
  100% { transform: translateX(245%); }
}

@keyframes loading-spinner {
  to { transform: rotate(360deg); }
}

html[lang="zh-Hant"] body {
  font-family: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei UI", "Microsoft JhengHei", "Heiti TC", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button.has-interaction-feedback {
  position: relative;
}

button > .button-feedback-spinner {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 13px;
  height: 13px;
  margin-top: -7px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.nav-parent > .button-feedback-spinner {
  right: 38px;
}

.nav-item.navigation-loading {
  color: #105f96;
  background: #ffffff;
  border-color: #8acaf0;
  box-shadow: 0 5px 16px rgba(42, 123, 175, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  html.is-busy body::before,
  .global-busy-spinner,
  .button-feedback-spinner {
    animation-duration: 1.8s;
  }
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #f3faff;
}

.login-actions {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 5;
}

.login-panel {
  width: min(440px, 100%);
  padding: 38px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: white;
  border-radius: 8px;
  font-weight: 700;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-panel h1 {
  margin: 14px 0 10px;
  font-size: 34px;
  line-height: 1.12;
}

.login-copy {
  color: var(--muted);
  line-height: 1.65;
}

.login-form,
.title-field,
.search-box {
  display: grid;
  gap: 8px;
}

.login-form {
  margin-top: 28px;
  gap: 16px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 159, 227, 0.18);
}

textarea {
  width: 100%;
  min-height: 126px;
  padding: 12px 14px;
  resize: vertical;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  line-height: 1.6;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-button {
  background: var(--teal);
  color: white;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button,
.ghost-button {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

.force-send-button {
  color: #8c5d12;
  background: #fffaf0;
  border-color: #ddb968;
}

.force-send-button:hover {
  background: #fff3d6;
  border-color: #c99a35;
}

.danger-button {
  background: #fff1ef;
  color: var(--red);
  border-color: #f0c2bd;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.error-text {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  padding: 24px;
  background: #dff2ff;
  color: var(--ink);
  border-right: 1px solid #b9ddf4;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand span,
.nas-panel span {
  display: block;
  color: #55768f;
  font-size: 13px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 44px;
  padding: 0 14px;
  color: #245b7c;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  color: #105f96;
  background: #ffffff;
  border-color: #add8f2;
  box-shadow: 0 5px 16px rgba(42, 123, 175, 0.11);
}

.nav-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-parent::after {
  content: "+";
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.nav-parent[aria-expanded="true"]::after { content: "−"; }

.nav-submenu {
  display: grid;
  gap: 6px;
  margin-left: 10px;
  padding: 2px 0 2px 12px;
  border-left: 2px solid #add8f2;
}

.nav-submenu[hidden] { display: none; }

.nav-subitem {
  min-height: 40px;
  padding-left: 12px;
  font-size: 14px;
}

.nas-panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #b9ddf4;
  border-radius: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.16);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h2,
.search-row h3 {
  margin: 0;
  font-size: 30px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 44px);
  height: 34px;
  padding: 3px;
  background: #edf8ff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang-option {
  min-width: 0;
  height: 26px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.lang-option.active {
  color: white;
  background: var(--navy);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.hero-band,
.placeholder-band,
.recorder-panel,
.activity-panel,
.meeting-detail,
.nas-upload-panel,
.nas-asset-list-panel,
.nas-asset-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.network-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.network-import-panel,
.network-jobs-panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.network-import-panel .section-heading p:last-child {
  color: var(--muted);
  line-height: 1.65;
}

.network-import-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.network-rights-check {
  align-items: flex-start;
}

.network-rights-check input {
  margin-top: 2px;
}

.network-pipeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.network-pipeline div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  min-height: 62px;
  padding: 12px;
  background: #f5faff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.network-pipeline span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.network-pipeline strong {
  font-size: 13px;
  line-height: 1.4;
}

.network-policy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.network-jobs-head,
.network-asset-heading,
.network-asset-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.network-jobs-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.network-jobs-head h3 {
  margin: 0;
  font-size: 24px;
}

.network-asset-list {
  display: grid;
  gap: 12px;
}

.network-asset-row {
  padding: 17px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
}

.network-asset-heading {
  align-items: flex-start;
}

.network-asset-heading div {
  min-width: 0;
}

.network-asset-heading strong,
.network-asset-heading span {
  display: block;
  overflow-wrap: anywhere;
}

.network-asset-heading div > span,
.network-asset-row > p,
.network-asset-meta {
  color: var(--muted);
  font-size: 13px;
}

.network-asset-heading div > span {
  margin-top: 5px;
}

.network-asset-row > p {
  margin: 14px 0;
  line-height: 1.55;
}

.network-asset-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.network-asset-meta a {
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: none;
}

.badge.downloading {
  background: #e8f5ff;
  color: var(--teal-dark);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 28px;
  padding: 30px;
}

.hero-band h1 {
  max-width: 720px;
  margin-bottom: 12px;
  font-size: 38px;
  line-height: 1.14;
}

.hero-band p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric-grid button {
  display: grid;
  align-content: center;
  min-height: 130px;
  padding: 18px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
}

.metric-grid button:hover {
  background: #edf8ff;
  border-color: #8ac7ec;
  box-shadow: 0 8px 20px rgba(35, 95, 135, 0.1);
}

.metric-grid span {
  font-size: 34px;
  font-weight: 700;
}

.metric-grid strong {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-assets-panel {
  margin-top: 18px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.dashboard-assets-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.dashboard-assets-head h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.dashboard-assets-head p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.asset-filter-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 20px 0 12px;
  padding: 4px;
  background: #edf8ff;
  border: 1px solid #c9e6f7;
  border-radius: 8px;
}

.asset-filter-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.asset-filter-tabs button.active {
  background: #ffffff;
  color: var(--teal-dark);
  box-shadow: 0 3px 10px rgba(35, 95, 135, 0.12);
}

.dashboard-asset-grid {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.dashboard-asset-row {
  display: grid;
  grid-template-columns: 76px minmax(220px, 1fr) minmax(170px, 220px) 110px auto 96px;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
}

.dashboard-asset-row:hover {
  background: #f6fbff;
  border-color: #8ac7ec;
}

.asset-kind {
  display: inline-flex;
  justify-content: center;
  padding: 6px 8px;
  background: #e7f5ff;
  border-radius: 6px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-asset-name,
.dashboard-asset-upload,
.dashboard-asset-size {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-asset-name strong,
.dashboard-asset-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-asset-name small,
.dashboard-asset-upload small,
.dashboard-asset-size small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-asset-upload small {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.dashboard-asset-upload small b {
  flex: 0 0 auto;
  color: #45657d;
}

.dashboard-asset-size b {
  font-size: 14px;
}

.dashboard-asset-open {
  min-height: 34px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 750;
  text-align: right;
}

.dashboard-asset-open:hover,
.dashboard-transcript-open:hover {
  background: #edf8ff;
  border-color: #8ac7ec;
}

.dashboard-transcript-preview {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid #e2edf5;
}

.dashboard-transcript-preview > strong {
  color: var(--teal-dark);
  font-size: 12px;
}

.dashboard-transcript-preview p {
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-transcript-preview p.is-empty {
  color: var(--muted);
}

.dashboard-transcript-open {
  min-height: 34px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #b9d9ed;
  border-radius: 6px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.nas-feature-band {
  margin-top: 18px;
  padding: 24px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.nas-feature-band .section-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.nas-feature-band .section-heading h3 {
  margin: 0;
  font-size: 24px;
}

.nas-feature-band .section-heading p:last-child {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.nas-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.nas-feature-grid article {
  min-height: 154px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: 8px;
}

.nas-feature-grid strong {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 15px;
}

.nas-feature-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.module-card {
  min-height: 132px;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.05);
}

.module-card:hover {
  border-color: rgba(47, 159, 227, 0.55);
  transform: translateY(-1px);
}

.module-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.module-card span,
.hint-text,
.placeholder-band p {
  color: var(--muted);
  line-height: 1.6;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(520px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.recorder-panel,
.activity-panel,
.placeholder-band,
.nas-upload-panel,
.nas-asset-list-panel,
.nas-asset-detail {
  padding: 24px;
}

.section-heading h3 {
  margin: 0 0 18px;
  font-size: 24px;
}

.recorder-stage {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 230px;
  margin: 18px 0;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.record-pulse {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 14px rgba(47, 159, 227, 0.16);
}

.record-pulse.recording {
  background: var(--red);
  animation: pulse 1.25s ease-in-out infinite;
}

.record-pulse.paused {
  background: var(--amber);
}

@keyframes pulse {
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 22px rgba(185, 64, 58, 0.08);
  }
}

.recorder-stage strong {
  font-variant-numeric: tabular-nums;
  font-size: 42px;
}

.recorder-stage span {
  color: var(--muted);
  font-weight: 700;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#recordPreview {
  width: 100%;
  margin-top: 16px;
}

.activity-feed {
  display: grid;
  gap: 10px;
}

.activity-item {
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 6px;
}

.activity-item strong {
  display: block;
  margin-bottom: 4px;
}

.activity-item span {
  color: var(--muted);
  font-size: 13px;
}

.search-box {
  width: min(420px, 100%);
}

.meeting-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.meeting-list {
  display: grid;
  gap: 10px;
}

.meeting-row {
  width: 100%;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.nas-upload-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.upload-progress {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  background: #edf8ff;
  border: 1px solid #b9ddf4;
  border-radius: 8px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.upload-progress-head strong {
  color: var(--teal-dark);
  font-size: 13px;
}

.upload-progress-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.upload-progress progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dbeef9;
}

.upload-progress progress::-webkit-progress-bar {
  background: #dbeef9;
  border-radius: 999px;
}

.upload-progress progress::-webkit-progress-value {
  background: var(--teal);
  border-radius: 999px;
}

.upload-progress progress::-moz-progress-bar {
  background: var(--teal);
  border-radius: 999px;
}

.asr-config-panel {
  display: grid;
  gap: 14px;
  padding: 15px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.asr-config-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.asr-config-panel strong {
  color: var(--ink);
}

.asr-config-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.recorder-asr-panel {
  margin-top: 16px;
}

.translation-config-panel {
  margin-top: 12px;
  border-left: 4px solid var(--amber);
}

.line-push-config-panel {
  margin-top: 12px;
  border-left: 4px solid var(--teal);
}

.line-push-controls {
  display: grid;
  gap: 12px;
}

.line-push-controls > label:first-child {
  display: grid;
  gap: 7px;
}

.checkbox-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.checkbox-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.line-push-status {
  padding: 11px 13px;
  color: var(--muted);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
}

.line-summary-section > small {
  display: block;
  margin: 8px 0 12px;
  color: var(--muted);
}

.config-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.switch-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  cursor: pointer;
}

.switch-control input {
  width: 38px;
  height: 22px;
  margin: 0;
  appearance: none;
  background: #cbd5e1;
  border: 0;
  border-radius: 11px;
  position: relative;
  transition: background 160ms ease;
}

.switch-control input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(23, 32, 51, 0.24);
  transition: transform 160ms ease;
}

.switch-control input:checked {
  background: var(--teal);
}

.switch-control input:checked::after {
  transform: translateX(16px);
}

.translation-config-panel > div:last-child {
  display: grid;
  gap: 12px;
}

.translation-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.translation-form-grid > label:last-child {
  grid-column: 1 / -1;
}

.translation-recommendation {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  background: #fff8ec;
  border: 1px solid #ead7b4;
  border-radius: 6px;
}

.translation-recommendation:empty {
  display: none;
}

.translation-recommendation > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.translation-recommendation strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.translation-recommendation span {
  color: #8c5d12;
  font-size: 12px;
  font-weight: 700;
}

.asr-recommendation {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  background: #eff6ff;
  border-left: 4px solid var(--teal);
  border-radius: 4px;
}

.asr-recommendation:empty {
  display: none;
}

.asr-recommendation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.asr-recommendation-head strong {
  font-size: 14px;
}

.asr-readiness {
  max-width: 58%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: right;
}

.asr-readiness.ready {
  color: var(--teal-dark);
}

.asr-readiness.downloading {
  color: #8c5d12;
}

.asr-readiness.not-ready {
  color: var(--red);
}

.asr-recommendation-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.asr-recommendation-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.asr-recommendation-meta b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.local-model-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.model-management-view {
  width: 100%;
}

.model-management-view .local-model-panel {
  padding: 24px;
}

.model-manager-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.model-manager-head strong {
  color: var(--ink);
}

.model-manager-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.model-manager-actions,
.local-model-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.local-model-list {
  display: grid;
  gap: 10px;
}

.local-model-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.local-model-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.local-model-title-line {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.local-model-title-line strong {
  overflow-wrap: anywhere;
}

.model-progress-track {
  height: 8px;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.model-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #7cccf2);
  border-radius: inherit;
  transition: width 180ms ease;
}

.local-model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.local-model-meta span {
  overflow-wrap: anywhere;
}

.local-model-meta .error-line {
  color: var(--red);
  font-weight: 700;
}

.compact-button {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 13px;
}

.nas-storage-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.nas-storage-map div {
  min-height: 78px;
  padding: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
}

.nas-storage-map span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nas-storage-map strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.nas-asset-list {
  display: grid;
  gap: 10px;
}

.nas-asset-row {
  width: 100%;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  text-align: left;
}

.nas-asset-row:hover,
.nas-asset-row.active {
  border-color: rgba(47, 159, 227, 0.55);
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.nas-asset-row p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.meeting-row:hover,
.meeting-row.active {
  border-color: rgba(47, 159, 227, 0.55);
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.meeting-row-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.meeting-row strong {
  overflow-wrap: anywhere;
}

.badge {
  flex: 0 0 auto;
  height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}

.badge.processing {
  background: #fff7e8;
  color: #8c5d12;
}

.badge.failed {
  background: #fff1ef;
  color: var(--red);
}

.badge.needs_model {
  background: #fff7e8;
  color: #8c5d12;
}

.meeting-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.meeting-detail {
  min-height: 420px;
  padding: 24px;
}

.meeting-detail h3 {
  margin-bottom: 6px;
  font-size: 24px;
}

.meeting-asset-actions {
  display: flex;
  margin: 14px 0;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.meeting-detail audio {
  width: 100%;
  margin: 8px 0 20px;
}

.transcript-box {
  min-height: 190px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.72;
}

.meeting-text-section {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.meeting-text-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.translation-result-section .transcript-box {
  background: #fffaf1;
  border-color: #ead7b4;
}

.nas-asset-detail {
  margin-top: 18px;
  min-height: 420px;
}

.asset-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.asset-detail-header h3 {
  margin: 0;
  font-size: 26px;
}

.asset-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 18px;
}

.asset-detail-actions button {
  min-height: 40px;
}

.opencc-button {
  padding: 10px 16px;
  border: 1px solid #79bde8;
  border-radius: 8px;
  background: #edf8ff;
  color: #126ca6;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.opencc-button:hover:not(:disabled) {
  background: #dcefff;
  border-color: #4da7dd;
}

.opencc-button:disabled {
  cursor: not-allowed;
}

.audio-playback-panel,
.video-playback-panel {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.asset-video-player {
  width: 100%;
  max-height: 68vh;
  aspect-ratio: 16 / 9;
  background: #071521;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
}

.audio-playback-heading,
.audio-segment-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.audio-playback-heading p,
.audio-segment-heading p,
.audio-segment-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.audio-playback-heading > span,
.media-heading-actions > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.media-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.media-download-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid #5aafe2;
  border-radius: 7px;
  background: #f2f9fe;
  color: #126ca6;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.media-download-button:hover {
  border-color: #278fcf;
  background: #e3f3fd;
}

.asset-audio-player,
.audio-segment-row audio {
  width: 100%;
  height: 44px;
}

.audio-segment-heading {
  margin-top: 6px;
}

.audio-segment-heading p {
  max-width: 720px;
  text-align: right;
}

.audio-segment-list {
  display: grid;
}

.audio-segment-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(320px, 1.68fr);
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid #e8f0f6;
}

.audio-segment-row > div {
  display: grid;
  gap: 4px;
}

.audio-segment-row span {
  color: var(--muted);
  font-size: 12px;
}

.segment-media-control {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 10px;
}

.segment-media-control audio {
  display: block;
  width: 100%;
  min-width: 320px;
}

.segment-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.segment-transcribe-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #187fc1;
  border-radius: 7px;
  background: #187fc1;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.segment-transcribe-button:hover:not(:disabled) {
  background: #106aa3;
}

.segment-transcribe-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.segment-transcription-slot:empty {
  display: none;
}

.segment-transcription-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #cfe3f1;
  border-radius: 7px;
  background: #f7fbfe;
}

.segment-transcription-status > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.segment-transcription-status.completed {
  border-color: #aadbc8;
  background: #f2fbf7;
}

.segment-transcription-status.failed {
  border-color: #edc4c1;
  background: #fff7f6;
}

.segment-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #dbe9f2;
}

.segment-progress > span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: #2699dc;
  transition: width 240ms ease;
}

.segment-progress > span.active {
  background-image: linear-gradient(90deg, #2699dc 0 40%, #72c5ee 50%, #2699dc 60% 100%);
  background-size: 200% 100%;
  animation: segment-progress-pulse 1.2s linear infinite;
}

@keyframes segment-progress-pulse {
  to {
    background-position: -200% 0;
  }
}

.segment-transcript summary {
  color: #126ca6;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.segment-transcript p,
.segment-transcription-error {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.segment-transcription-error {
  color: #a83b34;
}

.media-download-row .media-download-button {
  justify-self: end;
}

.asset-transcript-section {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  scroll-margin-top: 24px;
}

.asset-transcript-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.asset-transcript-heading span {
  color: var(--muted);
  font-size: 12px;
}

.transcript-heading-actions,
.segment-transcription-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.segment-transcription-heading-actions .media-download-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.asset-transcript-section .transcript-box {
  max-height: 520px;
  overflow: auto;
}

.asset-transcript-section .transcript-box.is-empty {
  min-height: 96px;
  color: var(--muted);
}

.asset-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.asset-meta-grid span,
.llm-usage-grid span {
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.asset-meta-grid b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.asset-summary,
.asset-process-panel,
.rag-chunk-panel,
.ai-analysis-history,
.document-ask-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.asset-summary p,
.asset-process-panel p,
.ai-analysis-history > div > p,
.document-ask-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.ai-analysis-list {
  display: grid;
  gap: 10px;
}

.ai-analysis-list article {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid #38bdf8;
  border-radius: 6px;
}

.ai-analysis-list article > strong {
  font-size: 12px;
  color: var(--muted);
}

.ai-analysis-list p,
.ai-analysis-list pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
}

.ai-analysis-list pre {
  max-height: 260px;
  overflow-y: auto;
  color: var(--muted);
}

.process-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.process-step {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 170px;
  padding: 14px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.process-step::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--line);
}

.process-step.done::before {
  background: var(--teal);
}

.process-step.active::before {
  background: var(--amber);
}

.process-step.blocked::before {
  background: var(--red);
}

.process-step.skipped::before {
  background: #94a3b8;
}

.process-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.process-step-head span {
  order: 2;
  flex: 0 0 auto;
  padding: 4px 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
}

.process-step.active .process-step-head span {
  background: #fff7e8;
  border-color: #f2d28e;
  color: #8c5d12;
}

.process-step.blocked .process-step-head span {
  background: #fff1ef;
  border-color: #f0b8b3;
  color: var(--red);
}

.process-step.skipped .process-step-head span {
  background: #f1f5f9;
  border-color: #d7dde8;
  color: var(--muted);
}

.process-step-head b {
  color: var(--ink);
  line-height: 1.35;
}

.process-step > strong {
  color: var(--teal-dark);
  font-size: 13px;
}

.process-step p {
  font-size: 13px;
}

.rag-chunk-list {
  display: grid;
  gap: 8px;
}

.rag-chunk-card,
.answer-source-card {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rag-chunk-card p,
.answer-source-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.chunk-source-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.chunk-source-line b {
  margin-right: 8px;
  color: var(--teal-dark);
}

.chunk-source-line span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
}

.rag-chunk-card img,
.answer-source-card img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2ff;
}

.answer-source-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.answer-source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.aiwork-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(520px, 1.22fr);
  gap: 18px;
  align-items: start;
}

.model-setup-disclosure {
  grid-column: 1 / -1;
}

.model-setup-disclosure > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 16px;
  color: var(--ink);
  background: #edf8ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.model-setup-disclosure > summary::-webkit-details-marker {
  display: none;
}

.model-setup-disclosure > summary::before {
  content: "+";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--teal-dark);
  background: white;
  border: 1px solid var(--line);
  border-radius: 50%;
  line-height: 1;
}

.model-setup-disclosure[open] > summary::before {
  content: "−";
}

.disclosure-state {
  margin-left: auto;
  color: var(--teal-dark);
  font-size: 13px;
}

.disclosure-state-closed,
.model-setup-disclosure:not([open]) .disclosure-state-open {
  display: none;
}

.model-setup-disclosure:not([open]) .disclosure-state-closed {
  display: inline;
}

.model-setup-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(520px, 1.22fr);
  gap: 18px;
  align-items: stretch;
}

.llm-config-panel,
.pricing-panel,
.model-use-panel,
.model-source-panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.llm-config-panel .section-heading p {
  color: var(--muted);
  line-height: 1.65;
}

.model-mode-group {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.model-mode-group > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.model-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  background: #edf8ff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.model-mode-switch button {
  min-height: 42px;
  padding: 9px 14px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.model-mode-switch button:hover {
  color: var(--ink);
}

.model-mode-switch button.active {
  background: white;
  color: var(--teal-dark);
  box-shadow: 0 1px 5px rgba(30, 41, 59, 0.12);
}

.model-mode-switch.compact {
  width: min(100%, 440px);
  margin-bottom: 14px;
}

.llm-form-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.llm-form-grid label,
.api-key-field {
  display: grid;
  gap: 8px;
}

.llm-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.system-llm-setting,
.asset-system-model {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #38a8e8;
  background: #f4faff;
  border-radius: 6px;
}

.system-llm-setting > div,
.asset-system-model {
  min-width: 0;
}

.system-llm-setting span,
.system-llm-setting small,
.asset-system-model span {
  display: block;
  color: var(--muted);
}

.system-llm-setting strong,
.asset-system-model strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.system-llm-setting small {
  margin-top: 3px;
}

.asset-system-model {
  justify-content: flex-start;
}

.model-use-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
}

.use-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.use-panel-header h4 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.use-mode-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  background: #fff7e8;
  border: 1px solid #eed7ad;
  border-radius: 999px;
  color: #8c5d12;
  font-size: 12px;
  font-weight: 700;
}

.use-mode-badge.ready {
  color: var(--teal-dark);
  background: #eff6ff;
  border-color: #bfdbfe;
}

.prompt-field {
  display: grid;
  gap: 8px;
}

.prompt-field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.prompt-field-heading label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.prompt-field-heading small {
  color: var(--teal-dark);
  font-size: 12px;
}

.prompt-input-wrap {
  position: relative;
}

.prompt-field input {
  height: 48px;
}

.system-prompt-field textarea {
  min-height: 76px;
  resize: vertical;
}

.mcp-run-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(210px, 320px);
  gap: 10px 18px;
  align-items: end;
  padding: 12px 14px;
  background: #edf8ff;
  border: 1px solid #bae1f7;
  border-radius: 7px;
}

.mcp-run-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.mcp-run-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.mcp-run-toggle strong,
.mcp-run-toggle small,
.mcp-server-select span {
  display: block;
}

.mcp-run-toggle strong {
  color: var(--ink);
  font-size: 14px;
}

.mcp-run-toggle small,
.mcp-run-status {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.mcp-server-select span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mcp-server-select select {
  min-height: 40px;
}

.mcp-run-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--teal-dark);
}

.mcp-run-status.unavailable {
  color: #9a3412;
}

.prompt-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 16px 38px rgba(30, 41, 59, 0.16);
}

.prompt-suggestion {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
  border: 0;
  border-radius: 5px;
  text-align: left;
}

.prompt-suggestion:hover,
.prompt-suggestion.active {
  background: #edf8ff;
}

.prompt-suggestion span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-suggestion small {
  flex: 0 0 auto;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 520px) {
  .prompt-field-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

.model-response-box {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.model-response-box.error {
  background: #fff1ef;
  border-color: #f0c2bd;
}

.model-response-box strong {
  display: block;
  margin-bottom: 10px;
}

.model-response-box pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
  font-family: inherit;
  line-height: 1.65;
}

.mcp-execution-trace {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mcp-execution-trace summary {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mcp-execution-trace strong {
  margin: 12px 0 5px;
  color: var(--ink);
  font-size: 12px;
}

.mcp-execution-trace pre {
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

@media (max-width: 720px) {
  .mcp-run-controls {
    grid-template-columns: 1fr;
  }

  .mcp-run-status {
    grid-column: 1;
  }
}

.nas-persistence-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-left: 4px solid #0ea5e9;
  border-radius: 6px;
  color: #075985;
  font-size: 13px;
  font-weight: 750;
}

.key-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.key-status.ready {
  color: var(--teal-dark);
}

.pricing-panel {
  min-height: 360px;
}

.pricing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.pricing-header h3 {
  margin-bottom: 6px;
  font-size: 26px;
}

.pricing-header span,
.pricing-date,
.pricing-meta {
  color: var(--muted);
  font-size: 13px;
}

.pricing-date {
  flex: 0 0 auto;
  padding: 7px 10px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.price-tile {
  min-height: 126px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price-tile span,
.price-tile small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.price-tile strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.pricing-meta {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.free-quota-line {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #fff7e8;
  border: 1px solid #eed7ad;
  border-radius: 8px;
}

.free-quota-line.available {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.free-quota-line strong {
  color: var(--ink);
}

.free-quota-line span,
.free-quota-line small {
  color: var(--muted);
  line-height: 1.5;
}

.pricing-meta p {
  margin: 0;
  line-height: 1.6;
}

.pricing-meta a {
  width: fit-content;
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: none;
}

.pricing-meta a:hover {
  text-decoration: underline;
}

.model-source-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(280px, 0.65fr) minmax(360px, 1.35fr);
  gap: 18px;
}

.llm-history-panel {
  grid-column: 1 / -1;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.search-row.compact {
  margin-bottom: 16px;
}

.llm-call-history {
  display: grid;
  gap: 12px;
}

.llm-call-row {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
}

.llm-call-row.failed {
  border-left-color: var(--red);
}

.llm-call-row.blocked {
  border-left-color: var(--amber);
}

.llm-call-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.llm-call-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.llm-call-prompt,
.llm-call-response {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.llm-call-response {
  color: var(--ink);
}

.odoo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 30px;
  background: #0f4c81;
  color: white;
  border: 1px solid #2a7fb8;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.odoo-hero .eyebrow {
  color: #bae6fd;
}

.odoo-hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
}

.odoo-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.odoo-status-block {
  display: flex;
  min-width: 280px;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
}

.odoo-status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.18);
}

.odoo-status-block strong,
.odoo-status-block small {
  display: block;
}

.odoo-status-block small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.7);
}

.odoo-workspace {
  margin-top: 18px;
  padding: 26px 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.odoo-workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.odoo-workspace-heading h3 {
  margin: 0;
  font-size: 24px;
}

.odoo-stage-badge {
  padding: 7px 11px;
  color: #8c5d12;
  background: #fff7e8;
  border: 1px solid #f2d28e;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.odoo-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 8px 0 24px;
}

.odoo-flow article {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}

.odoo-flow article + article {
  border-left: 1px solid var(--line);
}

.odoo-flow article > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #0f6fae;
  background: #e8f5fd;
  border: 1px solid #b9ddf4;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.odoo-flow strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
}

.odoo-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.odoo-command-preview {
  display: grid;
  gap: 9px;
}

.odoo-command-preview > label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.odoo-command-preview > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.odoo-command-preview input {
  min-width: 0;
  height: 48px;
}

.odoo-command-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.mcp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.9fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--border);
  border-top: 4px solid #38a8e8;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.mcp-hero h1 {
  margin: 6px 0 12px;
  font-size: 38px;
  color: var(--ink);
}

.mcp-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.mcp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #c9e4f7;
  background: #f4faff;
}

.mcp-metrics article {
  min-width: 0;
  padding: 18px 14px;
  text-align: center;
}

.mcp-metrics article + article { border-left: 1px solid #c9e4f7; }
.mcp-metrics span,
.mcp-metrics strong { display: block; }

.mcp-metrics span {
  color: #12689e;
  font-size: 30px;
  font-weight: 800;
}

.mcp-metrics strong {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.mcp-directory-panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.mcp-directory-heading,
.mcp-server-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.mcp-directory-heading h3,
.mcp-server-head h4 { margin: 4px 0 0; }

.mcp-directory-actions,
.mcp-server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mcp-security-note {
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 3px solid #38a8e8;
  background: #f4faff;
  color: var(--muted);
  line-height: 1.6;
}

.mcp-search-box {
  width: min(520px, 100%);
  margin-top: 18px;
}

.mcp-server-list { display: grid; gap: 14px; }

.mcp-server-group {
  overflow: hidden;
  border: 1px solid #d2e5f3;
  background: #fbfdff;
}

.mcp-server-group + .mcp-server-group {
  margin-top: 0;
}

.mcp-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  list-style: none;
}

.mcp-group-heading::-webkit-details-marker { display: none; }

.mcp-group-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.mcp-group-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.mcp-group-heading > span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #c9e4f7;
  background: #f4faff;
  color: #12689e;
  font-size: 12px;
  font-weight: 800;
}

details.mcp-server-group > .mcp-group-heading {
  cursor: pointer;
}

details.mcp-server-group > .mcp-group-heading:hover {
  background: #f2f9fe;
}

details.mcp-server-group[open] > .mcp-group-heading {
  border-bottom: 1px solid #d2e5f3;
  background: #f4faff;
}

details.mcp-server-group > .mcp-group-heading::before {
  content: "+";
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  order: 3;
  border: 1px solid #c9e4f7;
  color: #12689e;
  font-size: 20px;
  font-weight: 700;
}

details.mcp-server-group[open] > .mcp-group-heading::before { content: "−"; }
.mcp-server-group-list {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #ffffff;
}

.mcp-server-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 4px solid #b7c9d6;
  background: #ffffff;
}

.mcp-server-card.connected { border-left-color: #16836f; }
.mcp-server-card.failed { border-left-color: #c34b4b; }
.mcp-server-card.unchecked { border-left-color: #d39627; }
.mcp-server-head > div:first-child { min-width: 0; }

.mcp-server-head h4 {
  color: var(--ink);
  font-size: 21px;
}

.mcp-server-head p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.mcp-status-badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #cbd8e2;
  background: #f2f6f9;
  color: #5d7180;
  font-size: 11px;
  font-weight: 800;
}

.mcp-status-badge.connected { border-color: #a9ddcf; background: #eef9f5; color: #116b59; }
.mcp-status-badge.failed { border-color: #efb9b9; background: #fff3f3; color: #a43a3a; }
.mcp-status-badge.unchecked { border-color: #ead19e; background: #fff9ec; color: #8d6417; }

.mcp-server-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e3edf4;
}

.mcp-server-meta span,
.mcp-server-meta b { display: block; min-width: 0; }

.mcp-server-meta span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.mcp-server-meta b {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
}

.mcp-endpoint-meta code {
  display: block;
  color: #12689e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mcp-endpoint-meta .text-action,
.mcp-source-link {
  display: inline-block;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f75b8;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.mcp-source-link { display: block; }
.mcp-endpoint-meta .text-action:hover,
.mcp-source-link:hover { text-decoration: underline; }

.mcp-server-meta .warning,
.mcp-server-error { color: #a43a3a; }

.mcp-server-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #efb9b9;
  background: #fff3f3;
}

.mcp-tool-catalog {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e3edf4;
}

.mcp-tool-catalog summary { cursor: pointer; color: #12689e; font-weight: 800; }

.mcp-tool-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mcp-tool-list article {
  padding: 12px;
  border: 1px solid #d9e8f2;
  background: #f8fbfd;
}

.mcp-tool-list strong,
.mcp-tool-list code { display: block; }
.mcp-tool-list code { margin-top: 4px; color: #12689e; }
.mcp-tool-list p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }

.mcp-server-modal {
  width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.mcp-server-form,
.mcp-server-form > label { display: grid; gap: 10px; }
.mcp-server-form { gap: 16px; }

.mcp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mcp-form-grid label { display: grid; gap: 8px; }
.mcp-enabled-field { align-content: center; margin-top: 23px; }

.line-admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 30px;
  background: #0f4c81;
  color: white;
  border: 1px solid #2a7fb8;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.line-admin-hero .eyebrow {
  color: #bae6fd;
}

.line-admin-hero h1 {
  margin-bottom: 10px;
  font-size: 34px;
}

.line-admin-hero p:last-child {
  max-width: 780px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.65;
}

.line-admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.line-admin-metrics article {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
}

.line-admin-metrics span {
  font-size: 27px;
  font-weight: 700;
}

.line-admin-metrics strong {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.line-admin-panel {
  margin-top: 18px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.line-admin-heading,
.line-group-header,
.line-group-reference,
.line-policy-switches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.line-admin-heading h3,
.line-group-header h4 {
  margin: 0;
}

.line-service-notice {
  margin: 18px 0;
  padding: 11px 13px;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0ea5e9;
  border-radius: 6px;
  background: #f0f9ff;
  color: #075985;
  font-size: 13px;
}

.line-service-notice.unavailable {
  background: #fff7ed;
  border-color: #fed7aa;
  border-left-color: #f59e0b;
  color: #9a3412;
}

.line-admin-list {
  display: grid;
  gap: 14px;
}

.line-group-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 7px;
  background: #f8fafc;
}

.line-group-card.approved {
  border-left-color: #0284c7;
  background: white;
}

.line-group-status {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.line-group-card.approved .line-group-status {
  background: #e0f2fe;
  color: #075985;
}

.line-group-meta,
.line-group-reference {
  color: var(--muted);
  font-size: 12px;
}

.line-group-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
}

.line-group-reference {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.line-policy-switches {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.line-policy-switches label {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #eff8ff;
  border: 1px solid #c7e6f8;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.line-policy-switches input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #0284c7;
}

.line-policy-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.5fr) minmax(150px, 0.5fr) minmax(170px, 0.55fr) auto;
  gap: 12px;
  align-items: end;
}

.line-policy-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.line-policy-grid button {
  white-space: nowrap;
}

.line-policy-hint {
  color: var(--muted);
}

.account-summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(430px, 0.65fr);
  gap: 28px;
  align-items: center;
  padding: 30px;
  background: var(--navy);
  color: white;
  border: 1px solid #2a7fb8;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.account-summary-band .eyebrow {
  color: #93c5fd;
}

.account-summary-band h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.16;
}

.account-summary-band p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.65;
}

.account-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.account-metrics article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.account-metrics span {
  font-size: 30px;
  font-weight: 700;
}

.account-metrics strong {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.account-create-panel,
.account-list-panel {
  margin-top: 18px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
}

.compact-heading h3 {
  margin-bottom: 16px;
}

.account-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 170px auto;
  gap: 12px;
  align-items: end;
}

.account-create-form label {
  display: grid;
  gap: 8px;
}

.account-create-form button {
  white-space: nowrap;
}

.account-create-panel .error-text {
  margin-top: 10px;
}

.account-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.account-table-head,
.account-row {
  min-width: 1080px;
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) 165px 130px minmax(245px, 1.2fr) 290px;
  gap: 16px;
  align-items: center;
}

.account-table-head {
  min-height: 44px;
  padding: 0 16px;
  background: #edf8ff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-row {
  min-height: 94px;
  padding: 14px 16px;
  background: white;
  border-top: 1px solid var(--line);
  border-left: 4px solid var(--teal);
}

.account-row.inactive {
  background: #f8fafc;
  border-left-color: #94a3b8;
}

.account-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  background: #e0f2fe;
  color: var(--teal-dark);
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.account-identity strong,
.account-identity small,
.account-activity strong,
.account-activity small {
  display: block;
  overflow-wrap: anywhere;
}

.account-identity small,
.account-activity small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.current-account-label {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  color: var(--teal-dark);
  background: #eff6ff;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.account-role-field select {
  height: 38px;
}

.account-status-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-status-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.account-status-control span {
  color: var(--ink);
}

.account-activity strong {
  font-size: 12px;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.account-actions button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.llm-call-prompt b,
.llm-call-response b {
  display: block;
  margin-bottom: 3px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}

.llm-usage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.llm-usage-grid.inline {
  margin-bottom: 12px;
}

.llm-usage-grid span {
  padding: 7px 9px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.llm-usage-grid b {
  margin-right: 5px;
  color: var(--ink);
}

.model-source-panel h3 {
  margin-bottom: 8px;
}

.model-source-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.provider-summary {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.provider-summary span {
  padding: 8px 10px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-panel {
  width: min(520px, 100%);
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-panel.compact {
  width: min(480px, 100%);
}

.modal-panel.custom-model-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
}

.custom-model-form,
.custom-model-fields {
  display: grid;
  gap: 14px;
}

.custom-model-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.custom-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.custom-model-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.custom-model-form .checkbox-field {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 48px;
}

.custom-model-form .checkbox-field input {
  width: 18px;
  height: 18px;
}

.custom-badge {
  padding: 4px 8px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: 999px;
  color: #075985;
  font-size: 11px;
  font-weight: 800;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.modal-copy {
  margin: 12px 0 18px;
  color: var(--muted);
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 150px;
}

.toast-host {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 14px 16px;
  background: #1f2937;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .hero-band,
  .split-layout,
  .upload-layout,
  .network-layout,
  .meeting-layout,
  .aiwork-layout,
  .model-setup-grid,
  .model-source-panel {
    grid-template-columns: 1fr;
  }

  .model-source-panel {
    grid-column: auto;
  }

  .line-admin-hero,
  .mcp-hero,
  .odoo-hero,
  .account-summary-band {
    grid-template-columns: 1fr;
  }

  .odoo-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .odoo-flow article:nth-child(3) {
    border-left: 0;
  }

  .line-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mcp-server-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nas-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .translation-form-grid {
    grid-template-columns: 1fr;
  }

  .module-grid,
  .metric-grid,
  .nas-feature-grid {
    grid-template-columns: 1fr;
  }

  .asset-meta-grid {
    grid-template-columns: 1fr;
  }

  .nas-storage-map {
    grid-template-columns: 1fr;
  }

  .dashboard-asset-row {
    grid-template-columns: 70px minmax(180px, 1fr) minmax(160px, 210px) 100px auto;
  }

  .dashboard-asset-open {
    display: none;
  }

  .dashboard-transcript-preview {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .workspace,
  .sidebar,
  .login-view {
    padding: 18px;
  }

  .login-panel {
    padding: 24px;
  }

  .dashboard-assets-head {
    display: grid;
  }

  .dashboard-assets-head .secondary-button {
    width: 100%;
  }

  .asset-filter-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .asset-filter-tabs button {
    flex: 0 0 auto;
  }

  .dashboard-asset-row {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .dashboard-asset-size {
    display: none;
  }

  .dashboard-asset-upload {
    grid-column: 2 / -1;
    grid-row: 2;
    padding-top: 8px;
    border-top: 1px solid #e2edf5;
  }

  .dashboard-transcript-preview {
    grid-template-columns: 1fr auto;
  }

  .dashboard-transcript-preview p {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .audio-playback-heading,
  .audio-segment-heading,
  .audio-segment-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .media-heading-actions,
  .segment-action-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .segment-media-control audio {
    min-width: 0;
  }

  .segment-transcription-status > div:first-child {
    display: grid;
  }

  .transcript-heading-actions,
  .segment-transcription-heading-actions {
    justify-content: flex-start;
  }

  .media-download-row .media-download-button {
    justify-self: start;
  }

  .audio-segment-heading p {
    text-align: left;
  }

  .topbar,
  .search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .user-box {
    flex-wrap: wrap;
  }

  .line-admin-hero,
  .line-admin-panel,
  .mcp-hero,
  .mcp-directory-panel,
  .odoo-hero,
  .odoo-workspace,
  .account-summary-band,
  .account-create-panel,
  .account-list-panel {
    padding: 20px;
  }

  .line-admin-hero h1,
  .mcp-hero h1,
  .odoo-hero h1,
  .account-summary-band h1 {
    font-size: 28px;
  }

  .odoo-status-block {
    min-width: 0;
  }

  .odoo-workspace-heading,
  .odoo-command-preview > div {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .odoo-workspace-heading {
    display: grid;
  }

  .odoo-stage-badge {
    width: max-content;
  }

  .odoo-flow {
    grid-template-columns: 1fr;
  }

  .odoo-flow article + article {
    border-left: 0;
  }

  .line-admin-metrics,
  .mcp-metrics,
  .line-policy-grid,
  .account-metrics,
  .account-create-form {
    grid-template-columns: 1fr;
  }

  .mcp-metrics article + article {
    border-left: 0;
    border-top: 1px solid #c9e4f7;
  }

  .mcp-directory-heading,
  .mcp-group-heading,
  .mcp-server-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mcp-directory-actions,
  .mcp-server-actions,
  .mcp-directory-actions button,
  .mcp-server-actions button {
    width: 100%;
  }

  .mcp-server-meta,
  .mcp-tool-list,
  .mcp-form-grid {
    grid-template-columns: 1fr;
  }

  .account-metrics article {
    min-height: 86px;
  }

  .line-admin-heading,
  .line-group-header {
    align-items: stretch;
    flex-direction: column;
  }

  .line-group-meta {
    justify-content: flex-start;
  }

  .line-policy-grid button {
    width: 100%;
  }

  .hero-band h1,
  .login-panel h1 {
    font-size: 30px;
  }

  .recorder-stage strong {
    font-size: 34px;
  }

  .price-grid {
    grid-template-columns: 1fr;
  }

  .pricing-header {
    flex-direction: column;
  }

  .model-manager-head,
  .local-model-title-line {
    align-items: stretch;
    flex-direction: column;
  }

  .model-manager-actions,
  .custom-model-grid {
    grid-template-columns: 1fr;
  }

  .model-manager-actions {
    display: grid;
  }

  .local-model-row {
    grid-template-columns: 1fr;
  }

  .local-model-actions {
    justify-content: stretch;
  }

  .local-model-actions button {
    width: 100%;
  }

  .asr-recommendation-head {
    display: grid;
  }

  .asr-readiness {
    max-width: none;
    text-align: left;
  }

  .asr-recommendation-meta {
    grid-template-columns: 1fr;
  }

  .config-panel-heading,
  .translation-recommendation > div,
  .meeting-text-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
