:root {
  --bg-0: #f4f8f7;
  --bg-1: #ffffff;
  --ink: #132f2b;
  --ink-soft: #3c5f58;
  --brand: #0f766e;
  --brand-2: #ea580c;
  --line: #d7e3e0;
  --ok: #166534;
  --warn: #9a3412;
  --error: #b91c1c;
  --shadow: 0 12px 40px rgba(18, 54, 50, 0.08);
}

html {
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 15% 10%, #dcfce7 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, #ffedd5 0%, transparent 38%),
    var(--bg-0);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", "Be Vietnam Pro", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

body,
button,
input,
select,
textarea,
option,
table,
thead,
tbody,
tfoot,
tr,
th,
td,
label,
a,
small {
  font-family: inherit;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.bg-shape-a {
  width: 320px;
  height: 320px;
  background: #14b8a6;
  top: -80px;
  right: -60px;
}

.bg-shape-b {
  width: 280px;
  height: 280px;
  background: #fb923c;
  bottom: -90px;
  left: -40px;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.hero {
  background: linear-gradient(120deg, #0f766e 0%, #155e75 60%, #0b4f46 100%);
  border-radius: 22px;
  padding: 22px 24px;
  color: #effffb;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.hero p {
  margin: 0;
  color: #d7fff3;
}

#subtitle {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  margin: 0;
  padding: 0;
  color: #f6fffc;
  font-size: clamp(28px, 4.8vw, 46px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 10px 24px rgba(4, 35, 31, 0.28);
}

.hero-time-context {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #effffb;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px rgba(4, 35, 31, 0.16);
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: min(100%, 720px);
  margin-left: auto;
}

.toolbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
}

.toolbar-actions > * {
  flex-shrink: 0;
}

.toolbar-nav-group {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(4, 18, 24, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.toolbar-nav-group > * + * {
  margin-left: 2px;
}

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

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.control-group-full {
  grid-column: 1 / -1;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  background: transparent;
  color: #effffb;
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: none;
  box-shadow: none;
}

.header-account {
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  min-height: 40px;
  padding: 6px 8px 6px 12px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: #effffb;
  box-shadow: none;
}

.header-account-text {
  min-width: 0;
}

.header-account-label {
  font-size: 11px;
  line-height: 1.1;
  color: #cffcf0;
}

.header-account-email {
  font-size: 13px;
  font-weight: 600;
  color: #f6fffc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-auth-card {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.header-auth-card h2 {
  display: none;
}

.header-auth-card input {
  background: #ffffff;
  padding: 8px 10px;
}

.header-account button {
  width: auto;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.control-label {
  font-size: 12px;
  color: #cffcf0;
  font-weight: 600;
  padding-left: 2px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.card.hidden-card {
  display: none;
}

body[data-workspace-view="home"] #template-studio-card,
body[data-workspace-view="review"] #template-studio-card,
body[data-workspace-view="supplement"] #template-studio-card {
  display: none !important;
}

.card.wide {
  grid-column: 1 / -1;
}

.home-entry-card {
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 249, 247, 0.98) 100%);
}

.home-entry-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.home-entry-copy {
  display: grid;
  gap: 10px;
}

.home-entry-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.12);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-entry-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.home-entry-body {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.home-entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.workspace-nav-card {
  padding: 18px 20px;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 250, 248, 0.98) 100%);
}

.workspace-nav-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.workspace-nav-copy {
  display: grid;
  gap: 6px;
}

.workspace-nav-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.workspace-nav-title {
  margin: 0;
}

.workspace-nav-meta {
  max-width: 760px;
  white-space: pre-wrap;
}

.workspace-nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.grid > #workspace-nav-card {
  order: 5;
}

.grid > #home-entry-card {
  order: 8;
}

.grid > #chat-card {
  order: 10;
}

.grid > #case-workflow-card {
  order: 25;
}

.grid > #template-studio-card {
  order: 20;
}

.grid > #documents-card {
  order: 30;
}

.grid > #field-card {
  order: 35;
}

.grid > #review-card {
  order: 40;
}

.grid > #broker-chat-card {
  order: 50;
}

.grid > #collaboration-info-card {
  order: 60;
}

.grid > #submission-card {
  order: 80;
}

h2 {
  margin: 0 0 12px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  margin: 14px 0 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-soft);
}

textarea,
input,
select,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 9px 10px;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

