:root {
  --bg: #f5efe3;
  --panel: rgba(255, 251, 245, 0.92);
  --panel-strong: #fffdfa;
  --ink: #201914;
  --muted: #6e6259;
  --line: rgba(32, 25, 20, 0.12);
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --success: #0f766e;
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.12);
  --shadow: 0 24px 60px rgba(64, 50, 38, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 24%),
    linear-gradient(180deg, #f9f5ed, #efe6d8 62%, #eadfce);
}

.app-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

body.login-mode .app-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
}

body.login-mode .sidebar {
  display: none;
}

body.login-mode .workspace {
  width: min(520px, 100%);
}

body.login-mode .login-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
}

body.login-mode .login-card::before {
  content: "";
  position: absolute;
  inset: -45% -35% auto auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.22), transparent 68%);
  pointer-events: none;
}

.login-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}

.login-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  font-weight: 800;
}

.sidebar,
.card {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.workspace,
.app-content {
  display: grid;
  gap: 20px;
}

.card {
  padding: 24px;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.brand h1,
.panel-head h2,
.subpanel h3 {
  margin: 6px 0 0;
}

.muted,
.label,
.small {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.status-card,
.subpanel,
.task-card,
.task-list-item,
.code-block,
textarea,
input,
select,
.timeline-item {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.status-card,
.subpanel,
.task-card {
  padding: 18px;
}

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

.compact-head {
  margin-bottom: 12px;
}

.task-form,
.stack,
.task-layout,
.admin-grid {
  display: grid;
  gap: 16px;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  grid-auto-flow: row;
  align-items: start;
}

.admin-grid > *,
.task-cards,
.task-card,
.admin-task-picker,
.task-assignment,
.task-card-head,
.pill-list {
  min-width: 0;
  max-width: 100%;
}

.admin-panel-users,
.admin-panel-groups,
.admin-panel-executor,
.admin-panel-client {
  grid-column: auto;
}

.task-layout {
  grid-template-columns: 320px 1fr;
}

.task-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.operation-error-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  gap: 16px;
  width: min(520px, calc(100vw - 32px));
  padding: 18px;
  color: #7a1f16;
  background: #fff4f2;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(64, 25, 20, 0.24);
}

.operation-error-toast.visible {
  display: flex;
}

.operation-error-toast p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
}

.form-status {
  min-height: 20px;
}

.form-status.success {
  color: var(--success);
}

.form-status.error {
  color: var(--danger);
}

.task-form.compact,
.task-form.narrow {
  max-width: 100%;
}

textarea,
input,
select {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
}

.actions,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compact-inline select {
  min-width: 160px;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #115e59);
  color: white;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--ink);
}

a.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.setup-download-link {
  margin-top: 8px;
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
}

#logoutButton {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  z-index: 10000;
  box-shadow: 0 12px 30px rgba(64, 50, 38, 0.16);
}

.global-logout {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  z-index: 10000;
}

#sopStudioLink,
.global-sop-link {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: calc(max(24px, env(safe-area-inset-right)) + 92px);
  z-index: 10000;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(32, 25, 20, 0.12);
  backdrop-filter: blur(10px);
}

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

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
}

.user-row > div {
  display: grid;
  gap: 3px;
}

.password-reset-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-reset-form input {
  min-width: 170px;
  padding: 10px 12px;
}

.admin-task-picker {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.05);
  overflow: hidden;
}

.admin-task-picker label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.compact-empty {
  min-height: 80px;
}

.soft-divider {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.client-row,
.client-job-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
}

.client-row-head,
.client-job-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  border: 2px dashed rgba(15, 118, 110, 0.28);
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.05);
  text-align: center;
}

.upload-zone.active,
.upload-zone.drag-over {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.45);
}

.sop-chat-composer {
  display: grid;
  gap: 16px;
}

.sop-chat-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.inline-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-field input {
  flex: 1;
  min-width: 0;
}

.sop-chat-dropzone {
  min-height: 150px;
}

