/* =========================================================
   Tech Curriculum Simulations — Frontend Styles  v1.4
   ALL rules scoped to .tcs-sim.

   Design system
   ─────────────
   Spacing unit : 16px
   Border radius: 8px (containers), 4px (small elements)
   Primary color: #2563eb (blue)  — Next button, focus ring
   Accent color : #f59e0b (amber) — Check Cursor, step badges, task border
   Chrome color : #eaecef          — title bar, status bar
   Workspace    : #e4e7eb          — desk surface
   ========================================================= */

/* ── Reset / container ────────────────────────────────────────────────────── */
.tcs-sim {
  position: relative;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  box-sizing: border-box;
  max-width: 760px;
  margin: 2rem auto;
}

.tcs-sim *,
.tcs-sim *::before,
.tcs-sim *::after {
  box-sizing: border-box;
}

/* ── Simulation unit ──────────────────────────────────────────────────────────
   Wraps the window chrome + feedback as one visually connected frame.
   Border, shadow, and radius all live here so every element inside is flush.
   ─────────────────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-sim-unit {
  border: 1px solid #c8cdd4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.07),
    0 4px 16px rgba(0, 0, 0, 0.10);
}

/* Window itself is borderless — the unit provides all chrome */
.tcs-sim .tcs-wp-window {
  /* intentionally empty — structure only */
}