button {
  cursor: pointer;
  background: linear-gradient(120deg, var(--brand) 0%, #0f9d8f 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.22);
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.inline label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.inline label input {
  width: auto;
}

.auth-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.auth-tabs button {
  width: auto;
  min-width: 76px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  background: transparent;
  color: #effffb;
  box-shadow: none;
}

.auth-tabs button.active {
  background: rgba(27, 158, 146, 0.95);
  color: #fff;
}

.header-auth-card .secondary-button {
  background: transparent;
  color: #effffb;
}

.header-auth-card .secondary-button:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.06);
}

.header-auth-card.auth-open .auth-tabs button:not(.active) {
  color: #d6fff5;
}

.toolbar-nav-group .admin-link:hover,
.toolbar-nav-group .header-account button:hover,
.toolbar-nav-group .auth-tabs button:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.06);
}

#auth-form-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(248, 252, 251, 0.98);
  border: 1px solid rgba(197, 227, 221, 0.9);
  box-shadow: 0 18px 40px rgba(4, 35, 31, 0.18);
  z-index: 12;
}

#auth-form-panel .inline {
  margin: 10px 0 0;
  gap: 8px;
}

#auth-form-panel .meta {
  color: var(--ink-soft);
}

#auth-form-panel .upload-status {
  background: #ffffff;
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 12px;
}

#auth-form-panel button {
  min-height: 40px;
}

.meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 10px;
  line-height: 1.4;
}

.upload-status {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.upload-status.show {
  display: block;
}

.upload-status.success {
  border-color: #86efac;
  background: #f0fdf4;
  color: var(--ok);
}

.upload-status.error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: var(--error);
}

.upload-status.info {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.doc-row {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.doc-row input {
  margin-bottom: 8px;
}

.uploaded-doc {
  background: #fcfffe;
  border-style: solid;
}

.uploaded-doc input[readonly] {
  background: #f8fafc;
  color: var(--ink);
}

.uploaded-doc-structured {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.uploaded-doc-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uploaded-doc-field-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1f3b67;
  font-size: 12px;
  line-height: 1.4;
}

.danger-button {
  width: auto;
  background: linear-gradient(120deg, #b91c1c 0%, #dc2626 100%);
}

.secondary-button {
  width: auto;
  background: #e5e7eb;
  color: var(--ink);
}

.doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.doc-select {
  width: auto;
  margin-right: 8px;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.confirm-modal.hidden {
  display: none;
}

body.live-video-open {
  overflow: hidden;
}

.confirm-card {
  width: min(100%, 460px);
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.confirm-card p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.chat-log {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-height: 320px;
  max-height: 520px;
  overflow: auto;
  margin-bottom: 10px;
  background: #fcfffe;
}

.chat-item {
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
}

.chat-item.user {
  background: #ecfdf5;
}

.chat-item.assistant {
  background: #fff7ed;
}

.chat-item.system {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.chat-item.pending {
  opacity: 0.72;
  border: 1px dashed rgba(148, 163, 184, 0.5);
}

.chat-item-time {
  margin-top: 8px;
  font-size: 12px;
}

.chat-composer-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chat-composer-actions button {
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.chat-file-stack {
  display: grid;
  gap: 8px;
  min-width: 170px;
  max-width: 220px;
  flex: 0 0 210px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfa;
}

.chat-file-stack input[type="file"] {
  width: 100%;
  min-width: 0;
}

.chat-file-stack .chat-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  min-height: 0;
}

.chat-file-stack .chat-chip {
  width: 100%;
  min-height: 0;
  justify-content: space-between;
  padding: 6px 8px;
  gap: 8px;
  border-radius: 10px;
}

.chat-file-stack .chat-chip span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-composer-actions #chat-btn {
  min-width: 150px;
}

.broker-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.broker-chat-refresh {
  width: auto;
  white-space: nowrap;
}

.broker-chat-context {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92));
  display: grid;
  gap: 4px;
}

.broker-chat-context.hidden {
  display: none;
}

.broker-chat-context-primary {
  font-weight: 700;
  color: var(--ink);
}

.broker-chat-context-secondary {
  color: var(--muted);
  font-size: 13px;
}

.broker-chat-log {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
  background: linear-gradient(180deg, #fcfffe 0%, #f5fbfa 100%);
}

.broker-chat-item {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.broker-chat-item:last-child {
  margin-bottom: 0;
}

.broker-chat-item-broker,
.broker-chat-item-cn_export_broker,
.broker-chat-item-vn_import_broker {
  border-left: 4px solid var(--brand);
}

.broker-chat-item-customer {
  border-left: 4px solid #2563eb;
}

.broker-chat-item-operator,
.broker-chat-item-system {
  border-left: 4px solid #64748b;
  background: #f8fafc;
}

.broker-chat-item-ai,
.broker-chat-item-ai_assistant {
  border-left: 4px solid var(--brand-2);
  background: #fff7ed;
}

.broker-chat-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.broker-chat-item-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.submission-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.submission-status-strip {
  display: flex;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.submission-state-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(20, 140, 131, 0.12);
  color: #155e63;
  font-weight: 700;
}

.submission-preview-card {
  border: 1px solid rgba(20, 140, 131, 0.14);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.68);
}

.submission-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
}

.submission-feedback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.submission-feedback-card {
  border: 1px dashed rgba(15, 118, 110, 0.2);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: rgba(243, 252, 251, 0.85);
}

.submission-feedback-card ul {
  margin: 0.65rem 0 0;
  padding-left: 1rem;
}

.submission-actions {
  margin-top: 1rem;
}

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

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  max-width: 100%;
}

.file-picker-wide {
  width: 100%;
  justify-content: flex-start;
  box-sizing: border-box;
}

.file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.file-picker-name {
  color: var(--muted);
  word-break: break-word;
}

.file-picker-note {
  margin-top: 0.45rem;
}

.broker-chat-composer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.broker-chat-actions {
  display: flex;
  justify-content: flex-end;
}

.broker-chat-actions button {
  width: auto;
  min-width: 190px;
}

.collaboration-info-card {
  padding: 14px;
  background: linear-gradient(180deg, rgba(250, 253, 252, 0.98) 0%, rgba(244, 250, 248, 0.98) 100%);
  box-shadow: 0 8px 24px rgba(18, 54, 50, 0.05);
}

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

.collaboration-info-block .detail-section {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 118, 110, 0.1);
}

.collaboration-info-block .detail-section h3 {
  font-size: 13px;
  color: var(--ink-soft);
}

.chat-utility-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.chat-side-stack,
.chat-control-stack {
  display: grid;
  gap: 12px;
}

.call-status-panel {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(234, 88, 12, 0.08));
}