.sop-chat-input-wrap textarea {
  min-height: 160px;
  resize: vertical;
}

.upload-zone-title {
  font-weight: 700;
}

.task-cards,
.task-list,
.runs-list,
.timeline,
.step-list {
  display: grid;
  gap: 12px;
}

.task-select {
  min-height: 48px;
  max-width: 100%;
}

.task-select-meta {
  padding: 0 2px;
  word-break: break-word;
}

.task-card-head {
  margin-bottom: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-assignment {
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.step-list {
  max-height: 220px;
  overflow: auto;
  padding-right: 6px;
}

.step-item {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.04);
}

.step-item input {
  width: auto;
  margin-top: 3px;
}

.task-list-item,
.runs-list button {
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
}

.task-list-item.active,
.runs-list button.active {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  border-color: rgba(15, 118, 110, 0.28);
}

.run-title {
  display: block;
  font-weight: 700;
}

.run-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.inspector-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.inspector-grid.single-column {
  grid-template-columns: 1fr;
}

.timeline {
  min-height: 420px;
  max-height: 70vh;
  overflow: auto;
}

.timeline.empty,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
}

.timeline-item {
  padding: 14px;
}

.conversation-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.conversation-panel.empty-state {
  padding-right: 0;
}

.chat-list {
  display: grid;
  gap: 12px;
  max-height: 230px;
  overflow: auto;
  padding-right: 6px;
}

.chat-bubble {
  max-width: 92%;
  width: fit-content;
  height: auto;
  min-height: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.chat-bubble.assistant,
.chat-bubble.agent {
  justify-self: start;
  background: rgba(15, 118, 110, 0.08);
}

.chat-bubble.user {
  justify-self: end;
  background: rgba(32, 25, 20, 0.06);
}

.agent-trace {
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.045);
  padding: 10px 12px;
}

.agent-trace summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
}

.agent-trace-list {
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
  max-height: 170px;
  overflow: auto;
  list-style: none;
}

.agent-trace li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.agent-trace .trace-check {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 4px;
  border: 1px solid rgba(32, 25, 20, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
}

.agent-trace li.done .trace-check {
  background: rgba(15, 118, 110, 0.11);
  border-color: rgba(15, 118, 110, 0.25);
}

.agent-trace li.done .trace-text {
  text-decoration: line-through;
  opacity: 0.72;
}

.agent-trace li.failed {
  color: #9f2a1d;
}

.agent-trace li.failed .trace-check {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b42318;
}

.sop-reply-actions {
  justify-content: flex-end;
  margin-top: -10px;
}

.sop-reply-submit {
  min-width: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sop-cancel-operation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sop-rule-notes {
  min-height: 118px;
}

.usage-stats-panel {
  margin: 18px 0;
}

.usage-stats-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.usage-stats-content {
  display: grid;
  gap: 16px;
}

.usage-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.usage-stat-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.045);
}

.usage-stat-card span,
.usage-stat-card small {
  color: var(--muted);
}

.usage-stat-card strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.usage-stats-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.usage-stats-split > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
}

.usage-bars {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 96px;
  padding-top: 8px;
}

.usage-bars span {
  flex: 1;
  min-width: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.75), rgba(15, 118, 110, 0.18));
}

.usage-rank-list {
  display: grid;
  gap: 8px;
  max-height: 150px;
  overflow: auto;
}

.usage-rank-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.usage-rank-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-count-tip {
  cursor: help;
  text-decoration: underline dotted rgba(15, 118, 110, 0.55);
  text-underline-offset: 3px;
}

.usage-failure-list div,
.usage-task-list div {
  align-items: start;
}

.usage-failure-list span,
.usage-task-list span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .usage-stats-head,
  .usage-stats-split {
    grid-template-columns: 1fr;
  }

  .usage-stats-head {
    display: grid;
  }
}

.sop-project-card-minimal {
  display: grid;
  gap: 12px;
}

.sop-project-card-minimal .chat-list {
  min-height: 280px;
  max-height: 420px;
}