/* ── Title bar ────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-wp-titlebar {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  background: #eaecef;
  border-bottom: 1px solid #d0d4d9;
  gap: 8px;
}

.tcs-sim .tcs-wp-doc-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: #5f6b7a;
  line-height: 1;
}

.tcs-sim .tcs-wp-doc-icon svg {
  display: block;
}

.tcs-sim .tcs-wp-window-title {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3a4451;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-wp-toolbar {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  background: #f7f8f9;
  border-bottom: 1px solid #dde0e4;
  gap: 2px;
  user-select: none;
}

.tcs-sim .tcs-tb-group {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.tcs-sim .tcs-tb-div {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: #dde0e4;
  margin: 0 8px;
  flex-shrink: 0;
}

.tcs-sim .tcs-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 0.8rem;
  color: #4a5568;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: default;
  white-space: nowrap;
  gap: 3px;
  pointer-events: none;
}

.tcs-sim .tcs-tb-font {
  min-width: 92px;
  justify-content: space-between;
  border-color: #d2d6db;
  background: #ffffff;
}

.tcs-sim .tcs-tb-size {
  min-width: 38px;
  justify-content: space-between;
  border-color: #d2d6db;
  background: #ffffff;
}

.tcs-sim .tcs-tb-fname { flex: 1; text-align: left; }
.tcs-sim .tcs-tb-arr   { font-size: 0.58rem; color: #90a0b0; }
.tcs-sim .tcs-tb-b     { font-weight: 700; font-size: 0.85rem; min-width: 28px; color: #3a4451; }
.tcs-sim .tcs-tb-i     { font-style: italic; font-size: 0.85rem; min-width: 28px; color: #3a4451; }
.tcs-sim .tcs-tb-u     { text-decoration: underline; font-size: 0.85rem; min-width: 28px; color: #3a4451; }

/* ── Workspace ────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-wp-workspace {
  background: #e4e7eb;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Task box ─────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-wp-task {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 14px 16px;
}

.tcs-sim .tcs-wp-task-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400e;
  margin-bottom: 8px;
}

/* Single-prompt fallback */
.tcs-sim .tcs-prompt {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

/* Step list */
.tcs-sim .tcs-task-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: tcs-step;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tcs-sim .tcs-task-step {
  counter-increment: tcs-step;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.tcs-sim .tcs-task-step::before {
  content: counter(tcs-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Page ─────────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-wp-page {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 24px 28px;
  min-height: 120px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tcs-sim .tcs-wp-page:focus-within {
  border-color: #2563eb;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.15),
    0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ── Editor textarea ──────────────────────────────────────────────────────── */
.tcs-sim .tcs-editor {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 0;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #111827;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  cursor: text;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  caret-color: #2563eb;
  caret-width: 2px;
}

.tcs-sim .tcs-editor:focus {
  outline: none;
  box-shadow: none;
}

/* Locked state */
.tcs-sim[data-locked="true"] .tcs-wp-page {
  background: #f9fafb;
  border-color: #e5e7eb;
}

.tcs-sim[data-locked="true"] .tcs-editor {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Status bar ───────────────────────────────────────────────────────────── */
.tcs-sim .tcs-wp-statusbar {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  background: #eaecef;
  border-top: 1px solid #d0d4d9;
  font-size: 0.75rem;
  color: #5f6b7a;
}

.tcs-sim .tcs-wp-status-left {
  flex-shrink: 0;
  padding-right: 16px;
  border-right: 1px solid #d0d4d9;
}

.tcs-sim .tcs-wp-status-step {
  flex: 1;
  text-align: center;
  font-weight: 600;
  color: #3a4451;
}

.tcs-sim .tcs-wp-status-cursor {
  flex-shrink: 0;
  padding-left: 16px;
  border-left: 1px solid #d0d4d9;
}

/* ── Feedback ─────────────────────────────────────────────────────────────────
   Sits inside .tcs-sim-unit, flush against the bottom of the status bar.
   Uses a top border to divide it from the window chrome; no extra margins.
   ─────────────────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-feedback {
  display: none;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
}

.tcs-sim .tcs-feedback:not(:empty) {
  display: block;
  padding: 12px 16px;
}

.tcs-sim .tcs-feedback--success {
  background: #f0fdf4;
  color: #166534;
  border-top: 1px solid #bbf7d0;
}

.tcs-sim .tcs-feedback--error {
  background: #fef2f2;
  color: #991b1b;
  border-top: 1px solid #fecaca;
}

.tcs-sim .tcs-feedback--hint {
  background: #fffbeb;
  color: #92400e;
  border-top: 1px solid #fde68a;
}

/* ── Controls ─────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Base */
.tcs-sim .tcs-btn {
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  line-height: 1.4;
}

.tcs-sim .tcs-btn:active  { transform: translateY(1px); }
.tcs-sim .tcs-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Secondary — Try Again */
.tcs-sim .tcs-btn--retry {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.tcs-sim .tcs-btn--retry:hover:not(:disabled) {
  background: #e9eaec;
}

/* Primary amber — Check Cursor */
.tcs-sim .tcs-btn--check {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.tcs-sim .tcs-btn--check:hover:not(:disabled) {
  background: #d97706;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* Primary blue — Next (most prominent) */
.tcs-sim .tcs-btn--next {
  background: #2563eb;
  color: #ffffff;
  padding: 10px 24px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.tcs-sim .tcs-btn--next:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

/* ── Completion screen ────────────────────────────────────────────────────── */
.tcs-sim .tcs-stage-panel.is-hidden {
  display: none;
}

.tcs-sim .tcs-completion {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #c8cdd4;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.07),
    0 4px 16px rgba(0, 0, 0, 0.10);
}

.tcs-sim .tcs-completion.is-visible {
  display: block;
}

.tcs-sim .tcs-completion-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.tcs-sim .tcs-completion-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #166534;
}

.tcs-sim .tcs-completion-message {
  font-size: 1rem;
  color: #555;
  margin: 0;
}

/* ==========================================================
   File Explorer Engine  — .tcs-fe-*
   All rules scoped under .tcs-sim.
   Shares the same design tokens as the Word Processor engine.
   ========================================================== */

/* ── Desktop ──────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-fe-desktop {
  position: relative;
  background: #dce7f3;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  user-select: none;
}

.tcs-sim .tcs-fe-desktop-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 20px 0;
}

.tcs-sim .tcs-fe-desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 72px;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.tcs-sim .tcs-fe-desktop-icon:hover {
  background: rgba(255, 255, 255, 0.35);
}

.tcs-sim .tcs-fe-desktop-icon.is-selected {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.45);
}

.tcs-sim .tcs-fe-icon-graphic {
  font-size: 2.2rem;
  line-height: 1;
  display: block;
  text-align: center;
}

.tcs-sim img.tcs-fe-icon-graphic {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  margin: 0 auto;
}

.tcs-sim .tcs-fe-icon-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1a2a3a;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

/* ── Taskbar ──────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-fe-taskbar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  background: #1e3a5f;
  gap: 8px;
  margin-top: auto;
}

.tcs-sim .tcs-fe-taskbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 5px;
  border: 1px solid transparent;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-fe-taskbar-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tcs-sim .tcs-fe-taskbar-icon.is-active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.tcs-sim .tcs-fe-taskbar-icon-glyph {
  font-size: 1rem;
  line-height: 1;
}

.tcs-sim .tcs-fe-taskbar-clock {
  margin-left: auto;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.75);
}

/* ── File Explorer window ─────────────────────────────────────────────────── */
.tcs-sim .tcs-fe-window {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 36px; /* above taskbar */
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #b0bac6;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.12s ease;
}

.tcs-sim .tcs-fe-window.is-hidden {
  display: none;
}

/* ── Explorer title bar ───────────────────────────────────────────────────── */
.tcs-sim .tcs-fe-titlebar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  background: #eaecef;
  border-bottom: 1px solid #d0d4d9;
  flex-shrink: 0;
  gap: 8px;
}

.tcs-sim .tcs-fe-titlebar-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.tcs-sim .tcs-fe-titlebar-text {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3a4451;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcs-sim .tcs-fe-close-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #d1d5db;
  color: #6b7280;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-fe-close-btn:hover {
  background: #e57373;
  color: #ffffff;
}

/* ── Address / nav bar ────────────────────────────────────────────────────── */
.tcs-sim .tcs-fe-navbar {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  background: #f7f8f9;
  border-bottom: 1px solid #dde0e4;
  gap: 8px;
  flex-shrink: 0;
}

.tcs-sim .tcs-fe-back-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.1s ease;
  line-height: 1;
}

.tcs-sim .tcs-fe-back-btn:hover:not(:disabled) {
  background: #e9eaec;
}

.tcs-sim .tcs-fe-back-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tcs-sim .tcs-fe-path-bar {
  flex: 1;
  height: 22px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 0.76rem;
  color: #374151;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

/* ── Task box (inside explorer window) ───────────────────────────────────── */
.tcs-sim .tcs-fe-task-box {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  padding: 10px 14px;
  flex-shrink: 0;
}

.tcs-sim .tcs-fe-task-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400e;
  margin-bottom: 6px;
}

.tcs-sim .tcs-fe-task-prompt {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

/* Step list inside explorer task box */
.tcs-sim .tcs-fe-task-box .tcs-task-steps {
  gap: 7px;
}

.tcs-sim .tcs-fe-task-box .tcs-task-step {
  font-size: 0.88rem;
}

/* ── Content pane ─────────────────────────────────────────────────────────── */
.tcs-sim .tcs-fe-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  min-height: 200px;
}

.tcs-sim .tcs-fe-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 80px;
  padding: 8px 4px 6px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.tcs-sim .tcs-fe-item:hover {
  background: #f0f4ff;
}

.tcs-sim .tcs-fe-item.is-selected {
  background: #dbeafe;
  border-color: #93c5fd;
}

.tcs-sim .tcs-fe-item-icon {
  font-size: 2rem;
  line-height: 1;
  display: block;
}

.tcs-sim img.tcs-fe-item-icon {
  width: 2.2rem;
  height: 2.2rem;
  object-fit: contain;
}

.tcs-sim .tcs-fe-item-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #1f2937;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  max-width: 76px;
}

/* ── Explorer status bar ──────────────────────────────────────────────────── */
.tcs-sim .tcs-fe-statusbar {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  background: #eaecef;
  border-top: 1px solid #d0d4d9;
  font-size: 0.72rem;
  color: #5f6b7a;
  gap: 12px;
  flex-shrink: 0;
}

.tcs-sim .tcs-fe-status-info {
  flex: 1;
}

.tcs-sim .tcs-fe-status-step {
  font-weight: 600;
  color: #3a4451;
  flex-shrink: 0;
}

/* ==========================================================
   Browser Engine  — .tcs-br-*
   All rules scoped under .tcs-sim.
   Shares the same design tokens as the other engines.
   ========================================================== */

/* ── Browser window ──────────────────────────────────────────────────────── */
.tcs-sim .tcs-br-window {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  min-height: 480px;
  user-select: none;
}

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.tcs-sim .tcs-br-tab-bar {
  display: flex;
  align-items: flex-end;
  height: 38px;
  padding: 6px 8px 0;
  background: #dee1e6;
  gap: 2px;
  flex-shrink: 0;
}

.tcs-sim .tcs-br-tab {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 16px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #5f6b7a;
  background: #cdd1d8;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-br-tab:hover {
  background: #e4e7ec;
}

.tcs-sim .tcs-br-tab.is-active {
  background: #ffffff;
  color: #1a1a1a;
  font-weight: 600;
}

.tcs-sim .tcs-br-tab-new {
  min-width: 28px;
  max-width: 28px;
  padding: 0;
  justify-content: center;
  font-size: 0.9rem;
  color: #6b7280;
  background: transparent;
  cursor: default;
}

.tcs-sim .tcs-br-tab-new:hover {
  background: rgba(0,0,0,0.06);
}

/* ── Navigation bar ──────────────────────────────────────────────────────── */
.tcs-sim .tcs-br-navbar {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 10px;
  background: #ffffff;
  border-bottom: 1px solid #dde0e4;
  gap: 6px;
  flex-shrink: 0;
}

.tcs-sim .tcs-br-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #374151;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.1s ease;
  line-height: 1;
}

.tcs-sim .tcs-br-nav-btn:hover:not(:disabled) {
  background: #f0f0f0;
}

.tcs-sim .tcs-br-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Address bar ─────────────────────────────────────────────────────────── */
.tcs-sim .tcs-br-address-bar {
  flex: 1;
  height: 30px;
  background: #f1f3f4;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.82rem;
  color: #374151;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tcs-sim .tcs-br-address-bar::placeholder {
  color: #9ca3af;
}

.tcs-sim .tcs-br-address-bar:focus,
.tcs-sim .tcs-br-address-bar.is-focused {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tcs-sim .tcs-br-address-bar[readonly] {
  cursor: default;
  opacity: 0.6;
}

/* ── Task box (inside browser window) ────────────────────────────────────── */
.tcs-sim .tcs-br-task-box {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  padding: 10px 14px;
  flex-shrink: 0;
}

.tcs-sim .tcs-br-task-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400e;
  margin-bottom: 6px;
}

.tcs-sim .tcs-br-task-prompt {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

/* Step list inside browser task box */
.tcs-sim .tcs-br-task-box .tcs-task-steps {
  gap: 7px;
}

.tcs-sim .tcs-br-task-box .tcs-task-step {
  font-size: 0.88rem;
}

/* ── Page content pane ───────────────────────────────────────────────────── */
.tcs-sim .tcs-br-page {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: #ffffff;
  min-height: 220px;
}

/* ── Blank page ──────────────────────────────────────────────────────────── */
.tcs-sim .tcs-br-blank-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  gap: 8px;
  color: #9ca3af;
}

.tcs-sim .tcs-br-blank-icon {
  font-size: 3rem;
  line-height: 1;
}

.tcs-sim .tcs-br-blank-text {
  font-size: 1.1rem;
  font-weight: 500;
}

/* ── Not found page ──────────────────────────────────────────────────────── */
.tcs-sim .tcs-br-not-found {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.tcs-sim .tcs-br-not-found h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px;
}

.tcs-sim .tcs-br-not-found p {
  font-size: 0.9rem;
  margin: 0;
}

/* ── Content block: heading ──────────────────────────────────────────────── */
.tcs-sim .tcs-br-heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px;
  line-height: 1.3;
}

/* ── Content block: paragraph ────────────────────────────────────────────── */
.tcs-sim .tcs-br-paragraph {
  font-size: 0.95rem;
  color: #374151;
  margin: 0 0 12px;
  line-height: 1.6;
}

/* ── Content block: link ─────────────────────────────────────────────────── */
.tcs-sim .tcs-br-link {
  display: inline-block;
  color: #2563eb;
  text-decoration: underline;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  margin: 4px 0;
  transition: color 0.1s ease;
}

.tcs-sim .tcs-br-link:hover {
  color: #1d4ed8;
}

/* ── Content block: button ───────────────────────────────────────────────── */
.tcs-sim .tcs-br-page-btn {
  display: inline-block;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  background: #2563eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 4px 4px 4px 0;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-br-page-btn:hover {
  background: #1d4ed8;
}

/* ── Content block: image placeholder ────────────────────────────────────── */
.tcs-sim .tcs-br-image-placeholder {
  width: 100%;
  height: 120px;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: #9ca3af;
  margin: 8px 0;
}

/* ── Content block: real image (resolved from asset library) ──────────────── */
.tcs-sim .tcs-br-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 8px 0;
}

/* ── Content block: search input ─────────────────────────────────────────── */
.tcs-sim .tcs-br-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  max-width: 480px;
}

.tcs-sim .tcs-br-search-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tcs-sim .tcs-br-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tcs-sim .tcs-br-search-btn {
  height: 36px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  background: #2563eb;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-br-search-btn:hover {
  background: #1d4ed8;
}

/* ── Content block: search results ───────────────────────────────────────── */
.tcs-sim .tcs-br-search-results {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 12px 0;
}

.tcs-sim .tcs-br-search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tcs-sim .tcs-br-result-url {
  font-size: 0.72rem;
  color: #4d7c0f;
}

.tcs-sim .tcs-br-result-title {
  font-size: 1rem;
  font-weight: 500;
  color: #1a0dab;
  text-decoration: none;
  cursor: pointer;
}

.tcs-sim .tcs-br-result-title:hover {
  text-decoration: underline;
}

.tcs-sim .tcs-br-result-snippet {
  font-size: 0.85rem;
  color: #5f6368;
  line-height: 1.4;
}

/* ── Status bar ──────────────────────────────────────────────────────────── */
.tcs-sim .tcs-br-statusbar {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  background: #eaecef;
  border-top: 1px solid #d0d4d9;
  font-size: 0.72rem;
  color: #5f6b7a;
  gap: 12px;
  flex-shrink: 0;
}

.tcs-sim .tcs-br-status-info {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tcs-sim .tcs-br-status-step {
  font-weight: 600;
  color: #3a4451;
  flex-shrink: 0;
}

/* ==========================================================
   Dialog Engine  — .tcs-dlg-*
   Save / Open / Print system dialogs over a host application.
   All rules scoped under .tcs-sim. Shares the shared design tokens.
   ========================================================== */

/* ── Task box (always visible, above the host window) ─────────────────────── */
.tcs-sim .tcs-dlg-task-box {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
}

.tcs-sim .tcs-dlg-task-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400e;
  margin-bottom: 6px;
}

.tcs-sim .tcs-dlg-task-prompt {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

.tcs-sim .tcs-dlg-task-box .tcs-task-steps { gap: 7px; }
.tcs-sim .tcs-dlg-task-box .tcs-task-step  { font-size: 0.88rem; }

/* ── Stage area: host window + dialog overlay ─────────────────────────────── */
.tcs-sim .tcs-dlg-stage {
  position: relative;
  background: #e4e7eb;
  min-height: 420px;
  padding: 16px;
  display: flex;
}

/* ── Host application window ──────────────────────────────────────────────── */
.tcs-sim .tcs-dlg-host {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #b0bac6;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.tcs-sim .tcs-dlg-host-titlebar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  background: #eaecef;
  border-bottom: 1px solid #d0d4d9;
  gap: 8px;
  flex-shrink: 0;
}

.tcs-sim .tcs-dlg-host-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.tcs-sim img.tcs-dlg-host-icon {
  width: 1.1rem;
  height: 1.1rem;
  object-fit: contain;
}

.tcs-sim .tcs-dlg-host-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #3a4451;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Host toolbar — Save / Open / Print triggers */
.tcs-sim .tcs-dlg-host-toolbar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 10px;
  background: #f7f8f9;
  border-bottom: 1px solid #dde0e4;
  gap: 6px;
  flex-shrink: 0;
}

.tcs-sim .tcs-dlg-host-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.tcs-sim .tcs-dlg-host-btn:hover {
  background: #f0f4ff;
  border-color: #93c5fd;
}

.tcs-sim .tcs-dlg-host-btn-icon { font-size: 1rem; line-height: 1; }

/* Host document body */
.tcs-sim .tcs-dlg-host-body {
  flex: 1;
  padding: 20px;
  background: #ffffff;
  overflow-y: auto;
}

.tcs-sim .tcs-dlg-host-doc {
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.7;
  color: #1f2937;
}

.tcs-sim .tcs-dlg-host-doc.is-empty {
  color: #9ca3af;
  font-style: italic;
}

/* ── Dialog overlay + window ──────────────────────────────────────────────── */
.tcs-sim .tcs-dlg-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tcs-sim .tcs-dlg-overlay.is-open { display: flex; }

.tcs-sim .tcs-dlg-dialog {
  width: min(440px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #9aa4b2;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.tcs-sim .tcs-dlg-titlebar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 8px 0 14px;
  background: #2563eb;
  flex-shrink: 0;
}

.tcs-sim .tcs-dlg-titlebar-text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.tcs-sim .tcs-dlg-titlebar-close {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-dlg-titlebar-close:hover { background: rgba(255, 255, 255, 0.2); }

.tcs-sim .tcs-dlg-body {
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 12px;
  overflow-y: auto;
}

/* ── Location bar (save/open) ─────────────────────────────────────────────── */
.tcs-sim .tcs-dlg-locbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tcs-sim .tcs-dlg-back-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-dlg-back-btn:hover:not(:disabled) { background: #e9eaec; }
.tcs-sim .tcs-dlg-back-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.tcs-sim .tcs-dlg-path {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── File list (save/open) ────────────────────────────────────────────────── */
.tcs-sim .tcs-dlg-filelist {
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #ffffff;
  min-height: 150px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.tcs-sim .tcs-dlg-filelist-empty {
  padding: 24px 12px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
}

.tcs-sim .tcs-dlg-filerow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-dlg-filerow:hover { background: #f0f4ff; }

.tcs-sim .tcs-dlg-filerow.is-selected {
  background: #dbeafe;
  border-color: #93c5fd;
}

.tcs-sim .tcs-dlg-filerow-icon { font-size: 1.1rem; line-height: 1; flex-shrink: 0; }

.tcs-sim .tcs-dlg-filerow-label {
  font-size: 0.85rem;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcs-sim .tcs-dlg-filerow.is-folder .tcs-dlg-filerow-label { font-weight: 600; }

/* ── Footer fields (filename / type / printer / copies) ───────────────────── */
.tcs-sim .tcs-dlg-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tcs-sim .tcs-dlg-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tcs-sim .tcs-dlg-field-label {
  flex-shrink: 0;
  width: 92px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.tcs-sim .tcs-dlg-filename-input,
.tcs-sim .tcs-dlg-type-select,
.tcs-sim .tcs-dlg-printer-select {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.85rem;
  color: #111827;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.tcs-sim .tcs-dlg-filename-input:focus,
.tcs-sim .tcs-dlg-type-select:focus,
.tcs-sim .tcs-dlg-printer-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tcs-sim .tcs-dlg-filename-input.is-readonly {
  background: #f3f4f6;
  color: #4b5563;
  cursor: default;
}

/* ── Copies stepper (print) ───────────────────────────────────────────────── */
.tcs-sim .tcs-dlg-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  overflow: hidden;
}

.tcs-sim .tcs-dlg-stepper-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  color: #374151;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.1s ease;
}

.tcs-sim .tcs-dlg-stepper-btn:hover { background: #e5e7eb; }

.tcs-sim .tcs-dlg-stepper-count {
  width: 44px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

/* ── Print preview ────────────────────────────────────────────────────────── */
.tcs-sim .tcs-dlg-print-preview {
  display: flex;
  justify-content: center;
  padding: 8px;
  background: #f3f4f6;
  border-radius: 4px;
}

.tcs-sim .tcs-dlg-print-sheet {
  width: 120px;
  min-height: 150px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  font-size: 0.5rem;
  line-height: 1.5;
  color: #6b7280;
  white-space: pre-wrap;
  overflow: hidden;
}

/* ── Action buttons ───────────────────────────────────────────────────────── */
.tcs-sim .tcs-dlg-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.tcs-sim .tcs-dlg-action-btn {
  height: 34px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.tcs-sim .tcs-dlg-action-btn--secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.tcs-sim .tcs-dlg-action-btn--secondary:hover { background: #e9eaec; }

.tcs-sim .tcs-dlg-action-btn--primary {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.tcs-sim .tcs-dlg-action-btn--primary:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

/* ── Status bar ───────────────────────────────────────────────────────────── */
.tcs-sim .tcs-dlg-statusbar {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  background: #eaecef;
  border-top: 1px solid #d0d4d9;
  font-size: 0.72rem;
  color: #5f6b7a;
  gap: 12px;
}

.tcs-sim .tcs-dlg-status-info {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tcs-sim .tcs-dlg-status-step {
  font-weight: 600;
  color: #3a4451;
  flex-shrink: 0;
}
