    /* App-specific body */
    body {
      font-size: 14px;
    }

    /* ── Login screen ── */
    .login-screen {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg);
    }

    .login-card {
      background: var(--surface);
      border: 1px solid var(--border-hi);
      border-radius: 12px;
      padding: 40px 36px;
      width: 100%;
      max-width: 380px;
      display: flex;
      flex-direction: column;
      gap: 20px;
      box-shadow: 0 16px 48px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.03) inset;
    }

    .login-header {
      text-align: center;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .login-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--text-hi);
    }

    .login-subtitle {
      font-size: 14px;
      color: var(--muted);
    }

    .login-field {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .login-field input {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text-hi);
      font-family: var(--font-mono);
      font-size: 13px;
      padding: 10px 12px;
      width: 100%;
      outline: none;
      transition: border-color 0.15s;
    }

    .login-field input:focus {
      border-color: var(--cyan-dim);
      box-shadow: 0 0 0 2px rgba(34,211,238,.08);
    }

    .login-field input::placeholder {
      color: var(--dim);
      font-family: var(--font-ui);
    }

    .login-error {
      font-size: 13px;
      color: var(--rose);
      min-height: 16px;
    }

    /* Primary button — "lit terminal indicator" treatment.
       Cyan-bordered surface element with a subtle LED-like outer glow.
       Used full-width on auth screens (.btn-signin) and inline in chrome (.btn-primary).
       The shared visual language is captured in the rules below; layout-specific
       properties (padding, width, font-size) stay on the individual classes. */
    .btn-signin,
    .btn.btn-primary {
      background: var(--surface2);
      border: 1px solid var(--cyan-dim);
      border-radius: var(--radius);
      color: var(--cyan);
      cursor: pointer;
      font-family: var(--font-ui);
      font-weight: 500;
      letter-spacing: 0.03em;
      transition:
        border-color 180ms cubic-bezier(0.2, 0, 0, 1),
        color       180ms cubic-bezier(0.2, 0, 0, 1),
        box-shadow  180ms cubic-bezier(0.2, 0, 0, 1);
      box-shadow:
        inset 0 1px 0 0 rgba(0, 212, 255, 0.06),
        0 1px 2px 0 rgba(0, 0, 0, 0.4),
        0 0 18px -8px rgba(0, 212, 255, 0.25);
    }

    .btn-signin {
      font-size: 14px;
      padding: 11px 16px;
      width: 100%;
    }

    .btn-signin:not(:disabled):hover,
    .btn.btn-primary:not(:disabled):hover {
      background: var(--surface2);
      border-color: var(--cyan);
      color: var(--text-hi);
      box-shadow:
        inset 0 1px 0 0 rgba(0, 212, 255, 0.18),
        0 1px 2px 0 rgba(0, 0, 0, 0.4),
        0 0 24px -4px rgba(0, 212, 255, 0.4);
    }

    .btn-signin:not(:disabled):active,
    .btn.btn-primary:not(:disabled):active {
      transition-duration: 60ms;
      transform: none;
      border-color: var(--cyan);
      color: var(--cyan);
      box-shadow:
        inset 0 1px 2px 0 rgba(0, 0, 0, 0.55),
        0 0 0 1px transparent,
        0 0 0 0 rgba(0, 212, 255, 0);
    }

    .btn-signin:not(:disabled):focus-visible,
    .btn.btn-primary:not(:disabled):focus-visible {
      outline: none;
      border-color: var(--cyan);
      box-shadow:
        inset 0 1px 0 0 rgba(0, 212, 255, 0.18),
        0 0 0 2px var(--surface),
        0 0 0 3px var(--cyan),
        0 0 24px -4px rgba(0, 212, 255, 0.4);
    }

    .btn-signin:disabled,
    .btn.btn-primary:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      box-shadow:
        inset 0 1px 0 0 rgba(0, 212, 255, 0.04),
        0 1px 2px 0 rgba(0, 0, 0, 0.4);
    }

    /* ── Main app layout ── */
    .app-layout {
      display: grid;
      grid-template-columns: 220px 1fr;
      height: 100vh;
    }

    /* ── Sidebar ── */
    .sidebar {
      background: linear-gradient(180deg, var(--surface) 0%, rgba(15,20,32,.95) 100%);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      padding: 0;
      overflow: hidden;
    }

    .sidebar-agent {
      padding: 20px 16px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .agent-avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: var(--cyan-dim);
      color: var(--bg);
      font-weight: 700;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      text-transform: uppercase;
    }

    .agent-info {
      overflow: hidden;
      min-width: 0;
    }

    .agent-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-hi);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .agent-id {
      font-size: 12px;
      font-family: var(--font-mono);
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .credits-badge {
      font-size: 11px;
      font-family: var(--font-mono);
      color: var(--green);
      margin-top: 2px;
    }

    .profile-chevron {
      font-size: 8px;
      color: var(--muted);
      flex-shrink: 0;
      transition: transform 0.15s;
      align-self: center;
    }

    .profile-chevron.open {
      transform: rotate(180deg);
    }

    .profile-panel {
      padding: 8px 16px 12px;
      border-bottom: 1px solid var(--border);
    }

    .profile-row {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      padding: 3px 0;
      font-size: 12px;
      gap: 8px;
    }

    .profile-label {
      color: var(--muted);
      flex-shrink: 0;
    }

    .profile-value {
      color: var(--text);
      text-align: right;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .sidebar-nav {
      padding: 12px 8px;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .nav-link {
      background: none;
      border: none;
      border-radius: var(--radius);
      color: var(--muted);
      cursor: pointer;
      font-family: var(--font-ui);
      font-size: 14px;
      font-weight: 500;
      padding: 8px 10px;
      text-align: left;
      width: 100%;
      transition: background 0.1s, color 0.1s;
    }

    .nav-link:hover:not(:disabled) {
      background: var(--surface2);
      color: var(--text);
    }

    .nav-link.active {
      background: var(--cyan-bg);
      color: var(--cyan);
    }

    .nav-link:disabled {
      cursor: default;
      opacity: 0.4;
    }

    .sidebar-footer {
      padding: 12px 16px;
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .version-text {
      font-size: 12px;
      font-family: var(--font-mono);
      color: var(--dim);
    }

    .signout-link {
      font-size: 13px;
      color: var(--muted);
      cursor: pointer;
      background: none;
      border: none;
      font-family: var(--font-ui);
      padding: 0;
      text-decoration: none;
      transition: color 0.15s;
    }

    .signout-link:hover {
      color: var(--rose);
    }

    /* ── Content area ── */
    .content {
      background: var(--bg);
      overflow-y: auto;
      padding: 40px 48px;
    }

    /* ── Tasks content area (no padding, two-panel layout) ── */
    .content-tasks {
      background: var(--bg);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* ── View header ── */
    .view-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 28px;
    }

    .view-title {
      font-size: 20px;
      font-weight: 700;
      color: var(--text-hi);
    }

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

    /* ── Buttons ── */
    .btn {
      background: var(--surface2);
      border: 1px solid var(--border-hi);
      border-radius: var(--radius);
      color: var(--text);
      cursor: pointer;
      font-family: var(--font-ui);
      font-size: 13px;
      font-weight: 500;
      padding: 7px 14px;
      transition: all 0.15s;
    }

    .btn:hover {
      background: var(--surface3);
      border-color: var(--border-hi);
      color: var(--text-hi);
    }

    .btn:active { transform: scale(.97); }

    .btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* .btn-primary uses the "lit terminal indicator" treatment defined alongside
       .btn-signin (search "Primary button" above). The font-size and padding
       come from the base .btn class (13px / 7px 14px). */

    .btn-danger {
      color: var(--rose);
      border-color: transparent;
    }

    .btn-danger:hover {
      background: rgba(251,113,133,.1);
      border-color: rgba(251,113,133,.3);
      color: var(--rose);
    }

    .btn-sm {
      font-size: 12px;
      padding: 5px 10px;
    }

    .btn-icon {
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      padding: 4px 6px;
      border-radius: var(--radius);
      line-height: 1;
      transition: color 0.1s, background 0.1s;
      font-size: 14px;
    }

    .btn-icon:hover {
      color: var(--rose);
      background: rgba(251,113,133,.1);
    }

    /* ── Cards ── */
    .card-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .card {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 16px 20px;
      transition: border-color 0.15s;
    }

    .card:hover { border-color: var(--border-hi); }

    .card-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }

    .card-info {
      min-width: 0;
      flex: 1;
    }

    .card-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-hi);
      margin-bottom: 4px;
    }

    .card-id {
      font-size: 12px;
      font-family: var(--font-mono);
      color: var(--muted);
      margin-bottom: 6px;
    }

    .card-desc {
      font-size: 13px;
      color: var(--muted);
      line-height: 1.5;
      margin-bottom: 8px;
    }

    .card-actions {
      display: flex;
      gap: 6px;
      flex-shrink: 0;
      align-items: flex-start;
    }

    /* ── Tags / Capabilities ── */
    .tag-list {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: 6px;
    }

    .tag {
      background: var(--surface3);
      border: 1px solid var(--border);
      border-radius: 4px;
      color: var(--muted);
      font-size: 12px;
      padding: 2px 7px;
    }

    .tag-cyan {
      background: var(--cyan-bg);
      border-color: var(--cyan-dim);
      color: var(--cyan);
    }

    /* ── Status badges ── */
    .badge {
      display: inline-flex;
      align-items: center;
      border-radius: 4px;
      font-size: 12px;
      font-weight: 600;
      padding: 2px 7px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .badge-submitted  { background: var(--amber-bg);  color: var(--amber);  border: 1px solid rgba(251,191,36,.25); }
    .badge-working    { background: var(--cyan-bg);    color: var(--cyan);   border: 1px solid rgba(34,211,238,.2); }
    .badge-input-required { background: var(--violet-bg); color: var(--violet); border: 1px solid rgba(167,139,250,.25); }
    .badge-completed  { background: var(--green-bg);   color: var(--green);  border: 1px solid rgba(52,211,153,.2); }
    .badge-failed     { background: var(--rose-bg);    color: var(--rose);   border: 1px solid rgba(251,113,133,.2); }
    .badge-cancelled  { background: var(--surface3);   color: var(--muted);  border: 1px solid var(--border); }

    /* ── Empty state ── */
    .empty-state {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 48px 32px;
      text-align: center;
      color: var(--muted);
      font-size: 14px;
    }

    /* ── Inline panels (generate code / redeem code) ── */
    .inline-panel {
      background: var(--surface);
      border: 1px solid var(--border-hi);
      border-radius: var(--radius-lg);
      padding: 20px 24px;
      margin-bottom: 20px;
    }

    .inline-panel-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-hi);
      margin-bottom: 12px;
    }

    .code-display {
      background: var(--surface2);
      border: 1px solid var(--border-hi);
      border-radius: var(--radius);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      margin-bottom: 10px;
    }

    .code-text {
      font-family: var(--font-mono);
      font-size: 22px;
      font-weight: 700;
      color: var(--cyan);
      letter-spacing: 0.08em;
    }

    .code-expiry {
      font-size: 13px;
      color: var(--muted);
    }

    .inline-input-row {
      display: flex;
      gap: 8px;
    }

    .inline-input-row input {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text-hi);
      font-family: var(--font-mono);
      font-size: 14px;
      font-weight: 500;
      letter-spacing: 0.04em;
      padding: 8px 12px;
      flex: 1;
      outline: none;
      transition: border-color 0.15s;
      text-transform: uppercase;
    }

    .inline-input-row input:focus {
      border-color: var(--cyan-dim);
    }

    .inline-input-row input::placeholder {
      color: var(--dim);
      text-transform: none;
      font-family: var(--font-ui);
      font-size: 13px;
      letter-spacing: 0;
    }

    /* ── Discovery search ── */
    .search-row {
      margin-bottom: 20px;
    }

    .search-row input {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text-hi);
      font-family: var(--font-ui);
      font-size: 14px;
      padding: 9px 14px;
      width: 100%;
      max-width: 400px;
      outline: none;
      transition: border-color 0.15s;
    }

    .search-row input:focus {
      border-color: var(--cyan-dim);
    }

    .search-row input::placeholder {
      color: var(--dim);
    }

    /* ── Toast ── */
    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: var(--surface3);
      border: 1px solid var(--border-hi);
      border-radius: var(--radius);
      color: var(--text-hi);
      font-size: 14px;
      padding: 10px 18px;
      z-index: 100;
      box-shadow: 0 8px 32px rgba(0,0,0,.5);
      backdrop-filter: blur(8px);
      transition: opacity 0.3s;
    }

    /* ── Stats row ── */
    .stat-row {
      display: flex;
      gap: 16px;
      font-size: 13px;
      color: var(--muted);
      margin-top: 8px;
    }

    .stat-row span {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    /* ── Tasks two-panel layout ── */
    .tasks-panel {
      display: grid;
      grid-template-columns: 280px 1fr;
      height: 100%;
      overflow: hidden;
    }

    /* ── Task list (left panel) ── */
    .task-list-panel {
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--surface);
    }

    .task-list-header {
      padding: 16px 14px 12px;
      border-bottom: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex-shrink: 0;
    }

    .task-list-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .task-list-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-hi);
    }

    .task-filter-select {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text);
      font-family: var(--font-ui);
      font-size: 12px;
      padding: 4px 8px;
      outline: none;
      cursor: pointer;
      width: 100%;
    }

    .task-filter-select:focus {
      border-color: var(--cyan-dim);
    }

    .task-list-scroll {
      flex: 1;
      overflow-y: auto;
      padding: 8px 6px;
    }

    .task-card {
      background: none;
      border: 1px solid transparent;
      border-radius: var(--radius);
      cursor: pointer;
      padding: 10px 10px;
      width: 100%;
      text-align: left;
      transition: background 0.1s, border-color 0.1s;
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-bottom: 2px;
      position: relative;
    }

    .task-card:hover {
      background: var(--surface2);
      border-color: var(--border);
    }

    .task-card.selected {
      background: var(--cyan-bg);
      border-color: var(--cyan-dim);
    }

    .task-card-title-row {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .task-card-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-hi);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
      min-width: 0;
    }

    .unread-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--cyan);
      flex-shrink: 0;
    }

    .task-card-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
    }

    .task-card-agent {
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
      min-width: 0;
    }

    .task-card-time {
      font-size: 12px;
      color: var(--dim);
      flex-shrink: 0;
    }

    /* ── New task form ── */
    .new-task-form {
      background: var(--surface2);
      border-bottom: 1px solid var(--border);
      padding: 14px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex-shrink: 0;
    }

    .new-task-form-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-hi);
    }

    .form-field {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .form-label {
      font-size: 12px;
      color: var(--muted);
      font-weight: 500;
    }

    .form-input {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text-hi);
      font-family: var(--font-ui);
      font-size: 13px;
      padding: 7px 10px;
      outline: none;
      transition: border-color 0.15s;
      width: 100%;
    }

    .form-input:focus {
      border-color: var(--cyan-dim);
      box-shadow: 0 0 0 2px rgba(34,211,238,.06);
    }

    .form-input::placeholder {
      color: var(--dim);
    }

    select.form-input {
      cursor: pointer;
    }

    textarea.form-input {
      resize: vertical;
      min-height: 60px;
      font-family: var(--font-ui);
    }

    .new-task-form-actions {
      display: flex;
      gap: 6px;
      justify-content: flex-end;
    }

    /* ── Message thread (right panel) ── */
    .thread-panel {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--bg);
    }

    .thread-header {
      padding: 14px 20px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
      background: var(--surface);
    }

    .thread-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-hi);
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .thread-header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .task-meta-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 4px 20px;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      cursor: pointer;
      flex-shrink: 0;
      font-size: 11px;
      font-family: var(--font-mono);
      color: var(--muted);
    }

    .task-meta-row:hover {
      color: var(--text);
    }

    .meta-row-id {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .meta-row-time {
      flex-shrink: 0;
      font-family: var(--font-ui);
    }

    .meta-row-chevron {
      flex-shrink: 0;
      font-size: 8px;
      transition: transform 0.15s;
    }

    .meta-row-chevron.open {
      transform: rotate(180deg);
    }

    .task-meta-panel {
      padding: 10px 20px;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      flex-shrink: 0;
      overflow: hidden;
    }

    .meta-grid {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 4px 12px;
      font-size: 12px;
    }

    .meta-label {
      color: var(--muted);
      white-space: nowrap;
    }

    .meta-value {
      color: var(--text);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
    }

    .meta-value.mono {
      font-family: var(--font-mono);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .meta-id {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--muted);
      margin-left: 4px;
    }

    .btn-copy {
      background: none;
      border: 1px solid var(--border);
      border-radius: 3px;
      color: var(--muted);
      cursor: pointer;
      font-size: 11px;
      padding: 1px 4px;
      line-height: 1;
      flex-shrink: 0;
    }

    .btn-copy:hover {
      color: var(--text-hi);
      background: var(--surface2);
    }

    .status-select {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text);
      font-family: var(--font-ui);
      font-size: 12px;
      padding: 4px 8px;
      outline: none;
      cursor: pointer;
    }

    .status-select:focus {
      border-color: var(--cyan-dim);
    }

    .thread-messages {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    /* ── Message bubbles ── */
    .msg-row {
      display: flex;
      flex-direction: column;
      gap: 3px;
      max-width: 75%;
    }

    .msg-row.own {
      align-self: flex-end;
      align-items: flex-end;
    }

    .msg-row.other {
      align-self: flex-start;
      align-items: flex-start;
    }

    .msg-sender {
      font-size: 12px;
      color: var(--muted);
      font-weight: 500;
    }

    .msg-bubble {
      border-radius: var(--radius-lg);
      padding: 10px 14px;
      font-size: 14px;
      line-height: 1.55;
      word-break: break-word;
      position: relative;
    }

    .msg-row.own .msg-bubble {
      background: var(--cyan-bg);
      border: 1px solid rgba(34,211,238,.15);
      color: var(--text-hi);
      border-bottom-right-radius: 4px;
    }

    .msg-row.other .msg-bubble {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      border-bottom-left-radius: 4px;
    }

    .msg-placeholder {
      color: var(--muted);
      font-style: italic;
    }

    .msg-footer {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .msg-time {
      font-size: 10px;
      color: var(--muted);
    }

    .msg-delete-btn {
      background: none;
      border: none;
      color: var(--dim);
      cursor: pointer;
      font-size: 12px;
      padding: 1px 4px;
      border-radius: 3px;
      line-height: 1;
      opacity: 0;
      transition: opacity 0.1s, color 0.1s;
    }

    .msg-row:hover .msg-delete-btn {
      opacity: 1;
    }

    .msg-delete-btn:hover {
      color: var(--rose);
    }

    /* File message */
    .msg-file {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .msg-file-name {
      font-weight: 600;
    }

    .msg-file-size {
      font-size: 12px;
      color: var(--muted);
    }

    .msg-file-link {
      color: var(--cyan);
      text-decoration: none;
      font-size: 13px;
    }

    .msg-file-link:hover {
      text-decoration: underline;
    }

    .msg-file-link.disabled {
      color: var(--muted);
      cursor: not-allowed;
      text-decoration: none;
    }

    .encrypted-badge {
      background: var(--surface3);
      border: 1px solid var(--border);
      border-radius: 3px;
      color: var(--muted);
      font-size: 10px;
      padding: 1px 6px;
      margin-left: 4px;
    }

    /* ── Send form ── */
    .send-form {
      padding: 14px 20px;
      border-top: 1px solid var(--border);
      display: flex;
      gap: 10px;
      align-items: flex-end;
      flex-shrink: 0;
      background: var(--surface);
    }

    .send-textarea {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text-hi);
      font-family: var(--font-ui);
      font-size: 14px;
      line-height: 1.5;
      padding: 9px 12px;
      flex: 1;
      outline: none;
      resize: none;
      min-height: 40px;
      max-height: 120px;
      transition: border-color 0.15s;
      overflow-y: auto;
    }

    .send-textarea:focus {
      border-color: var(--cyan-dim);
      box-shadow: 0 0 0 2px rgba(34,211,238,.06);
    }

    .send-textarea::placeholder {
      color: var(--dim);
    }

    /* ── Thread empty state ── */
    .thread-empty {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      font-size: 14px;
      background: var(--bg);
    }

    /* ── Task list empty state ── */
    .task-list-empty {
      padding: 24px 12px;
      text-align: center;
      color: var(--muted);
      font-size: 13px;
    }

    /* ── Key import section in sidebar ── */
    .sidebar-key {
      padding: 10px 16px 12px;
      border-bottom: 1px solid var(--border);
    }

    .key-status-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .key-status-icon {
      font-size: 14px;
      flex-shrink: 0;
    }

    .key-status-text {
      font-size: 12px;
      color: var(--muted);
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .key-status-text.loaded {
      color: var(--green);
    }

    .btn-key {
      background: var(--surface2);
      border: 1px solid var(--border-hi);
      border-radius: var(--radius);
      color: var(--muted);
      cursor: pointer;
      font-family: var(--font-ui);
      font-size: 12px;
      font-weight: 500;
      padding: 4px 9px;
      transition: background 0.1s, color 0.1s, border-color 0.1s;
      white-space: nowrap;
    }

    .btn-key:hover {
      background: var(--surface3);
      color: var(--text-hi);
      border-color: var(--border-hi);
    }

    .btn-key-clear {
      color: var(--rose);
      border-color: transparent;
      background: none;
    }

    .btn-key-clear:hover {
      background: rgba(251,113,133,.1);
      border-color: rgba(251,113,133,.3);
      color: var(--rose);
    }

    /* ── Encryption banner in thread ── */
    .enc-banner {
      display: flex;
      align-items: center;
      gap: 10px;
      background: rgba(167,139,250,.07);
      border: 1px solid rgba(167,139,250,.2);
      border-radius: var(--radius);
      padding: 10px 14px;
      margin: 12px 20px 0;
      flex-shrink: 0;
    }

    .enc-banner-text {
      font-size: 13px;
      color: var(--violet);
      flex: 1;
    }

    .btn-enc-import {
      background: rgba(167,139,250,.15);
      border: 1px solid rgba(167,139,250,.3);
      border-radius: var(--radius);
      color: var(--violet);
      cursor: pointer;
      font-family: var(--font-ui);
      font-size: 12px;
      font-weight: 600;
      padding: 4px 10px;
      white-space: nowrap;
      transition: background 0.1s;
    }

    .btn-enc-import:hover {
      background: rgba(167,139,250,.25);
    }

    /* Decryption-failed styling */
    .msg-decrypt-failed {
      color: var(--rose);
      font-style: italic;
      font-size: 13px;
    }