.call-status-title {
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}

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

.call-status-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.call-status-label {
  font-size: 12px;
  color: var(--ink-soft);
}

.call-status-item strong {
  font-size: 14px;
}

.call-status-panel[data-live-state="active"] {
  border-color: rgba(22, 163, 74, 0.28);
}

.call-status-panel[data-live-state="connecting"] {
  border-color: rgba(37, 99, 235, 0.28);
}

.call-status-panel[data-live-state="error"] {
  border-color: rgba(220, 38, 38, 0.3);
}

.call-timeline {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.7), rgba(255, 255, 255, 0.9));
}

.call-timeline-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1d4ed8;
  margin-bottom: 10px;
}

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

.call-timeline-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(191, 219, 254, 0.9);
}

.call-timeline-item strong {
  font-size: 13px;
}

.call-timeline-item.system strong {
  color: #1d4ed8;
}

.call-timeline-item.user strong {
  color: #0f766e;
}

.call-timeline-item.assistant strong {
  color: #c2410c;
}

.call-timeline-time {
  font-size: 12px;
  color: var(--ink-soft);
}

.chat-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.chat-control-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 250, 249, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.chat-control-section {
  display: grid;
  gap: 10px;
}

.chat-control-section + .chat-control-section {
  padding-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
}

.chat-control-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.chat-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chat-control-row .secondary-button {
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  background: #eef2f3;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.chat-control-row .secondary-button:hover {
  background: #e2e8f0;
}

.chat-file-row input[type="file"] {
  width: 100%;
}

.chat-control-row-secondary {
  padding-top: 2px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f4f6;
}

.toggle input {
  width: auto;
}

.chat-media-preview {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  display: none;
}

.chat-media-preview.hidden {
  display: none;
}

#chat-video-preview {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.live-video-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(6, 12, 20, 0.94);
}

.live-video-modal.hidden {
  display: none;
}

.live-video-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(15, 118, 110, 0.18), transparent 38%),
    linear-gradient(180deg, #081018 0%, #05090f 100%);
}

.live-video-shell[data-facing="front"] video {
  transform: scaleX(-1);
}

.live-video-shell[data-mode="call"] #live-video-modal-preview {
  filter: brightness(0.94) contrast(1.04) saturate(1.02);
  transform: none;
}

#live-video-modal-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #04070d;
}

.live-video-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 24%, transparent 70%, rgba(0, 0, 0, 0.18));
}

.ai-visual-card {
  position: absolute;
  top: max(18px, calc(env(safe-area-inset-top, 0px) + 8px));
  right: 18px;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: clamp(156px, 28vw, 210px);
  min-height: 0;
  padding: 14px 12px 12px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(7, 12, 20, 0.76) 0%, rgba(11, 18, 29, 0.58) 100%),
    radial-gradient(circle at 20% 20%, rgba(45, 212, 191, 0.1), transparent 36%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
  transform: none;
  pointer-events: none;
}