.sop-chat-list-wrap {
  position: relative;
}

.sop-scroll-bottom {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.24);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.sop-scroll-bottom.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sop-project-card-minimal .agent-trace-list {
  max-height: 260px;
}

.sop-project-card-minimal .chat-bubble {
  padding: 10px 13px;
  border-radius: 15px;
}

.sop-project-card-minimal .chat-bubble p {
  margin: 6px 0 0;
}

.typing-bubble {
  min-width: 86px;
}

.typing-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 20px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.45;
  animation: typing-dot 1s infinite ease-in-out;
}

.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.45;
  animation: typing-dot 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2),
.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3),
.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.sop-typing-status {
  margin: 8px 0 12px;
  color: var(--muted);
  font-weight: 600;
}

@keyframes typing-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-3px);
    opacity: 0.9;
  }
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.chat-message {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.reply-form {
  margin-top: 14px;
}

.reply-actions {
  align-items: center;
}

.reply-actions .primary-button {
  display: inline-flex;
  min-width: 120px;
  justify-content: center;
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.2);
}

#logoutButton {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  z-index: 10000;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(32, 25, 20, 0.12);
  backdrop-filter: blur(10px);
}

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

.event-type {
  color: var(--accent);
  font-weight: 700;
}

.timeline-item pre,
.code-block {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
}

.code-block {
  padding: 14px;
  min-height: 140px;
}

.muted-block {
  color: var(--muted);
}

.error-block {
  border-color: rgba(180, 35, 24, 0.2);
  background: var(--danger-soft);
  color: var(--danger);
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-row input {
  flex: 1;
}

.error-text {
  color: var(--danger);
}

.schedule-list {
  margin-top: 14px;
}

.assignment-pill {
  gap: 8px;
}

.pill-action {
  border: 0;
  border-left: 1px solid rgba(15, 118, 110, 0.18);
  margin-left: 4px;
  padding: 2px 0 2px 8px;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.operation-error-toast.success {
  border-color: rgba(15, 118, 110, 0.22);
  background: #eef8f5;
  color: var(--accent);
}

.schedule-options {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 180px);
  gap: 12px;
}

.weekday-options,
.monthday-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.weekday-options label,
.monthday-options label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 0;
}

.field-label {
  width: 100%;
  color: var(--muted);
  font-weight: 700;
}

.compact-row {
  padding: 12px;
}

.client-log-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.client-log-head h3,
.client-log-section h4 {
  margin: 0 0 8px;
}

.client-log-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.client-job-date-group {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  padding: 10px 12px;
}

.client-device-group {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  padding: 10px 12px;
}

.user-list-group,
.group-detail {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  padding: 10px 12px;
}

.client-job-date-group summary,
.client-device-group summary,
.user-list-group summary,
.group-detail summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
}

.client-job-date-group[open] summary,
.client-device-group[open] summary,
.user-list-group[open] summary,
.group-detail[open] summary {
  margin-bottom: 10px;
}

.group-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-members {
  padding-top: 6px;
}

.group-member-pill {
  gap: 8px;
}

.group-member-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 10px;
}

.group-member-editor select {
  flex: 1 1 220px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-shell,
  .admin-grid,
  .task-layout,
  .inspector-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel-users,
  .admin-panel-groups,
  .admin-panel-executor,
  .admin-panel-client {
    grid-column: auto;
  }

  .timeline {
    min-height: 280px;
  }
}

/* Autolink AI Light Dashboard Design System
   Mirrors the provided static dashboard while preserving existing Flask IDs and JS hooks. */
body.light-dashboard {
  --ui-bg: #fbfbfa;
  --ui-panel: #ffffff;
  --ui-sidebar: #fdfdfc;
  --ui-text: #121516;
  --ui-muted: #667085;
  --ui-soft: #98a2b3;
  --ui-line: #e6e8eb;
  --ui-line-soft: #eef0f2;
  --ui-green: #007a61;
  --ui-green-hover: #0a8b70;
  --ui-green-soft: #e8f6f1;
  --ui-red: #ef4444;
  --ui-red-bg: #fff1f1;
  --ui-shadow: 0 8px 30px rgba(16, 24, 40, 0.05);
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)),
    url("/static/login-background.jpg") center / cover fixed no-repeat;
  color: var(--ui-text);
  font-family: Inter, "Noto Sans TC", system-ui, sans-serif;
  font-size: 14px;
}

