:root {
      --bg: #08111f;
      --panel: #0f1b2d;
      --panel-2: #15253d;
      --panel-3: #0b1626;
      --border: #2c3c58;
      --text: #edf4ff;
      --muted: #98abc7;
      --primary: #22c55e;
      --warn: #f59e0b;
      --danger: #ef4444;
      --info: #38bdf8;
      --shadow: 0 18px 50px rgba(0,0,0,.28);
      --radius: 16px;
    }
    * { box-sizing: border-box; }
    html, body { width: 100%; height: 100%; }
    body {
      margin: 0;
      font-family: Arial, Helvetica, sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(56,189,248,.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(34,197,94,.06), transparent 24%),
        linear-gradient(135deg, #06101d 0%, #08111f 50%, #101b2d 100%);
      overflow: hidden;
      user-select: none;
      -webkit-user-select: none;
    }
    .app-shell {
      height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 10px;
      gap: 10px;
    }
    .app-header {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      min-height: 58px;
      padding: 12px 16px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: rgba(15, 27, 45, 0.92);
      box-shadow: var(--shadow);
    }
    .app-title h1 { margin: 0 0 4px; font-size: 22px; line-height: 1.1; }
    .app-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
    .header-badges { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
    .badge {
      padding: 8px 12px;
      border-radius: 999px;
      font-size: 12px;
      border: 1px solid var(--border);
      color: var(--muted);
      background: rgba(255,255,255,.03);
      white-space: nowrap;
    }
    .workspace {
      flex: 1 1 auto;
      min-height: 0;
      display: grid;
      grid-template-columns: 335px minmax(0, 1fr);
      gap: 10px;
    }
    .panel, .viewer {
      min-height: 0;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: rgba(15, 27, 45, 0.95);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .panel { display: flex; flex-direction: column; }
    .panel-head, .viewer-head {
      flex: 0 0 auto;
      padding: 12px 14px;
      border-bottom: 1px solid var(--border);
      background: rgba(255,255,255,.02);
    }
    .panel-head h2, .viewer-head h2 { margin: 0; font-size: 16px; }
    .panel-body {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 12px;
      overflow: hidden;
    }
    .timer-box {
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 14px;
      background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
    }
    .timer-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
    .timer {
      font-size: 38px;
      font-weight: 700;
      letter-spacing: 2px;
      line-height: 1;
      color: #fff;
      margin-bottom: 10px;
      font-variant-numeric: tabular-nums;
    }
    .status {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 12px;
      border-radius: 999px;
      font-size: 12px;
      border: 1px solid var(--border);
      color: var(--muted);
      background: rgba(255,255,255,.02);
    }
    .status.running { color: #86efac; border-color: #166534; }
    .status.warning { color: #fcd34d; border-color: #92400e; }
    .status.danger { color: #fecaca; border-color: #991b1b; }
    .status.info { color: #7dd3fc; border-color: #075985; }
    .section { flex: 0 0 auto; }
    .section-title { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
    .btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
    button {
      appearance: none;
      border: 0;
      border-radius: 12px;
      min-height: 42px;
      padding: 10px 13px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 700;
      color: #fff;
      background: #334155;
    }
    button.primary { background: var(--primary); color: #052e16; }
    button.warn { background: var(--warn); color: #2c1700; }
    button.danger { background: var(--danger); }
    button.secondary { background: #475569; }
    button.info { background: var(--info); color: #082f49; }
    button:disabled { opacity: .55; cursor: not-allowed; }
    .meta-wrap { flex: 0 0 auto; min-height: 0; }
    .meta {
      list-style: none;
      padding: 0;
      margin: 0;
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: hidden;
      background: rgba(255,255,255,.01);
    }
    .meta li {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 11px;
      border-bottom: 1px solid rgba(152,171,199,.12);
      font-size: 12px;
    }
    .meta li:last-child { border-bottom: 0; }
    .meta li span:first-child { color: var(--muted); }
    .log-section {
      flex: 1 1 auto;
      min-height: 120px;
      display: flex;
      flex-direction: column;
    }
    .log-box {
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--panel-3);
      white-space: pre-wrap;
      line-height: 1.45;
      font-size: 11px;
    }
    .viewer {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }
    .viewer-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
    }
    .viewer-head small {
      color: var(--muted);
      font-size: 12px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 65%;
    }
    .viewer-body {
      position: relative;
      flex: 1 1 auto;
      min-height: 0;
      background: #ffffff;
    }
    .iframe-lock-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: radial-gradient(circle, rgba(20, 10, 15, 0.92) 0%, rgba(8, 8, 12, 0.96) 100%);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      z-index: 100;
      display: none;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      font-family: system-ui, -apple-system, sans-serif;
      padding: 30px;
      pointer-events: auto;
      transition: all 0.3s ease;
      box-shadow: inset 0 0 80px rgba(239, 68, 68, 0.15);
    }
    .iframe-lock-overlay.show {
      display: flex;
    }
    .lock-icon-container {
      width: 76px;
      height: 76px;
      background: rgba(239, 68, 68, 0.12);
      border: 2px solid rgba(239, 68, 68, 0.4);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 22px;
      box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
      animation: pulse-glow-sec 2s infinite;
    }
    .lock-emoji {
      font-size: 2.2rem;
      line-height: 1;
    }
    .lock-title {
      color: #ffffff;
      font-size: 1.6rem;
      font-weight: 700;
      margin: 0 0 6px;
      letter-spacing: 0.5px;
      text-align: center;
    }
    .lock-subtitle {
      color: #f87171;
      font-size: 0.95rem;
      font-weight: 600;
      margin: 0 0 14px;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      text-align: center;
    }
    .lock-desc {
      color: #98abc7;
      font-size: 0.9rem;
      font-weight: normal;
      text-align: center;
      max-width: 340px;
      line-height: 1.55;
      margin: 0;
    }
    @keyframes pulse-glow-sec {
      0% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
        border-color: rgba(239, 68, 68, 0.4);
      }
      50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.55);
        border-color: rgba(239, 68, 68, 0.8);
      }
      100% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
        border-color: rgba(239, 68, 68, 0.4);
      }
    }
    iframe {
      width: 100%;
      height: 100%;
      min-height: 100%;
      border: 0;
      display: block;
      background: #fff;
    }
    .overlay {
      position: fixed;
      inset: 0;
      z-index: 9999;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(30, 41, 59, 0.55);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
    .overlay.show { display: flex; }
    .overlay-card {
      width: 100%;
      max-width: 540px;
      padding: 22px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: #1e293b;
      box-shadow: 0 20px 60px rgba(0,0,0,.45);
    }
    .overlay-pill {
      display: inline-block;
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 12px;
      color: #fecaca;
      border: 1px solid rgba(239,68,68,.35);
      background: rgba(239,68,68,.1);
      margin-bottom: 12px;
    }
    .overlay-card h3 { margin: 0 0 10px; font-size: 22px; }
    .overlay-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.55; font-size: 14px; }
    .note-bar {
      flex: 0 0 auto;
      padding: 8px 12px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: rgba(15, 27, 45, 0.85);
      color: var(--muted);
      font-size: 11px;
      line-height: 1.5;
    }
    @media screen and (orientation: landscape) {
      .workspace { grid-template-columns: 320px minmax(0, 1fr); }
      .viewer-body { height: calc(100vh - 118px); }
    }
    @media screen and (max-width: 980px), screen and (orientation: portrait) {
      body { overflow: auto; }
      .app-shell { height: auto; min-height: 100vh; }
      .workspace { grid-template-columns: 1fr; }
      .viewer-body { height: 70vh; }
      .timer { font-size: 34px; }
    }
    .timer.danger-mode {
      color: var(--danger) !important;
      text-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
      display: inline-block;
      animation: timerPulse 1.5s infinite ease-in-out;
    }
    @keyframes timerPulse {
      0%, 100% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.08);
      }
    }