.ai-visual-orbit {
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 25%, rgba(250, 204, 21, 0.18), transparent 34%),
    radial-gradient(circle at 75% 78%, rgba(45, 212, 191, 0.14), transparent 38%);
  opacity: 0.9;
  pointer-events: none;
}

.ai-visual-avatar {
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 4px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.14) 24%, transparent 25%),
    linear-gradient(145deg, #14b8a6 0%, #0f766e 45%, #1d4ed8 100%);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.ai-visual-face {
  position: absolute;
  top: 32px;
  left: 50%;
  display: flex;
  gap: 18px;
  transform: translateX(-50%);
}

.ai-visual-eye {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #effffb;
  box-shadow: 0 0 10px rgba(239, 255, 251, 0.6);
}

.ai-visual-mouth {
  position: absolute;
  bottom: 28px;
  left: 50%;
  width: 36px;
  height: 14px;
  border: 3px solid rgba(239, 255, 251, 0.95);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom-left-radius: 999px;
  border-bottom-right-radius: 999px;
  transform: translateX(-50%);
}

.ai-visual-wave {
  position: absolute;
  inset: auto 22px 16px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  height: 18px;
}

.ai-visual-wave span {
  width: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(239, 255, 251, 0.9);
  opacity: 0.55;
  transform-origin: bottom center;
}

.ai-visual-meta {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  text-align: center;
  color: #f8fffd;
}

.ai-visual-meta strong {
  font-size: 15px;
}

.ai-visual-meta span {
  font-size: 11px;
  color: rgba(240, 255, 252, 0.84);
}

.ai-visual-caption {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(246, 255, 252, 0.96);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.ai-visual-card[data-ai-visual-state="connecting"] .ai-visual-avatar {
  animation: ai-avatar-float 2.4s ease-in-out infinite;
}

.ai-visual-card[data-ai-visual-state="connecting"] .ai-visual-wave span:nth-child(1),
.ai-visual-card[data-ai-visual-state="connecting"] .ai-visual-wave span:nth-child(3) {
  animation: ai-wave 1.1s ease-in-out infinite;
}

.ai-visual-card[data-ai-visual-state="connecting"] .ai-visual-wave span:nth-child(2),
.ai-visual-card[data-ai-visual-state="connecting"] .ai-visual-wave span:nth-child(4) {
  animation: ai-wave 1.1s ease-in-out 0.18s infinite;
}

.ai-visual-card[data-ai-visual-state="listening"] .ai-visual-avatar {
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.08),
    0 0 0 16px rgba(20, 184, 166, 0.12),
    0 14px 28px rgba(0, 0, 0, 0.22);
}

.ai-visual-card[data-ai-visual-state="speaking"] .ai-visual-avatar {
  animation: ai-avatar-float 1.2s ease-in-out infinite;
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.12),
    0 0 0 18px rgba(96, 165, 250, 0.18),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.ai-visual-card[data-ai-visual-state="speaking"] .ai-visual-wave span:nth-child(1) {
  animation: ai-wave 0.55s ease-in-out infinite;
}

.ai-visual-card[data-ai-visual-state="speaking"] .ai-visual-wave span:nth-child(2) {
  animation: ai-wave 0.55s ease-in-out 0.1s infinite;
}

.ai-visual-card[data-ai-visual-state="speaking"] .ai-visual-wave span:nth-child(3) {
  animation: ai-wave 0.55s ease-in-out 0.18s infinite;
}

.ai-visual-card[data-ai-visual-state="speaking"] .ai-visual-wave span:nth-child(4) {
  animation: ai-wave 0.55s ease-in-out 0.26s infinite;
}

.ai-visual-card[data-ai-visual-state="ready"] .ai-visual-wave span {
  opacity: 0.75;
}

@keyframes ai-wave {
  0%, 100% {
    height: 12px;
    opacity: 0.5;
  }
  50% {
    height: 34px;
    opacity: 1;
  }
}

@keyframes ai-avatar-float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

.live-video-status-pill {
  position: absolute;
  top: 18px;
  left: 18px;
  right: auto;
  display: grid;
  gap: 4px;
  width: min(52vw, 320px);
  max-width: calc(100% - 226px);
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  color: #f8fffd;
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

.live-video-status-pill strong {
  font-size: 15px;
}

.live-video-status-pill span {
  font-size: 12px;
  color: rgba(240, 255, 252, 0.84);
}

#live-video-modal-note {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(240, 255, 252, 0.92);
  max-width: 100%;
}