body.light-dashboard .app-shell {
  min-height: 100vh;
  display: block;
  background: transparent;
}

body.light-dashboard.login-mode .app-shell {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 100vh;
  background: transparent;
}

body.light-dashboard.login-mode .sidebar,
body.light-dashboard.login-mode .global-sop-link,
body.light-dashboard.login-mode .setup-download-link {
  display: none !important;
}

body.light-dashboard .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 246px;
  min-height: 100vh;
  background: var(--ui-sidebar);
  border-right: 1px solid var(--ui-line);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  z-index: 10;
}

body.light-dashboard .workspace {
  min-width: 0;
  margin-left: 246px;
  padding: 26px 30px 30px;
}

body.light-dashboard.login-mode .workspace {
  width: min(520px, calc(100vw - 36px));
  margin-left: 0;
  padding: 0;
  background: transparent;
}

body.light-dashboard .brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--ui-line);
}

body.light-dashboard .brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #35d6b4, #0a7d70);
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 122, 97, 0.18);
}

body.light-dashboard .brand-logo::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 5px solid #fff;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 6px;
  transform: rotate(45deg);
}

body.light-dashboard .brand h1 {
  margin: 0;
  color: var(--ui-text);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.light-dashboard .brand p,
body.light-dashboard .muted,
body.light-dashboard .small,
body.light-dashboard .form-status {
  color: var(--ui-muted);
}

body.light-dashboard .brand p {
  margin: 6px 0 0;
  font-size: 13px;
}

body.light-dashboard .status-card {
  min-height: 68px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--ui-shadow);
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 12px;
  flex-wrap: wrap;
  overflow: hidden;
}

body.light-dashboard .avatar-badge {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #dff3ea;
  color: #075f4b;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
}

body.light-dashboard .session-copy {
  min-width: 0;
  flex: 1;
}

body.light-dashboard .session-copy strong,
body.light-dashboard .session-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.light-dashboard .session-copy strong {
  color: var(--ui-text);
}

body.light-dashboard .session-copy span {
  color: var(--ui-muted);
  font-size: 12px;
}

body.light-dashboard .setup-download-link {
  width: 100%;
  max-width: 100%;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: center;
  margin-top: 2px;
}

body.light-dashboard .side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 16px;
  z-index: 3;
  background: var(--ui-sidebar);
  padding: 4px 0;
}

body.light-dashboard .side-nav-title,
body.light-dashboard .label {
  margin: 0 0 10px 4px;
  color: #1f2937;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.light-dashboard .side-nav-item {
  height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #30363d;
  text-decoration: none;
  border-radius: 9px;
  font-weight: 600;
  transition: background 200ms ease-in-out, color 200ms ease-in-out;
}

body.light-dashboard .side-nav-item:hover,
body.light-dashboard .side-nav-item.active {
  background: var(--ui-green-soft);
  color: var(--ui-green);
}

body.light-dashboard .nav-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
}

body.light-dashboard .nav-icon::before {
  color: currentColor;
  font-size: 18px;
  line-height: 1;
}

body.light-dashboard .nav-home::before { content: "⌂"; }
body.light-dashboard .nav-list::before { content: "▤"; }
body.light-dashboard .nav-device::before { content: "▱"; }
body.light-dashboard .nav-users::before { content: "♙"; }
body.light-dashboard .nav-group::before { content: "♧"; }
body.light-dashboard .nav-task::before { content: "▣"; }
body.light-dashboard .nav-settings::before { content: "⚙"; }

body.light-dashboard .system-status-card {
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--ui-shadow);
  pointer-events: none;
  cursor: default;
  user-select: none;
  display: none !important;
}

