    :root {
      color-scheme: light;
      --bg: #f5f5f5;
      --panel: #ffffff;
      --line: #d9d9d9;
      --text: #161513;
      --muted: #5b5a57;
      --accent: #c74634;
      --accent-dark: #9f2f23;
      --danger: #c74634;
      --warn: #c26d1a;
      --ok: #2e7d32;
      --surface-dark: #1f1d1b;
      --surface-dark-2: #312d2a;
      --shadow: 0 10px 24px rgba(22, 21, 19, 0.08);
    }

    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: "Oracle Sans", "Segoe UI", system-ui, sans-serif;
      background:
        linear-gradient(180deg, #26211e 0 184px, var(--bg) 184px 100%);
      color: var(--text);
    }

    .global-header {
      background: linear-gradient(180deg, #161513 0%, var(--surface-dark) 100%);
      color: white;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .global-header-inner {
      max-width: 1240px;
      margin: 0 auto;
      padding: 14px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 14px;
      font-size: 14px;
      letter-spacing: 0.02em;
    }

    .brand-mark {
      font-size: 22px;
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    .brand-sub {
      color: rgba(255, 255, 255, 0.72);
    }

    .session-bar {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .session-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 40px;
      padding: 0 14px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
      color: rgba(255, 255, 255, 0.92);
      font-size: 14px;
    }

    .session-chip strong {
      color: white;
      font-weight: 700;
    }

    main {
      max-width: 1240px;
      margin: 0 auto;
      padding: 28px 24px 36px;
    }

    .auth-shell[hidden],
    .app-shell[hidden],
    .session-bar[hidden] {
      display: none !important;
    }

    .login-card {
      width: min(460px, 100%);
      margin: 18px auto 0;
      padding: 24px;
      border-radius: 18px;
      border: 1px solid var(--line);
      background: var(--panel);
      box-shadow: var(--shadow);
    }

    .login-card .panel-title {
      margin-bottom: 12px;
    }

    .login-copy {
      margin: 0 0 18px;
      color: var(--muted);
      line-height: 1.5;
    }

    .login-form {
      display: grid;
      gap: 14px;
    }

    .login-field {
      display: flex;
      flex-direction: column;
      gap: 6px;
      color: var(--muted);
      font-size: 13px;
    }

    .login-field input {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      font: inherit;
      color: var(--text);
      background: #fff;
    }

    .login-form button {
      justify-self: start;
      border: 0;
      border-radius: 999px;
      padding: 10px 18px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: white;
      background: var(--accent);
      min-height: 44px;
      transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
    }

    .login-form button:hover {
      transform: translateY(-1px);
    }

    .login-card .banner {
      margin-top: 14px;
    }

    .hero {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
      gap: 18px;
      align-items: stretch;
      margin-bottom: 22px;
    }

    .hero-panel {
      background: linear-gradient(135deg, #2a2421 0%, #1f1d1b 100%);
      color: white;
      border-radius: 18px;
      padding: 26px 26px 24px;
      box-shadow: var(--shadow);
      position: relative;
      overflow: hidden;
    }

    .hero-panel::after {
      content: "";
      position: absolute;
      inset: auto -40px -60px auto;
      width: 180px;
      height: 180px;
      background: radial-gradient(circle, rgba(199, 70, 52, 0.34) 0%, rgba(199, 70, 52, 0) 70%);
      pointer-events: none;
    }

    .hero-eyebrow {
      margin: 0 0 10px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.72);
    }

    h1 {
      margin: 0 0 10px;
      font-size: 38px;
      line-height: 1.02;
      letter-spacing: -0.02em;
    }

    p {
      margin: 0;
      color: var(--muted);
    }

    .hero-panel p {
      max-width: 60ch;
      color: rgba(255, 255, 255, 0.82);
      font-size: 15px;
      line-height: 1.5;
    }

    .hero-side {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 18px;
      box-shadow: var(--shadow);
    }

    .toolbar {
      margin: 0 0 24px;
      padding: 18px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 18px;
      box-shadow: var(--shadow);
    }

    .toolbar-group {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      column-gap: 18px;
      row-gap: 14px;
      margin-top: 16px;
    }

    .toolbar-group:first-of-type {
      margin-top: 0;
    }

    .toolbar label {
      display: flex;
      flex-direction: column;
      gap: 6px;
      color: var(--muted);
      font-size: 13px;
      min-width: 220px;
    }

    .toolbar input,
    .toolbar select {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      font: inherit;
      color: var(--text);
      background: #fff;
    }

    .toolbar button,
    .device-actions button {
      border: 0;
      border-radius: 999px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: white;
      transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
    }

    .toolbar button {
      background: var(--accent);
      min-height: 44px;
      align-self: end;
    }

    .toolbar button:hover,
    .device-actions button:hover {
      transform: translateY(-1px);
    }

    .toolbar button.quick-trigger { background: var(--danger); }
    .toolbar button.quick-ack { background: var(--warn); }
    .toolbar button.quick-clear { background: var(--surface-dark-2); }
    .toolbar button.secondary { background: #6e625c; }

    button[disabled] {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .loading {
      position: relative;
      opacity: 0.85;
    }

    .panel-title {
      grid-column: 1 / -1;
      margin: 0;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent);
    }

    .panel-subtitle {
      grid-column: 1 / -1;
      margin: 0 0 10px;
      font-size: 13px;
      color: var(--muted);
      line-height: 1.55;
    }

    .hero-side .panel-title {
      margin-bottom: 14px;
    }

    .hero-side .panel-subtitle:last-of-type {
      margin-bottom: 0;
    }

    .stats {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin: 0 0 16px;
    }

    .modal-header button {
      border: 0;
      border-radius: 999px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: white;
      background: #6e625c;
    }

    .stat {
      padding: 12px 14px;
      border-radius: 14px;
      background: linear-gradient(180deg, #ffffff 0%, #faf9f8 100%);
      border: 1px solid var(--line);
      font-size: 13px;
      color: var(--muted);
      min-width: 150px;
      box-shadow: var(--shadow);
    }

    .stat strong {
      display: block;
      color: var(--text);
      font-size: 18px;
    }

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

    .card {
      display: flex;
      flex-direction: column;
      gap: 0;
      background: linear-gradient(180deg, #ffffff 0%, #fcfbfa 100%);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 20px;
      box-shadow: var(--shadow);
      transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }

    .card.jump-target {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(199, 70, 52, 0.16), 0 10px 25px rgba(20, 33, 50, 0.08);
      transform: translateY(-2px);
    }

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

    .device-title {
      min-width: 0;
      flex: 1 1 auto;
    }

    .device-name-row {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .device-name {
      min-width: 0;
      font-size: 18px;
      font-weight: 700;
      word-break: break-word;
    }

    .device-name-input {
      min-width: 0;
      width: min(100%, 320px);
      border: 1px solid rgba(49, 45, 42, 0.18);
      border-radius: 10px;
      padding: 6px 10px;
      font: inherit;
      font-size: 18px;
      font-weight: 700;
      color: var(--text);
      background: #fff;
      transition: border-color 0.14s ease, box-shadow 0.14s ease;
    }

    .device-name-input:focus {
      outline: 0;
      border-color: rgba(199, 70, 52, 0.55);
      box-shadow: 0 0 0 3px rgba(199, 70, 52, 0.12);
    }

    .device-name-actions {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      flex-shrink: 0;
    }

    .icon-button {
      border: 0;
      background: transparent;
      color: rgba(49, 45, 42, 0.58);
      width: 28px;
      height: 28px;
      min-width: 28px;
      min-height: 28px;
      border-radius: 999px;
      padding: 0;
      font: inherit;
      font-size: 15px;
      line-height: 1;
      cursor: pointer;
      transition: color 0.14s ease, background 0.14s ease;
    }

    .icon-button:hover {
      color: var(--surface-dark);
      background: rgba(49, 45, 42, 0.06);
    }

    .icon-button-confirm {
      color: rgba(46, 125, 50, 0.72);
    }

    .icon-button-cancel {
      color: rgba(110, 98, 92, 0.72);
    }

    .icon-button[disabled] {
      background: transparent;
      color: rgba(49, 45, 42, 0.3);
    }

    .device-original-name {
      margin-top: 4px;
      font-size: 11px;
      color: rgba(91, 90, 87, 0.72);
    }

    .serial {
      margin-top: 4px;
      font-size: 13px;
      color: var(--muted);
    }

    .status {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      white-space: nowrap;
    }

    .status.online { background: #edf7ee; color: var(--ok); }
    .status.offline { background: #efedeb; color: #5f5955; }
    .status.triggered { background: #fbe9e7; color: var(--danger); }
    .status.acknowledged { background: #fff1e2; color: var(--warn); }
    .status.confirmed { background: #f6ede8; color: var(--accent-dark); }
    .status.idle { background: #f1efed; color: var(--surface-dark-2); }

    dl {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 8px 12px;
      margin: 0 0 18px;
      font-size: 14px;
    }

    dt {
      color: var(--muted);
    }

    dd {
      margin: 0;
      font-weight: 600;
      word-break: break-word;
    }

    .device-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: auto;
      padding-top: 16px;
    }

    .trigger { background: var(--danger); }
    .ack { background: var(--warn); }
    .clear { background: var(--surface-dark-2); }
    .sim-push { background: #2b6cb0; }
    .delete { background: #7f1d1d; }

    .note {
      margin-top: 8px;
      font-size: 12px;
      color: var(--muted);
    }

    .card-status-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin: 10px 0 14px;
    }

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

    .overview-item {
      padding: 10px 12px;
      border-radius: 12px;
      background: #faf8f6;
      border: 1px solid #eee5df;
      min-width: 0;
    }

    .overview-label {
      display: block;
      margin: 0 0 4px;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .overview-value {
      display: block;
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      word-break: break-word;
    }

    .overview-subvalue {
      display: block;
      margin-top: 4px;
      font-size: 12px;
      line-height: 1.45;
      color: var(--muted);
    }

    .overview-subvalue.alert {
      color: var(--danger);
      font-weight: 700;
    }

    .overview-link {
      display: inline-flex;
      margin-top: 8px;
      font-size: 12px;
      font-weight: 700;
      color: var(--accent);
      text-decoration: none;
    }

    .overview-link:hover {
      text-decoration: underline;
    }

    .device-chat {
      display: grid;
      gap: 12px;
    }

    .ticket-inline {
      display: grid;
      grid-template-columns: 96px minmax(0, 1fr) 38px;
      gap: 10px;
      align-items: center;
      margin: 0 0 18px;
    }

    .assignment-stack {
      display: grid;
      gap: 10px;
      margin: 0 0 18px;
    }

    .assignment-form {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .assignment-form .ticket-inline {
      margin: 0;
    }

    .assignment-form .full-span {
      grid-column: 1 / -1;
    }

    .assignment-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .assignment-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 700;
      background: #f4efec;
      color: var(--surface-dark-2);
    }

    .assignment-chip.checked-out {
      background: #edf7ee;
      color: var(--ok);
    }

    .assignment-chip.checked-in {
      background: #efedeb;
      color: #5f5955;
    }

    .assignment-chip.overdue {
      background: #fdecea;
      color: var(--danger);
    }

    .assignment-chip.due-soon {
      background: #fff4e8;
      color: var(--warn);
    }

    .assignment-subnote {
      font-size: 12px;
      color: var(--muted);
    }

    .assignment-helper {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
    }

    .ticket-inline-label {
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .ticket-inline input {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 8px 10px;
      font: inherit;
      color: var(--text);
      background: #fff;
      min-width: 0;
      transition: border-color 0.14s ease, box-shadow 0.14s ease;
    }

    .ticket-inline input.assignment-input-invalid {
      border-color: var(--danger);
      box-shadow: 0 0 0 3px rgba(199, 70, 52, 0.12);
      outline: 0;
    }

    .ticket-inline input.assignment-input-shake {
      animation: assignment-input-shake 0.22s ease-in-out;
    }

    .ticket-inline button {
      border: 1px solid var(--line);
      background: #fff;
      color: var(--surface-dark);
      border-radius: 10px;
      width: 38px;
      min-width: 38px;
      min-height: 38px;
      padding: 0;
      font-size: 18px;
      line-height: 1;
    }

    .ticket-inline-spacer {
      width: 38px;
      min-width: 38px;
      min-height: 38px;
    }

    .assignment-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 2px;
    }

    .assignment-field-message {
      margin-top: -6px;
      min-height: 16px;
      font-size: 12px;
      color: var(--danger);
    }

    @keyframes assignment-input-shake {
      0%, 100% { transform: translateX(0); }
      20% { transform: translateX(-4px); }
      40% { transform: translateX(4px); }
      60% { transform: translateX(-3px); }
      80% { transform: translateX(3px); }
    }

    .assignment-actions button {
      border: 0;
      border-radius: 999px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: white;
      transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
      background: #2b6cb0;
    }

    .assignment-actions button:hover {
      transform: translateY(-1px);
    }

    .assignment-actions button[disabled] {
      background: #aab4c0;
      opacity: 1;
      cursor: not-allowed;
      transform: none;
    }

    .device-chat-title {
      margin: 0;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent);
    }

    .chat-thread {
      display: grid;
      gap: 8px;
      margin-bottom: 12px;
      max-height: 320px;
      overflow-y: auto;
      padding-right: 4px;
      align-content: start;
    }

    .chat-bubble {
      padding: 10px 12px;
      border-radius: 14px;
      background: #f7f2ef;
      border: 1px solid #e4d8d0;
    }

    .chat-bubble-operator {
      background: #f7f2ef;
      border-color: #e4d8d0;
    }

    .chat-bubble-device {
      background: #eef7ef;
      border-color: #cfe3d1;
    }

    .chat-bubble-system {
      background: #f4f4f4;
      border-color: #dfdfdf;
    }

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

    .chat-bubble-body {
      font-size: 13px;
      line-height: 1.5;
      color: var(--text);
      white-space: pre-wrap;
      word-break: break-word;
    }

    .chat-empty {
      padding: 12px;
      border-radius: 14px;
      background: #faf7f5;
      border: 1px dashed #d6c9c1;
      font-size: 13px;
      color: var(--muted);
    }

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

    .chat-compose textarea {
      width: 100%;
      min-height: 88px;
      resize: vertical;
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      font: inherit;
      color: var(--text);
      background: #fff;
    }

    .chat-compose-actions {
      display: block;
    }

    .chat-compose-actions .chat-send-button {
      width: 100%;
      min-height: 44px;
      border: 0;
      border-radius: 12px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: white;
      background: #4a86c5;
      transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
    }

    .chat-compose-actions .chat-send-button:hover {
      transform: translateY(-1px);
      background: #2b6cb0;
    }

    .chat-compose-actions .chat-send-button[disabled] {
      background: #aab4c0;
      cursor: not-allowed;
      transform: none;
      opacity: 1;
    }

    .video-panel {
      display: grid;
      gap: 12px;
    }

    .video-summary {
      display: grid;
      gap: 8px;
    }

    .video-helper {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
    }

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

    .video-actions button {
      border: 0;
      border-radius: 999px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: white;
      transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
    }

    .video-actions button:hover {
      transform: translateY(-1px);
    }

    .video-actions .video-start,
    .video-actions .video-join {
      background: #2b6cb0;
    }

    .video-actions .video-stop {
      background: var(--surface-dark-2);
    }

    .video-status-line {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .video-surface {
      position: relative;
      min-height: 220px;
      border-radius: 16px;
      border: 1px solid #ddd1ca;
      background: linear-gradient(180deg, #1b1816 0%, #26211e 100%);
      overflow: hidden;
    }

    .video-surface video {
      display: block;
      width: 100%;
      aspect-ratio: 16 / 9;
      object-fit: cover;
      background: #000;
    }

    .video-placeholder {
      min-height: 220px;
      display: grid;
      place-items: center;
      padding: 18px;
      text-align: center;
      color: rgba(255, 255, 255, 0.82);
      font-size: 14px;
      line-height: 1.5;
    }

    .video-meta {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
      word-break: break-word;
    }

    .video-diagnostics {
      padding: 12px;
      border-radius: 12px;
      background: #faf7f5;
      border: 1px dashed #d6c9c1;
      font-size: 12px;
      line-height: 1.55;
      color: var(--surface-dark-2);
      word-break: break-word;
    }

    .troubleshooting-details {
      margin-top: 4px;
    }

    .troubleshooting-details[open] {
      margin-bottom: 2px;
    }

    .card.ringing {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(199, 70, 52, 0.18), 0 12px 30px rgba(22, 21, 19, 0.12);
    }

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

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

    .call-helper {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
    }

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

    .call-actions button {
      border: 0;
      border-radius: 999px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: white;
      transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
    }

    .call-actions button:hover {
      transform: translateY(-1px);
    }

    .call-actions .call-answer,
    .call-actions .call-unmute,
    .call-actions .call-mute {
      background: #2b6cb0;
    }

    .call-actions .call-decline {
      background: var(--warn);
    }

    .call-actions .call-end {
      background: var(--surface-dark-2);
    }

    .call-ringing {
      padding: 12px 14px;
      border-radius: 14px;
      background: #fbe9e7;
      border: 1px solid rgba(199, 70, 52, 0.26);
      color: var(--danger);
      font-size: 13px;
      font-weight: 700;
      animation: rocRingPulse 1.2s ease-in-out infinite;
    }

    .call-meta {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
      word-break: break-word;
    }

    .call-diagnostics {
      padding: 12px;
      border-radius: 12px;
      background: #faf7f5;
      border: 1px dashed #d6c9c1;
      font-size: 12px;
      line-height: 1.55;
      color: var(--surface-dark-2);
      word-break: break-word;
    }

    .modal-shell[hidden] {
      display: none !important;
    }

    .modal-shell {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: grid;
      place-items: center;
      padding: 24px;
    }

    .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(22, 21, 19, 0.62);
      backdrop-filter: blur(2px);
    }

    .modal-card {
      position: relative;
      width: min(960px, calc(100vw - 32px));
      max-height: calc(100vh - 32px);
      overflow: auto;
      border-radius: 20px;
      background: var(--panel);
      border: 1px solid #d8ccc4;
      box-shadow: 0 26px 70px rgba(22, 21, 19, 0.28);
    }

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

    .modal-body {
      padding: 18px;
    }

    .recording-player {
      width: 100%;
      min-height: 320px;
      border-radius: 16px;
      border: 1px solid #ddd1ca;
      background: #000;
    }

    @keyframes rocRingPulse {
      0% { box-shadow: 0 0 0 0 rgba(199, 70, 52, 0.22); }
      70% { box-shadow: 0 0 0 10px rgba(199, 70, 52, 0); }
      100% { box-shadow: 0 0 0 0 rgba(199, 70, 52, 0); }
    }

    .card-section {
      margin-top: 4px;
      border-top: 1px solid var(--line);
      padding-top: 12px;
    }

    .card-section > summary,
    .chat-archive details > summary,
    .troubleshooting-details > summary {
      display: flex;
      align-items: center;
      cursor: pointer;
      list-style: none;
    }

    .card-section > summary {
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .chat-archive details > summary {
      font-size: 13px;
      font-weight: 700;
      color: var(--surface-dark-2);
    }

    .troubleshooting-details > summary {
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
    }

    .card-section > summary::-webkit-details-marker,
    .chat-archive details > summary::-webkit-details-marker,
    .troubleshooting-details > summary::-webkit-details-marker {
      display: none;
    }

    .card-section > summary::marker,
    .chat-archive details > summary::marker,
    .troubleshooting-details > summary::marker {
      content: "";
    }

    .card-section > summary::before,
    .chat-archive details > summary::before,
    .troubleshooting-details > summary::before {
      content: "";
      display: inline-block;
      width: 8px;
      height: 8px;
      margin-right: 8px;
      flex: 0 0 auto;
      background: currentColor;
      clip-path: polygon(20% 10%, 30% 0, 100% 50%, 30% 100%, 20% 90%, 72% 50%);
      opacity: 0.8;
      transform: translateY(-1px) rotate(0deg);
      transform-origin: center;
      transition: transform 140ms ease;
    }

    .card-section[open] > summary::before,
    .chat-archive details[open] > summary::before,
    .troubleshooting-details[open] > summary::before {
      transform: translateY(-1px) rotate(90deg);
    }

    .card-section > summary:focus-visible,
    .chat-archive details > summary:focus-visible,
    .troubleshooting-details > summary:focus-visible {
      outline: 2px solid rgba(43, 108, 176, 0.35);
      outline-offset: 4px;
      border-radius: 8px;
    }

    .card-section-summary {
      display: inline-flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
    }

    .card-section-summary .assignment-chip,
    .card-section-summary .status {
      transform: translateY(-1px);
    }

    .card-section-meta {
      font-size: 12px;
      font-weight: 600;
      text-transform: none;
      letter-spacing: 0;
      color: var(--muted);
    }

    .card-section-body {
      margin-top: 12px;
      display: grid;
      gap: 12px;
    }

    .card-section dl {
      margin-top: 12px;
      margin-bottom: 0;
    }

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

    @media (max-width: 720px) {
      .overview-grid,
      .assignment-form {
        grid-template-columns: 1fr;
      }

      .ticket-inline {
        grid-template-columns: 1fr;
      }

      .ticket-inline-spacer {
        display: none;
      }
    }

    .chat-archive {
      margin-top: 12px;
      border-top: 1px solid var(--line);
      padding-top: 12px;
    }

    .chat-archive details {
      border: 1px solid #e6ddd7;
      border-radius: 14px;
      background: #fbf8f6;
      padding: 10px 12px;
    }

    .recording-selector {
      margin-top: 10px;
      display: grid;
      gap: 10px;
    }

    .recording-selector-label {
      display: block;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .recording-selector-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
    }

    .recording-selector-row select {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 10px 12px;
      font: inherit;
      color: var(--text);
      background: #fff;
      min-width: 0;
    }

    .recording-selector-row button {
      border: 0;
      border-radius: 999px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: white;
      background: #6e625c;
    }

    .archive-thread {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid #e6ddd7;
    }

    .archive-thread:first-of-type {
      margin-top: 10px;
      padding-top: 0;
      border-top: 0;
    }

    .archive-thread-meta {
      margin-bottom: 8px;
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
    }

    .empty {
      padding: 28px;
      text-align: center;
      color: var(--muted);
      background: var(--panel);
      border: 1px dashed #c9c1bc;
      border-radius: 18px;
      box-shadow: var(--shadow);
    }

    .banner {
      margin-bottom: 16px;
      padding: 12px 14px;
      border-radius: 12px;
      font-size: 14px;
      display: none;
    }

    .banner.error {
      display: block;
      background: #fbe9e7;
      color: #8b2a1f;
      border: 1px solid #f1c8c2;
    }

    .banner.info {
      display: block;
      background: #f7f2ef;
      color: #463d37;
      border: 1px solid #ddd1ca;
    }

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

    @media (max-width: 640px) {
      .global-header-inner,
      main {
        padding-left: 16px;
        padding-right: 16px;
      }

      h1 {
        font-size: 32px;
      }

      .recording-selector-row {
        grid-template-columns: 1fr;
      }
    }
  