.live-video-actions {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: max(24px, env(safe-area-inset-bottom, 0px) + 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.live-video-action {
  width: auto;
  min-width: 132px;
  min-height: 58px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.22);
}

.live-video-action-secondary {
  background: rgba(255, 255, 255, 0.92);
  color: #10221e;
}

.live-video-action-secondary:hover {
  background: #ffffff;
}

.live-video-action-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.chat-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ecfeff;
  border: 1px solid #bae6fd;
  font-size: 13px;
}

.chat-chip button {
  min-height: 0;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.chat-chip button:hover {
  transform: none;
  box-shadow: none;
  background: #e2e8f0;
}

.chat-attachments,
.chat-deliverables,
.chat-sources {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.chat-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-latest-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chat-asset {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

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

.chat-request-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 118, 110, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.chat-request-card-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.chat-request-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chat-request-card-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.chat-request-card-docs,
.chat-request-card-note {
  margin-top: 10px;
}

.chat-request-card-note {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-asset a {
  color: var(--brand);
  font-weight: 600;
}

.chat-inline-image-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.chat-inline-image-link {
  display: inline-block;
}

.chat-inline-image-button {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
}

.chat-inline-image-button:hover {
  transform: none;
  box-shadow: none;
}

.chat-inline-image {
  display: block;
  max-width: min(100%, 320px);
  max-height: 220px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  object-fit: contain;
}

.chat-asset-links {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  margin-top: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.chat-asset-links a,
.chat-asset-links button,
.chat-asset-link-sep {
  flex: 0 0 auto;
}

.chat-asset-preview-button {
  width: auto;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  box-shadow: none;
  white-space: nowrap;
}

.chat-asset-preview-button:hover {
  transform: none;
  box-shadow: none;
  text-decoration: underline;
}

.chat-source-link {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--ink);
  text-decoration: none;
}

.chat-source-card {
  display: grid;
  gap: 8px;
}

.chat-source-link span {
  font-size: 12px;
  color: rgba(15, 23, 42, 0.65);
}

.chat-source-badge {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.82);
  padding: 24px;
}

.image-lightbox.hidden {
  display: none;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: zoom-out;
}

.image-lightbox-backdrop:hover {
  transform: none;
  box-shadow: none;
}

.image-lightbox-toolbar {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
}

.image-lightbox-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.image-lightbox-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: min(100%, 1320px);
}

.image-lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  box-shadow: none;
}

.image-lightbox-nav:hover {
  transform: none;
  box-shadow: none;
  background: rgba(15, 23, 42, 0.9);
}

.image-lightbox-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.image-lightbox img {
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  border-radius: 18px;
  object-fit: contain;
  background: #fff;
  cursor: zoom-out;
}

body.image-lightbox-open {
  overflow: hidden;
}

.file-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1190;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.file-preview-modal.hidden {
  display: none;
}

.file-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: none;
}

.file-preview-backdrop:hover {
  transform: none;
  box-shadow: none;
}

.file-preview-card {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(88vh, 900px);
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-preview-frame {
  width: 100%;
  min-height: min(72vh, 760px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: #f8fafc;
}

.file-preview-body {
  overflow: auto;
  max-height: min(72vh, 760px);
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: #f8fafc;
}

.file-preview-body h2,
.file-preview-body h3,
.file-preview-body p {
  margin: 0 0 10px;
}

.file-preview-body h2 {
  font-size: 24px;
}

.file-preview-body h3 {
  font-size: 18px;
  color: #0f172a;
}

.file-preview-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: #0f172a;
}

.file-preview-spacer {
  height: 8px;
}

.file-preview-image-shell {
  display: grid;
  place-items: center;
  min-height: min(72vh, 760px);
}

.file-preview-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(68vh, 720px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.file-preview-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.file-preview-fallback {
  display: grid;
  gap: 14px;
  align-content: center;
  min-height: min(72vh, 760px);
}

.file-preview-fallback.download-only {
  align-content: start;
  min-height: 180px;
}

.file-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.file-preview-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .image-lightbox {
    padding: 16px;
  }

  .image-lightbox-stage {
    gap: 8px;
  }

  .image-lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 28px;
    flex: 0 0 auto;
  }

  .image-lightbox img {
    max-width: calc(100vw - 96px);
    max-height: 82vh;
  }

  .file-preview-modal {
    padding: 14px;
  }

  .file-preview-card {
    padding: 14px;
    max-height: 90vh;
  }

  .file-preview-frame,
  .file-preview-body {
    min-height: 68vh;
    max-height: 68vh;
  }

  .file-preview-actions {
    flex-direction: column;
  }
}