body.light-dashboard .status-title {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ui-text);
  font-weight: 600;
}

body.light-dashboard .status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #39c98f;
}

body.light-dashboard .meter-row {
  display: flex;
  justify-content: space-between;
  color: #4b5563;
  font-size: 13px;
  margin: 18px 0 8px;
}

body.light-dashboard .meter {
  height: 5px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

body.light-dashboard .meter span {
  display: block;
  height: 100%;
  background: var(--ui-green);
  border-radius: 999px;
}

body.light-dashboard .runs-panel {
  margin-top: auto;
  border-top: 1px solid var(--ui-line);
  padding-top: 18px;
}

body.light-dashboard .runs-panel h2 {
  color: var(--ui-text);
  font-size: 18px;
  margin: 0;
}

body.light-dashboard .card,
body.light-dashboard .subpanel,
body.light-dashboard .task-card,
body.light-dashboard .client-row,
body.light-dashboard .client-job-row,
body.light-dashboard .user-row,
body.light-dashboard .client-device-group,
body.light-dashboard .client-job-date-group,
body.light-dashboard .user-list-group,
body.light-dashboard .group-detail,
body.light-dashboard .admin-task-picker,
body.light-dashboard .code-block {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  box-shadow: var(--ui-shadow);
  color: var(--ui-text);
}

body.light-dashboard .card,
body.light-dashboard .subpanel {
  padding: 24px;
}

body.light-dashboard #adminPanel.card,
body.light-dashboard #userPanel.card,
body.light-dashboard .app-content > .card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

body.light-dashboard .panel-head {
  min-height: auto;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

body.light-dashboard .panel-head h2 {
  margin: 0 0 8px;
  color: var(--ui-text);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.light-dashboard .eyebrow {
  margin: 0 0 6px;
  color: #4b5563;
  font-size: 13px;
  letter-spacing: 0;
}

body.light-dashboard .admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

body.light-dashboard .admin-grid > .subpanel {
  min-height: 520px;
}

body.light-dashboard .admin-panel-client { order: 1; }
body.light-dashboard .admin-panel-users { order: 2; }
body.light-dashboard .admin-panel-groups { order: 3; }
body.light-dashboard .admin-panel-import { order: 4; }
body.light-dashboard .admin-panel-tasks { order: 5; }
body.light-dashboard .admin-panel-executor { order: 6; }

body.light-dashboard .subpanel h3 {
  margin: 0 0 16px;
  color: var(--ui-text);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 16px;
}

body.light-dashboard .admin-grid > .subpanel > h3::before {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #f1f4f3;
  display: inline-grid;
  place-items: center;
  color: #1f2937;
  font-weight: 800;
  flex: 0 0 36px;
}

body.light-dashboard .admin-panel-client > h3::before { content: "1"; }
body.light-dashboard .admin-panel-users > h3::before { content: "2"; }
body.light-dashboard .admin-panel-groups > h3::before { content: "3"; }

body.light-dashboard label span,
body.light-dashboard .field-label {
  display: block;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

body.light-dashboard .task-form {
  gap: 16px;
}

body.light-dashboard input,
body.light-dashboard select,
body.light-dashboard textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  color: #1f2937;
  outline: none;
  box-shadow: none;
  transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}

body.light-dashboard input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  flex: 0 0 18px;
  accent-color: var(--ui-green);
}

body.light-dashboard .checkbox-row,
body.light-dashboard .step-item {
  min-height: 42px;
  align-items: center;
}

body.light-dashboard .checkbox-row span,
body.light-dashboard .step-item span,
body.light-dashboard .step-item label {
  margin-bottom: 0;
}

body.light-dashboard textarea {
  padding-top: 12px;
  line-height: 1.65;
}

body.light-dashboard input::placeholder,
body.light-dashboard textarea::placeholder {
  color: #98a2b3;
}

body.light-dashboard input:focus,
body.light-dashboard select:focus,
body.light-dashboard textarea:focus {
  border-color: var(--ui-green-hover);
  box-shadow: 0 0 0 3px rgba(10, 139, 112, 0.1);
}

body.light-dashboard .primary-button,
body.light-dashboard .ghost-button,
body.light-dashboard button {
  min-height: 42px;
  border-radius: 7px;
  font-weight: 800;
  transition: background 200ms ease-in-out, color 200ms ease-in-out, border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}

body.light-dashboard .primary-button {
  border: 0;
  background: linear-gradient(180deg, #07886b, #00634c);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 122, 97, 0.18);
  padding: 0 22px;
}

body.light-dashboard .primary-button:hover {
  background: linear-gradient(180deg, #0a8b70, #00634c);
}

body.light-dashboard .ghost-button {
  border: 1px solid var(--ui-line);
  background: #fff;
  color: #30363d;
}

body.light-dashboard .ghost-button:hover {
  border-color: var(--ui-green-hover);
  color: var(--ui-green);
  background: var(--ui-green-soft);
}

body.light-dashboard .danger-button,
body.light-dashboard .danger-button:hover {
  border-color: #facaca;
  background: var(--ui-red-bg);
  color: #e22f37;
}

body.light-dashboard #clientTokenResult,
body.light-dashboard .code-block {
  min-height: 78px;
  border-radius: 9px;
  box-shadow: none;
}

body.light-dashboard .client-device-group,
body.light-dashboard .client-job-date-group,
body.light-dashboard .user-list-group {
  min-height: 44px;
  border-radius: 8px;
  box-shadow: none;
}

body.light-dashboard .group-detail,
body.light-dashboard .user-row,
body.light-dashboard .client-row {
  border-radius: 10px;
  box-shadow: none;
}

body.light-dashboard .pill,
body.light-dashboard .status-badge,
body.light-dashboard .badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

body.light-dashboard .upload-zone {
  border: 1px dashed var(--ui-line);
  border-radius: 10px;
  background: #fff;
}

body.light-dashboard .upload-zone.drag-over {
  border-color: var(--ui-green-hover);
  background: var(--ui-green-soft);
}

body.light-dashboard .global-sop-link:not(.hidden) {
  position: fixed;
  top: 24px;
  right: 108px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #07906f, #00684f);
  color: #fff !important;
  font-weight: 700;
  padding: 0 25px;
  box-shadow: 0 8px 22px rgba(0, 122, 97, 0.18);
  opacity: 1;
  text-indent: 0;
  overflow: visible;
  white-space: nowrap;
}

body.light-dashboard #sopStudioLink.global-sop-link:not(.hidden) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 176px !important;
  min-width: 176px !important;
  max-width: 176px !important;
  height: 42px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, #07906f, #00684f) !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-indent: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  z-index: 10002 !important;
}

body.light-dashboard #sopStudioLink.global-sop-link:not(.hidden)::before,
body.light-dashboard #sopStudioLink.global-sop-link:not(.hidden)::after {
  display: none !important;
  content: none !important;
}

body.light-dashboard .global-logout-form {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10003;
}

body.light-dashboard .global-logout-form #logoutButton {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #384252;
  box-shadow: none;
}

body.light-dashboard .login-card {
  width: min(520px, 100%);
  padding: 34px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

body.light-dashboard.login-mode .login-card::before {
  display: none;
}

body.light-dashboard .login-card .login-hero h2 {
  color: var(--ui-text);
  font-size: 24px;
  font-weight: 800;
}

body.light-dashboard .login-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.light-dashboard .login-title-row .brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

body.light-dashboard .login-submit {
  width: 100%;
}

body.light-dashboard .reply-actions {
  justify-content: center;
}

body.light-dashboard #replySubmitButton {
  min-width: 128px;
  justify-content: center;
  text-align: center;
  display: inline-flex;
  align-items: center;
}

body.light-dashboard .runs-panel {
  max-height: 188px;
  overflow: hidden;
}

body.light-dashboard .runs-list {
  gap: 6px;
  max-height: 118px;
  overflow: auto;
}

body.light-dashboard .runs-list button {
  padding: 7px 8px;
  min-height: 34px;
  font-size: 11px;
}

body.light-dashboard .runs-list .run-title,
body.light-dashboard .runs-list .run-meta {
  font-size: 11px;
  line-height: 1.28;
}

body.light-dashboard .runs-panel .panel-head {
  gap: 8px;
  margin-bottom: 10px;
}

body.light-dashboard .runs-panel h2 {
  font-size: 16px;
  line-height: 1.2;
}

body.light-dashboard .runs-panel .ghost-button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
}

body.light-dashboard .task-layout,
body.light-dashboard .inspector-grid {
  grid-template-columns: 1.04fr 0.96fr;
  gap: 18px;
}

body.light-dashboard .inspector-grid.single-column {
  grid-template-columns: 1fr;
}

body.light-dashboard .conversation-panel,
body.light-dashboard .empty-state {
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
}

body.light-dashboard .conversation-panel {
  min-height: 360px;
  max-height: 560px;
  overflow: auto;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
}

body.light-dashboard #replyInput {
  min-height: 112px;
}

body.light-dashboard .chat-bubble.agent,
body.light-dashboard .chat-bubble.assistant {
  background: var(--ui-green-soft);
  border-color: rgba(0, 122, 97, 0.12);
}

body.light-dashboard .chat-bubble.user {
  background: #f4f7fb;
  border-color: var(--ui-line);
}

@media (max-width: 1100px) {
  body.light-dashboard .app-shell {
    display: block;
  }

  body.light-dashboard .sidebar {
    padding: 20px 12px;
    width: 80px;
  }

  body.light-dashboard .workspace {
    margin-left: 80px;
  }

  body.light-dashboard .brand h1,
  body.light-dashboard .brand p,
  body.light-dashboard .session-copy,
  body.light-dashboard .side-nav-title,
  body.light-dashboard .side-nav-item span:not(.nav-icon),
  body.light-dashboard .system-status-card,
  body.light-dashboard .runs-panel,
  body.light-dashboard .setup-download-link {
    display: none;
  }

  body.light-dashboard .brand {
    justify-content: center;
  }

  body.light-dashboard .side-nav-item {
    justify-content: center;
    padding: 0;
    position: relative;
  }

  body.light-dashboard .side-nav-item:hover::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10020;
    min-width: max-content;
    padding: 8px 10px;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    background: #fff;
    color: var(--ui-text);
    box-shadow: var(--ui-shadow);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
  }

  body.light-dashboard .admin-grid,
  body.light-dashboard .task-layout,
  body.light-dashboard .inspector-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.light-dashboard .app-shell {
    display: block;
  }

  body.light-dashboard .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    flex-direction: row;
    overflow-x: auto;
  }

  body.light-dashboard .workspace {
    margin-left: 0;
    padding: 18px;
  }

  body.light-dashboard .admin-grid {
    grid-template-columns: 1fr;
  }

  body.light-dashboard .global-sop-link,
  body.light-dashboard .global-logout-form {
    position: static;
    display: inline-flex;
    margin: 10px;
  }
}