.chat-asset-link-sep {
  color: rgba(15, 23, 42, 0.45);
}

.list {
  margin-top: 12px;
  font-size: 14px;
}

.case-workflow-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.case-prep-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fcfffe 0%, #f4fbf9 100%);
}

.case-prep-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.case-prep-body {
  color: var(--ink-soft);
  white-space: pre-wrap;
  line-height: 1.6;
}

.case-scenario-intro {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

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

.case-scenario-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.case-scenario-card:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.case-scenario-card.is-active {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #eefaf7 100%);
}

.case-scenario-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.case-scenario-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.case-scenario-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
}

.case-scenario-card-body {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.case-step-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.92);
}

.case-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.case-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.case-step-next {
  font-size: 13px;
  color: #0f766e;
  font-weight: 600;
}

.case-step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.case-step-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.case-step-item.is-current {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.08);
}

.case-step-item.is-completed {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.case-step-order {
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-step-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.case-step-status {
  font-size: 12px;
  color: var(--ink-soft);
}

.case-step-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.case-step-actions button {
  width: auto;
  min-width: 180px;
}

.wizard-step-card-copy {
  display: grid;
  gap: 8px;
}

.wizard-step-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.wizard-step-card-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}

.wizard-step-card-next {
  font-size: 13px;
  line-height: 1.6;
}

.wizard-step-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.wizard-step-card-actions button {
  width: auto;
  min-width: 180px;
}

.case-section-note {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.case-prep-task-list {
  display: grid;
  gap: 10px;
}

.case-prep-task-list.hidden {
  display: none;
}

.case-prep-task-list-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-prep-task-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.case-prep-task-card {
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  padding: 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}

.case-prep-task-card.is-selected {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #eefaf7 100%);
}

.case-prep-task-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.case-prep-task-card-meta {
  font-size: 12px;
  color: var(--ink-soft);
}

.case-prep-task-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.case-prep-task-card-actions button {
  width: auto;
  min-width: 0;
}

.case-prep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.case-prep-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.case-prep-item-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.case-prep-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.case-prep-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.case-prep-actions button {
  width: auto;
  min-width: 180px;
}

.auto-case-banner {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.auto-case-banner.hidden {
  display: none;
}

.auto-case-banner-title {
  font-weight: 700;
}

.auto-case-banner-meta {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.case-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fcfffe;
}

.case-list-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.case-list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-filter-chip {
  width: auto;
  min-width: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.case-filter-chip:hover {
  border-color: rgba(15, 118, 110, 0.34);
  color: var(--ink);
}

.case-filter-chip.is-active {
  border-color: rgba(15, 118, 110, 0.55);
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(221, 247, 239, 0.98));
  color: var(--ink);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.08);
}

.case-filter-chip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.case-list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.case-list-pagination-meta {
  min-width: 92px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

.case-item-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.case-item.is-selected {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.92), rgba(252, 255, 254, 0.98));
}

.case-item-title {
  font-size: 15px;
  margin-bottom: 4px;
}

.case-item-code {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.case-item-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.case-item-meta {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  background: rgba(248, 251, 250, 0.9);
}

.case-item-meta span {
  font-size: 11px;
  color: var(--ink-soft);
}

.case-item-meta strong {
  font-size: 13px;
}

.case-item button {
  margin-top: 8px;
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
}

.case-item-details.is-collapsed {
  display: none;
}

.case-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.case-item-actions button {
  margin-top: 0;
}

#active-case-actions {
  display: none;
}

.issue {
  border-left: 4px solid var(--line);
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.issue.error {
  border-left-color: var(--error);
}

.issue.warning {
  border-left-color: var(--warn);
}

.issue.info {
  border-left-color: var(--ok);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

th {
  background: #f0fdfa;
  font-weight: 600;
}

input::placeholder,
textarea::placeholder,
select {
  font-family: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #7a8f8a;
  opacity: 1;
}

input[type="file"] {
  font-family: inherit;
  font-size: 13px;
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
}

.table-sort-button {
  width: auto;
  padding: 0;
  background: transparent;
  color: inherit;
  border: none;
  box-shadow: none;
  font-weight: 600;
}

.table-sort-button:hover {
  transform: none;
  box-shadow: none;
}

.muted {
  color: #6b7280;
}

.template-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.template-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: min(100%, 460px);
}

.template-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.template-language-switcher {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-studio-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(320px, 1.1fr) minmax(280px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.template-sidebar,
.template-form-panel,
.template-inspector-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fcfffe 0%, #f8fbfa 100%);
}

.template-sidebar {
  padding: 12px;
}

.template-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-sidebar-item {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.template-sidebar-item.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
}

.template-sidebar-item:hover {
  transform: translateY(-1px);
}

.template-sidebar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.template-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.template-status-badge.ready {
  background: #dcfce7;
  color: var(--ok);
}

.template-status-badge.missing_required {
  background: #fee2e2;
  color: var(--error);
}

.template-status-badge.generated {
  background: #dbeafe;
  color: #1d4ed8;
}

.template-status-badge.cloned {
  background: #ede9fe;
  color: #6d28d9;
}

.template-form-panel {
  padding: 14px;
}

.template-form-alert {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
}

.template-studio-mode-note {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(18, 136, 127, 0.08);
  color: #0d5d55;
  font-size: 0.94rem;
  line-height: 1.5;
}

.template-form-scroll {
  max-height: 860px;
  overflow: auto;
  padding-right: 4px;
}

.template-form-section + .template-form-section {
  margin-top: 18px;
}

.template-panel-title,
.template-form-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

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

.template-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.template-field-row.missing {
  border-color: #fca5a5;
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.08);
}

.template-field-row.edited {
  border-color: rgba(15, 118, 110, 0.35);
}

.template-field-row.recognized-pending {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(255, 251, 235, 0.82);
}

.template-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.template-field-label span:last-child {
  font-size: 11px;
  font-weight: 600;
}

.template-field-row input,
.template-field-row textarea {
  margin: 0;
  background: #f9fbfb;
}

.template-line-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.template-line-table td,
.template-line-table th {
  padding: 8px;
  font-size: 13px;
}

.template-inspector {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.template-inspector-card {
  padding: 14px;
}

.master-facts-grid {
  display: grid;
  gap: 10px;
}

.master-fact-item {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.master-fact-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.master-fact-value {
  margin-top: 4px;
  font-size: 14px;
}

.master-fact-confidence {
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
}

.template-preview-shell {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(15, 118, 110, 0.28);
  background: #ffffff;
}

.template-preview-shell h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.template-preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.template-preview-meta-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4f8f7;
  border: 1px solid var(--line);
}

.template-preview-meta-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

.template-preview-meta-value {
  margin-top: 4px;
  font-size: 13px;
}

.template-preview-signoff {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-preview-signoff > div {
  min-height: 72px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: #fbfffe;
}

.template-empty-state {
  padding: 18px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #fbfffe;
  color: #64748b;
  font-size: 13px;
}

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

.stat-card {
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
  border: 1px solid var(--line);
}

.stat-card strong {
  display: block;
  font-size: 28px;
  margin-top: 6px;
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--ink);
  font-size: 13px;
  border: 1px solid #cceee4;
}

.pill-button {
  width: auto;
  border: 1px solid #cceee4;
  background: #ecfdf5;
  color: var(--ink);
  box-shadow: none;
  padding: 6px 10px;
  font-weight: 500;
}

.pill-button:hover {
  transform: none;
  box-shadow: none;
}

.pill-button.active {
  background: linear-gradient(120deg, var(--brand) 0%, #0f9d8f 100%);
  color: #fff;
  border-color: transparent;
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fcfffe;
  min-height: 220px;
}

.code-block {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 13px;
}

#admin-action-status {
  margin-top: 12px;
}

.detail-content {
  display: grid;
  gap: 12px;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink);
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-section-header h3 {
  margin: 0;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-actions button {
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
}

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

.detail-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.detail-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.detail-value {
  word-break: break-word;
  font-size: 13px;
}

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

.detail-card {
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.detail-card.error {
  border-color: #fca5a5;
  background: #fef2f2;
  box-shadow: inset 3px 0 0 0 var(--error);
}

.detail-card.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  box-shadow: inset 3px 0 0 0 var(--warn);
}

.detail-card.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 0 #2563eb;
}

.detail-card-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.review-issue-section-title {
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.detail-card-meta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.detail-card-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 12px;
}

.review-issue-readable-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

.review-technical-details {
  margin-top: 10px;
}

.review-technical-details summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

.review-technical-details[open] summary {
  margin-bottom: 8px;
}

.detail-card .detail-grid,
.detail-card .detail-actions,
.detail-card .pill-list,
.detail-card .detail-item,
.detail-card .review-technical-details {
  margin-top: 10px;
}

button.button-loading {
  opacity: 0.78;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button.button-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.table-controls {
  justify-content: flex-end;
}

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

  .home-entry-shell {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-entry-actions {
    width: 100%;
  }

  .home-entry-actions button {
    width: 100%;
  }

  .workspace-nav-main {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-nav-actions {
    justify-content: stretch;
  }

  .chat-log {
    min-height: 280px;
    max-height: 460px;
  }

  .chat-utility-grid {
    grid-template-columns: 1fr;
  }

  .call-status-grid,
  .ops-grid,
  .split,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    width: 100%;
    margin-left: 0;
  }

  .toolbar-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .toolbar-nav-group {
    min-width: max-content;
  }

  .header-auth-card {
    flex: 0 0 auto;
  }

  .broker-chat-header {
    flex-direction: column;
    align-items: stretch;
  }

  .broker-chat-refresh,
  .broker-chat-actions button {
    width: 100%;
  }

  .collaboration-info-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .case-item-meta-grid {
    grid-template-columns: 1fr;
  }

  .chat-log {
    min-height: 240px;
    max-height: 380px;
  }

  .chat-composer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chat-composer-actions button,
  .chat-file-stack,
  .chat-composer-actions #chat-btn {
    width: 100%;
    min-width: 0;
  }

  .chat-control-card {
    padding: 12px;
  }

  .chat-control-row,
  .chat-control-row .toggle {
    width: 100%;
  }

  .chat-control-row .secondary-button,
  .chat-control-row .toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    padding: 18px;
  }

  #subtitle {
    font-size: clamp(24px, 8vw, 34px);
  }

  .hero-time-context {
    margin-top: 10px;
    padding: 6px 10px;
    font-size: 12px;
  }

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

  .control-group-full {
    grid-column: auto;
  }

  .header-account {
    align-items: stretch;
    border-radius: 16px;
    flex-direction: column;
    max-width: none;
  }

  .header-account-email {
    white-space: normal;
    word-break: break-word;
  }

  .header-auth-card {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
    flex: 1 1 auto;
  }

  .auth-tabs button {
    width: 100%;
    min-width: 0;
    padding: 7px 12px;
    font-size: 13px;
  }

  .toolbar-nav-group {
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  #auth-form-panel {
    position: static;
    left: auto;
    right: auto;
    width: 100%;
    margin-top: 10px;
    box-sizing: border-box;
  }

  .toolbar-actions {
    justify-content: flex-start;
    overflow: visible;
  }

  .toolbar-actions > * {
    width: 100%;
  }

  .live-video-status-pill {
    top: 14px;
    left: 14px;
    right: auto;
    width: min(50vw, 220px);
    max-width: calc(100% - 184px);
  }

  .ai-visual-card {
    top: max(14px, calc(env(safe-area-inset-top, 0px) + 6px));
    right: 14px;
    width: clamp(136px, 36vw, 170px);
    padding: 10px;
    border-radius: 20px;
  }

  .ai-visual-avatar {
    width: 76px;
    height: 76px;
    margin-top: 2px;
  }

  .ai-visual-face {
    top: 25px;
    gap: 14px;
  }

  .ai-visual-eye {
    width: 8px;
    height: 8px;
  }

  .ai-visual-mouth {
    bottom: 22px;
    width: 30px;
    height: 11px;
    border-width: 3px;
  }

  .ai-visual-wave {
    inset: auto 18px 12px;
    gap: 4px;
    height: 15px;
  }

  .ai-visual-wave span {
    width: 5px;
  }

  .ai-visual-meta strong {
    font-size: 14px;
  }

  .ai-visual-caption {
    font-size: 10.5px;
    padding: 6px 8px;
    border-radius: 12px;
  }

  .live-video-actions {
    left: 14px;
    right: 14px;
    gap: 12px;
  }

  .live-video-action {
    min-width: 0;
    flex: 1 1 0;
    min-height: 54px;
    padding: 0 14px;
    font-size: 14px;
  }

  .admin-link {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0 12px;
  }

  #auth-form-panel .inline {
    display: grid;
    grid-template-columns: 1fr;
  }

  #auth-form-panel {
    flex-basis: 100%;
  }

  #auth-form-panel input,
  #auth-form-panel button {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 1080px) {
  .template-studio-layout {
    grid-template-columns: 1fr;
  }

  .template-toolbar {
    min-width: 100%;
    align-items: stretch;
  }

  .template-toolbar-actions {
    justify-content: stretch;
  }

  .template-toolbar-actions button {
    flex: 1 1 160px;
  }

  .template-field-grid,
  .template-preview-meta,
  .template-preview-signoff {
    grid-template-columns: 1fr;
  }
}