/* SOP Studio light dashboard alignment */
body.light-dashboard.sop-studio-page .app-shell {
  display: block;
  background: transparent;
}

body.light-dashboard.sop-studio-page .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 246px;
  min-height: 100vh;
}

body.light-dashboard.sop-studio-page .workspace {
  margin-left: 246px;
  padding: 26px 30px 30px;
}

body.light-dashboard.sop-studio-page .sop-chat-workspace {
  display: grid;
  grid-template-columns: minmax(520px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  align-items: start;
}

body.light-dashboard.sop-studio-page .sop-chat-card,
body.light-dashboard.sop-studio-page .sop-projects-card,
body.light-dashboard.sop-studio-page #sopErrorPanel {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  box-shadow: var(--ui-shadow);
  padding: 24px;
}

body.light-dashboard.sop-studio-page .sop-chat-card {
  position: sticky;
  top: 26px;
}

body.light-dashboard.sop-studio-page .sop-projects-card {
  min-height: calc(100vh - 52px);
}

body.light-dashboard.sop-studio-page #sopErrorPanel {
  grid-column: 2;
  align-self: start;
}

body.light-dashboard.sop-studio-page .sop-chat-dropzone {
  min-height: 118px;
  border: 1px dashed var(--ui-line);
  background: #fff;
}

body.light-dashboard.sop-studio-page .sop-chat-input-wrap textarea {
  min-height: 210px;
}

body.light-dashboard.sop-studio-page .sop-back-link {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

body.light-dashboard.sop-studio-page .sop-project-card-minimal {
  border-radius: 12px;
  box-shadow: var(--ui-shadow);
}

body.light-dashboard.sop-studio-page .sop-project-card-minimal .chat-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-height: 300px;
  max-height: 460px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

body.light-dashboard.sop-studio-page .sop-project-card-minimal .chat-bubble {
  display: block;
  width: auto;
  max-width: min(780px, 92%);
  min-height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.light-dashboard.sop-studio-page .sop-project-card-minimal .chat-bubble.assistant,
body.light-dashboard.sop-studio-page .sop-project-card-minimal .chat-bubble.agent {
  align-self: flex-start;
}

body.light-dashboard.sop-studio-page .sop-project-card-minimal .chat-bubble.user {
  align-self: flex-end;
}

body.light-dashboard.sop-studio-page .sop-project-card-minimal .chat-bubble p,
body.light-dashboard.sop-studio-page .sop-project-card-minimal .chat-bubble strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.light-dashboard.sop-studio-page .sop-reply-actions {
  justify-content: center;
  margin-top: 0;
}

@media (max-width: 1100px) {
  body.light-dashboard.sop-studio-page .sidebar {
    width: 80px;
  }

  body.light-dashboard.sop-studio-page .workspace {
    margin-left: 80px;
  }

  body.light-dashboard.sop-studio-page .sop-chat-workspace {
    grid-template-columns: 1fr;
  }

  body.light-dashboard.sop-studio-page #sopErrorPanel {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  body.light-dashboard.sop-studio-page .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }

  body.light-dashboard.sop-studio-page .workspace {
    margin-left: 0;
    padding: 18px;
  }

  body.light-dashboard.sop-studio-page .sop-chat-card {
    position: static;
  }
}

@media (max-width: 1100px) {
  body.light-dashboard .sidebar,
  body.light-dashboard.sop-studio-page .sidebar {
    overflow: visible !important;
  }

  body.light-dashboard .side-nav,
  body.light-dashboard.sop-studio-page .side-nav {
    overflow: visible !important;
  }

  body.light-dashboard .side-nav-item:hover::after,
  body.light-dashboard .side-nav-item:focus-visible::after,
  body.light-dashboard.sop-studio-page .side-nav-item:hover::after,
  body.light-dashboard.sop-studio-page .side-nav-item:focus-visible::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10050;
    min-width: max-content;
    padding: 8px 10px;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    background: #fff;
    color: var(--ui-text);
    box-shadow: var(--ui-shadow);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
  }

  body.light-dashboard.sop-studio-page .sop-back-link {
    display: inline-flex !important;
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    margin-top: auto !important;
    position: relative;
    overflow: visible !important;
    font-size: 0 !important;
  }

  body.light-dashboard.sop-studio-page .sop-back-link::before {
    content: "↩";
    font-size: 20px;
    line-height: 1;
    color: var(--ui-green);
  }

  body.light-dashboard.sop-studio-page .sop-back-link:hover::after,
  body.light-dashboard.sop-studio-page .sop-back-link:focus-visible::after {
    content: "返回 Autolink AI 智動化平台";
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10050;
    min-width: max-content;
    padding: 8px 10px;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    background: #fff;
    color: var(--ui-text);
    box-shadow: var(--ui-shadow);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
  }
}
