    :root {
      color-scheme: light;
      --color-red: #e41e26;
      --color-red-hover: #c21a20;
      --color-red-light: #fdf2f3;
      --color-red-glow: rgba(228, 30, 38, 0.15);
      --color-grey: #3f4243;
      --color-grey-dark: #202223;
      --color-grey-light: #f3f4f6;
      --color-grey-mid: #9ca3af;
      --color-bg-main: #fafafa;
      --color-bg-card: #ffffff;
      --color-border: #e5e7eb;
      --color-success: #10b981;
      --color-info: #3b82f6;
      --color-warning: #f59e0b;
      --color-danger: #ef4444;
      --perm-read: #4f8cff;
      --perm-write: #26c6a2;
      --perm-execute: #f2b84b;
      --perm-manage: #a56cff;
      --perm-share: #ef6f9c;
      --font-heading: "Outfit", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --border-radius-sm: 4px;
      --border-radius-md: 8px;
      --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
      --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
      --bg: var(--color-bg-main);
      --panel: var(--color-bg-card);
      --line: var(--color-border);
      --text: var(--color-grey-dark);
      --muted: var(--color-grey);
      --accent: var(--color-red);
      --accent-strong: var(--color-red-hover);
      --danger: var(--color-danger);
      --shadow: var(--shadow-md);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
      font-family: var(--font-body);
      letter-spacing: 0;
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      padding-bottom: 30px;
    }
    body:not(.auth-ready) > werk-suite-chrome,
    body:not(.auth-ready) > header,
    body:not(.auth-ready) > .ribbon,
    body:not(.auth-ready) > main:not(.auth-gate),
    body:not(.auth-ready) > .status {
      display: none !important;
    }
    body.auth-ready > .auth-gate,
    .auth-gate[hidden] {
      display: none !important;
    }
    .auth-gate {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 24px;
      background:
        radial-gradient(circle at 15% 15%, var(--color-red-glow), transparent 38%),
        var(--bg);
    }
    .auth-card {
      width: min(100%, 430px);
      padding: 36px;
      border: 1px solid var(--line);
      border-top: 4px solid var(--accent);
      border-radius: var(--border-radius-md);
      background: var(--panel);
      box-shadow: var(--shadow-md);
      text-align: center;
    }
    .auth-mark {
      display: grid;
      width: 58px;
      height: 58px;
      margin: 0 auto 18px;
      place-items: center;
      border-radius: 50%;
      background: var(--color-red-light);
      font-size: 28px;
    }
    .auth-eyebrow {
      margin: 0 0 6px;
      color: var(--accent-strong);
      font-family: var(--font-heading);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .auth-card h1 {
      margin: 0;
      font-size: clamp(25px, 6vw, 32px);
    }
    .auth-copy {
      margin: 12px 0 24px;
      color: var(--muted);
    }
    .auth-login-button {
      width: 100%;
      min-height: 44px;
    }
    .auth-message {
      min-height: 24px;
      margin: 14px 0 0;
      color: var(--muted);
      font-size: 13px;
    }
    .auth-message.error {
      color: var(--danger);
    }
    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 16px;
      border-bottom: 1px solid var(--line);
      background: var(--panel);
      position: sticky;
      top: 0;
      z-index: 2;
      box-shadow: var(--shadow-sm);
    }
    h1 {
      margin: 0;
      font-family: var(--font-heading);
      font-size: 20px;
      line-height: 1.25;
      font-weight: 800;
    }
    main {
      min-height: calc(100vh - 169px);
    }
    section {
      padding: 12px;
      min-width: 0;
    }
    .stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      margin-bottom: 10px;
    }
    .stat {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--border-radius-md);
      padding: 7px 8px;
      box-shadow: var(--shadow-sm);
    }
    .stat span {
      display: block;
      color: var(--muted);
      font-size: 11px;
    }
    .stat strong {
      display: block;
      margin-top: 2px;
      font-size: 15px;
      font-family: var(--font-heading);
    }
    button, select, input, textarea {
      font: inherit;
    }
    button {
      border: 1px solid var(--line);
      background: var(--panel);
      color: var(--text);
      border-radius: var(--border-radius-md);
      padding: 6px 9px;
      cursor: pointer;
      min-height: 32px;
      font-family: var(--font-heading);
      font-weight: 600;
      font-size: 13px;
      transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    button:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
    button:disabled {
      cursor: not-allowed;
      opacity: 0.62;
      box-shadow: none;
    }
    button.primary {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
    }
    button.primary:hover { background: var(--accent-strong); }
    button.danger {
      color: var(--danger);
    }
    button.active {
      border-color: var(--accent);
      color: var(--accent-strong);
      box-shadow: inset 0 0 0 1px var(--accent);
    }
    button[hidden] {
      display: none !important;
    }
    .ribbon {
      position: sticky;
      top: 53px;
      z-index: 1;
      border-bottom: 1px solid var(--line);
      background: var(--panel);
      box-shadow: var(--shadow-sm);
    }
    .ribbon-primary {
      display: flex;
      gap: 2px;
      padding: 0 12px;
      background: var(--color-grey-light);
      border-bottom: 1px solid var(--line);
      overflow-x: auto;
    }
    .primary-tab {
      min-height: 34px;
      padding: 7px 14px;
      border: 0;
      border-bottom: 2px solid transparent;
      border-radius: 0;
      background: transparent;
      color: var(--muted);
      box-shadow: none;
      white-space: nowrap;
    }
    .primary-tab:hover {
      background: rgba(228, 30, 38, 0.05);
      box-shadow: none;
    }
    .primary-tab.active {
      border-color: var(--accent);
      color: var(--accent-strong);
      box-shadow: none;
    }
    .ribbon-row {
      display: none;
      gap: 10px;
      min-height: 79px;
      padding: 8px 12px 6px;
      overflow-x: auto;
      align-items: stretch;
    }
    .ribbon-row.active {
      display: flex;
    }
    .ribbon-row[data-ribbon="inbox"].active {
      display: none;
    }
    .ribbon-row[data-ribbon="assistant"].active {
      display: none;
    }
    .ribbon-row[data-ribbon="assistant"] .ribbon-group:nth-child(2) {
      display: none;
    }
    .ribbon-group {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 5px;
      padding-right: 10px;
      border-right: 1px solid var(--line);
      flex: 0 0 auto;
    }
    .ribbon-group:last-child {
      border-right: 0;
      padding-right: 0;
    }
    .ribbon-group-content {
      display: flex;
      align-items: center;
      gap: 6px;
      min-height: 42px;
    }
    .ribbon-group-label {
      color: var(--color-grey-mid);
      font-family: var(--font-heading);
      font-size: 10px;
      font-weight: 700;
      line-height: 1;
      text-align: center;
      text-transform: uppercase;
    }
    .ribbon-command {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 76px;
      min-height: 38px;
      padding: 5px 8px;
      text-align: center;
      white-space: nowrap;
    }
    .ribbon-command.primary {
      min-width: 94px;
    }
    .ribbon-command.read {
      border-color: rgba(79, 140, 255, 0.35);
      color: #245eb8;
      background: rgba(79, 140, 255, 0.08);
    }
    .ribbon-command.write {
      border-color: rgba(38, 198, 162, 0.35);
      color: #087b65;
      background: rgba(38, 198, 162, 0.1);
    }
    .ribbon-command.execute {
      border-color: rgba(242, 184, 75, 0.42);
      color: #8b5b00;
      background: rgba(242, 184, 75, 0.13);
    }
    .ribbon-command.manage {
      border-color: rgba(165, 108, 255, 0.35);
      color: #673ab7;
      background: rgba(165, 108, 255, 0.1);
    }
    .ribbon-command.share {
      border-color: rgba(239, 111, 156, 0.36);
      color: #b72561;
      background: rgba(239, 111, 156, 0.1);
    }
    .ribbon-command.danger {
      border-color: rgba(239, 68, 68, 0.45);
      color: var(--danger);
      background: rgba(239, 68, 68, 0.08);
    }
    .ribbon-field {
      min-width: 122px;
      max-width: 190px;
    }
    .ribbon-field.search {
      min-width: 180px;
    }
    .ribbon-context {
      display: none;
      border-top: 1px solid var(--line);
      background: #fff;
      justify-content: flex-end;
    }
    .ribbon-context.active {
      display: flex;
    }
    .ribbon-context-title {
      display: flex;
      align-items: center;
      padding: 0 10px;
      color: var(--accent-strong);
      font-family: var(--font-heading);
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      border-right: 1px solid var(--line);
      white-space: nowrap;
    }
    .toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 10px;
    }
    .toolbar h2 {
      margin: 0;
      font-family: var(--font-heading);
      font-size: 20px;
      line-height: 1.25;
      font-weight: 700;
    }
    .grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--border-radius-md);
      box-shadow: var(--shadow);
      min-width: 0;
    }
    .panel-head {
      padding: 8px 10px;
      border-bottom: 1px solid var(--line);
      font-family: var(--font-heading);
      font-weight: 700;
      font-size: 14px;
    }
    .panel-body { padding: 10px; }
    label {
      display: grid;
      gap: 4px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 600;
      margin-bottom: 8px;
    }
    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      background: white;
      color: var(--text);
      border-radius: var(--border-radius-md);
      padding: 6px 8px;
      min-height: 32px;
      font-size: 13px;
      transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: var(--color-red);
      box-shadow: 0 0 0 3px var(--color-red-glow);
    }
    textarea {
      min-height: 96px;
      resize: vertical;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--border-radius-md);
      overflow: hidden;
      box-shadow: var(--shadow);
    }
    th, td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      vertical-align: top;
      font-size: 14px;
      overflow-wrap: anywhere;
    }
    th {
      color: var(--muted);
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0;
      background: #f8fafb;
    }
    tr:last-child td { border-bottom: 0; }
    .muted { color: var(--muted); }
    .stack { display: grid; gap: 12px; }
    .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
    .status {
      min-height: 18px;
      color: var(--muted);
      font-size: 12px;
      overflow-wrap: anywhere;
    }
    #status-line {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 100;
      padding: 4px 12px 6px;
      border-top: 1px solid var(--line);
      background: #fff;
    }
    #status-line[hidden] {
      display: none;
    }
    .message-list {
      display: grid;
      gap: 6px;
    }
    .message {
      display: grid;
      gap: 3px;
      padding: 8px 9px;
      border: 1px solid var(--line);
      border-radius: var(--border-radius-md);
      background: var(--panel);
      cursor: pointer;
      transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .message:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
    .message strong { font-size: 15px; }
    .body-view {
      white-space: pre-wrap;
      line-height: 1.45;
      min-height: 220px;
      max-height: 62vh;
      overflow: auto;
    }
    .guide {
      display: grid;
      gap: 6px;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: var(--border-radius-md);
      background: var(--color-grey-light);
      margin-bottom: 8px;
    }
    .guide strong { font-size: 14px; }
    .guide p {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }
    .guide a { color: var(--accent); font-weight: 700; }
    .form-feedback {
      min-height: 22px;
      margin-top: 6px;
      color: var(--muted);
      font-size: 12px;
      overflow-wrap: anywhere;
    }
    .form-feedback.ok { color: var(--color-success); }
    .form-feedback.error { color: var(--color-danger); }
    .form-feedback.busy { color: var(--color-info); }
    .preset-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 6px;
      align-items: end;
    }
    #account-form {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      column-gap: 8px;
      align-items: end;
    }
    #account-form > a,
    #account-form .form-actions,
    #account-form-status {
      grid-column: 1 / -1;
    }
    .hidden { display: none !important; }
    @media (max-width: 900px) {
      main { min-height: calc(100vh - 196px); }
      .ribbon { position: static; }
      .ribbon-row { min-height: 70px; padding: 7px 10px 5px; }
      .ribbon-command { min-width: 68px; }
      .grid { grid-template-columns: 1fr; }
      header { align-items: flex-start; flex-direction: column; }
      .preset-grid { grid-template-columns: 1fr; }
      #account-form { grid-template-columns: 1fr; }
    }

    /* Postwerk operations theme: Logicalis colors, dense mail-client layout. */
    :root {
      color-scheme: dark;
      --color-red: #e41e26;
      --color-red-hover: #ff3842;
      --color-red-light: rgba(228, 30, 38, 0.13);
      --color-red-glow: rgba(228, 30, 38, 0.22);
      --color-grey: #9aa4b2;
      --color-grey-dark: #eef2f7;
      --color-grey-light: #151b24;
      --color-grey-mid: #6f7b8c;
      --color-bg-main: #070b11;
      --color-bg-card: #0d121a;
      --color-border: #1b2430;
      --color-success: #26c6a2;
      --color-info: #55c1d9;
      --color-warning: #f2b84b;
      --color-danger: #ff5a66;
      --logicalis-red: #e41e26;
      --logicalis-teal: #00a3a6;
      --bg: var(--color-bg-main);
      --panel: var(--color-bg-card);
      --line: var(--color-border);
      --text: var(--color-grey-dark);
      --muted: var(--color-grey);
      --accent: var(--color-red);
      --accent-strong: var(--color-red-hover);
      --danger: var(--color-danger);
      --shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
      --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.025);
    }
    body {
      background:
        linear-gradient(180deg, rgba(228, 30, 38, 0.035), transparent 220px),
        var(--bg);
      color: var(--text);
      font-size: 13px;
      line-height: 1.45;
    }
    header {
      min-height: 40px;
      padding: 0 12px;
      background: #0b1017;
      border-bottom-color: #18212c;
      box-shadow: none;
    }
    header h1 {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      font-size: 13px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    header h1::before {
      content: "";
      width: 17px;
      height: 17px;
      border-radius: 4px;
      background:
        linear-gradient(135deg, transparent 0 34%, #061019 34% 47%, transparent 47%),
        var(--accent);
      box-shadow: 0 0 0 1px rgba(228, 30, 38, 0.28), 0 0 18px rgba(228, 30, 38, 0.26);
    }
    header h1::after {
      content: "v4.3";
      margin-left: 2px;
      padding: 1px 6px 2px;
      border: 1px solid #202b39;
      border-radius: 4px;
      color: var(--color-grey-mid);
      font-size: 10px;
      letter-spacing: 0;
      text-transform: none;
    }
    header .actions {
      gap: 7px;
    }
    #login-state {
      color: var(--color-success);
      font-size: 11px;
      text-transform: uppercase;
    }
    main {
      min-height: calc(100vh - 148px);
      background: #070b11;
    }
    section {
      padding: 0;
    }
    .ribbon {
      top: 40px;
      background: #0b1017;
      border-bottom-color: #202a37;
      box-shadow: none;
    }
    .ribbon-primary {
      min-height: 32px;
      align-items: end;
      padding: 0 12px;
      background: #0f151e;
      border-bottom-color: #1b2532;
    }
    .primary-tab {
      min-height: 32px;
      padding: 7px 14px 6px;
      color: #7f8b9c;
      font-size: 12px;
    }
    .primary-tab:hover {
      background: rgba(255, 255, 255, 0.035);
      color: #c6d0de;
    }
    .primary-tab.active {
      color: #ffffff;
      border-bottom-color: #00a3a6;
    }
    .ribbon-row {
      min-height: 96px;
      padding: 10px 14px 8px;
      background: #0d131c;
      gap: 14px;
    }
    .ribbon-group {
      min-width: max-content;
      padding-right: 14px;
      border-right-color: #202a37;
    }
    .ribbon-group-content {
      min-height: 55px;
      gap: 7px;
    }
    .ribbon-group-label {
      color: #627083;
      letter-spacing: 0.06em;
    }
    .ribbon-command {
      min-width: 78px;
      min-height: 46px;
      padding: 6px 10px;
      background: #111925;
      border-color: #253244;
      color: #dce5ef;
      border-radius: 6px;
      box-shadow: none;
    }
    .ribbon-command:hover {
      background: #162131;
      border-color: rgba(228, 30, 38, 0.48);
      box-shadow: 0 0 0 1px rgba(228, 30, 38, 0.08);
    }
    .ribbon-command.primary {
      min-width: 106px;
    }
    .ribbon-command.read {
      color: #8bb4ff;
      background: rgba(79, 140, 255, 0.12);
      border-color: rgba(79, 140, 255, 0.24);
    }
    .ribbon-command.write {
      color: #78e2c9;
      background: rgba(38, 198, 162, 0.13);
      border-color: rgba(38, 198, 162, 0.25);
    }
    .ribbon-command.execute {
      color: #ffd27a;
      background: rgba(242, 184, 75, 0.14);
      border-color: rgba(242, 184, 75, 0.25);
    }
    .ribbon-command.manage {
      color: #c9aaff;
      background: rgba(165, 108, 255, 0.13);
      border-color: rgba(165, 108, 255, 0.26);
    }
    .ribbon-command.share {
      color: #ffa5c6;
      background: rgba(239, 111, 156, 0.13);
      border-color: rgba(239, 111, 156, 0.28);
    }
    .ribbon-field {
      min-width: 144px;
      max-width: 240px;
    }
    .ribbon-field.search {
      min-width: min(34vw, 360px);
    }
    .ribbon-context {
      background: #101722;
      border-top-color: #202a37;
    }
    .ribbon-context-title {
      background: rgba(228, 30, 38, 0.09);
      border-right-color: #2a3442;
      color: #ff6a72;
    }
    #status-line {
      min-height: 24px;
      padding: 4px 14px 5px;
      background: #090d13;
      border-top-color: #18212c;
      color: #7f8b9c;
    }
    .stats {
      grid-template-columns: repeat(4, minmax(94px, 1fr));
      margin: 0;
      gap: 7px;
    }
    .stat {
      min-width: 94px;
      padding: 6px 9px;
      background: #111925;
      border-color: #253244;
      box-shadow: none;
    }
    .stat span {
      color: #748196;
      font-size: 10px;
      text-transform: uppercase;
    }
    .stat strong {
      color: #f2f6fb;
      font-size: 13px;
    }
    .toolbar {
      min-height: 34px;
      margin: 0;
      padding: 7px 12px;
      background: #090d13;
      border-bottom: 1px solid #18212c;
    }
    .toolbar h2 {
      font-size: 12px;
      color: #8793a4;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .grid {
      gap: 0;
    }
    .inbox-shell {
      display: grid;
      grid-template-columns: auto 220px minmax(0, 1fr);
      min-height: calc(100vh - 184px);
      background: #070b11;
    }
    .mailbox-sidebar {
      display: flex;
      flex-direction: column;
      background: #090d16;
      border-right: 1px solid #1b2430;
      width: 180px;
      transition: width 0.15s ease;
      overflow: hidden;
    }
    .mailbox-sidebar.collapsed {
      width: 45px;
    }
    .mailbox-sidebar-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 8px;
      border-bottom: 1px solid #1b2430;
      height: 38px;
      overflow: hidden;
    }
    .mailbox-sidebar-title {
      font-size: 10px;
      font-weight: 950;
      letter-spacing: 0.11em;
      text-transform: uppercase;
      color: #647286;
      white-space: nowrap;
    }
    .toggle-sidebar-btn {
      background: transparent;
      border: 0;
      color: #647286;
      font-size: 14px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      border-radius: 4px;
    }
    .toggle-sidebar-btn:hover {
      background: rgba(255, 255, 255, 0.05);
      color: #fff;
    }
    .mailbox-sidebar.collapsed .mailbox-sidebar-title {
      display: none;
    }
    .mailbox-sidebar.collapsed .mailbox-sidebar-header {
      justify-content: center;
    }
    .mailbox-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 8px 6px;
      overflow-y: auto;
    }
    .mailbox-group {
      display: flex;
      justify-content: space-between;
      align-items: stretch;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 6px;
      padding: 6px 8px;
      transition: all 0.15s ease;
    }
    .mailbox-group-accounts {
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex-grow: 1;
      min-width: 0;
    }
    .mailbox-group-badge-container {
      display: flex;
      align-items: center;
      justify-content: center;
      padding-left: 6px;
    }
    .mailbox-item {
      padding: 4px 6px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 500;
      color: #b0c4de;
      cursor: pointer;
      border: 1px solid transparent;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: all 0.1s ease;
    }
    .mailbox-item:hover {
      background: rgba(255, 255, 255, 0.04);
      color: #fff;
    }
    .mailbox-item.active {
      background: rgba(228, 30, 38, 0.08);
      border-color: rgba(228, 30, 38, 0.25);
      color: #fff;
      font-weight: 600;
    }
    .provider-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      line-height: 1;
      cursor: pointer;
      user-select: none;
    }
    .provider-badge.yahoo {
      background: #6001d2;
      color: #fff;
    }
    .provider-badge.gmail {
      background: #ea4335;
      color: #fff;
    }
    .provider-badge.outlook {
      background: #0078d4;
      color: #fff;
    }
    .provider-badge.ccc {
      background: #e41e26;
      color: #fff;
    }
    .provider-badge.generic {
      background: #4b5563;
      color: #fff;
    }

    /* Collapsed Sidebar overrides */
    .mailbox-sidebar.collapsed .mailbox-group {
      padding: 4px 0;
      background: transparent;
      border-color: transparent;
      justify-content: center;
    }
    .mailbox-sidebar.collapsed .mailbox-group-accounts {
      display: none;
    }
    .mailbox-sidebar.collapsed .mailbox-group-badge-container {
      padding: 0;
      width: 100%;
    }
    .provider-badge.generic {
      background: #4b5563;
      color: #fff;
    }
    .mail-nav {
      display: grid;
      align-content: start;
      gap: 10px;
      padding: 10px 8px;
      background: #0a0f16;
      border-right: 1px solid #1b2430;
      overflow: auto;
    }
    .mail-nav-section {
      display: grid;
      gap: 4px;
    }
    .mail-nav-title {
      padding: 8px 6px 4px;
      color: #647286;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: 0.11em;
      text-transform: uppercase;
    }
    .mail-nav-list {
      display: grid;
      gap: 3px;
    }
    .nav-item {
      display: grid;
      grid-template-columns: 18px minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      min-height: 28px;
      padding: 5px 8px;
      border: 1px solid transparent;
      border-radius: 5px;
      background: transparent;
      color: #9aa4b2;
      font-size: 12px;
      text-align: left;
    }
    .nav-icon {
      width: 18px;
      height: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 5px;
      background: #101a27;
      color: #00c7d4;
      font-size: 9px;
      font-weight: 800;
      text-transform: uppercase;
    }
    .nav-label {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .nav-item:hover {
      background: #111925;
      border-color: #223044;
    }
    .nav-item.active {
      background: rgba(0, 163, 166, 0.13);
      border-color: rgba(0, 163, 166, 0.28);
      color: #8ee8ea;
      box-shadow: inset 2px 0 0 #00a3a6;
    }
    .nav-item.active .nav-icon {
      background: #06394b;
      color: #b7fbff;
    }
    .nav-count {
      min-width: 20px;
      padding: 1px 5px;
      border-radius: 999px;
      background: #172232;
      color: #8fa0b5;
      font-size: 10px;
      text-align: center;
    }
    .inbox-main {
      min-width: 0;
    }
    .inbox-filterbar {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .inbox-filterbar h2 {
      margin-right: auto;
    }
    .ribbon-field.compact {
      min-width: 110px;
      width: auto;
    }
    #view-inbox .grid {
      grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
      min-height: calc(100vh - 222px);
    }
    #view-accounts .grid,
    .accounts-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 12px;
      padding: 12px;
      align-items: start;
    }
    .accounts-toolbar {
      justify-content: flex-start;
      padding: 0 12px;
    }
    .accounts-toolbar h2 {
      margin-right: auto;
    }
    .accounts-list-panel,
    .account-editor-panel,
    .share-panel {
      max-width: 1040px;
      width: 100%;
      margin-inline: auto;
    }
    .account-editor-panel,
    .share-panel {
      max-width: 760px;
    }
    #view-compose {
      padding: 12px;
    }
    .compose-toolbar {
      justify-content: flex-start;
    }
    .compose-toolbar h2 {
      margin-right: auto;
    }
    .composer-panel {
      max-width: 920px;
      margin: 0 auto 16px;
    }
    #send-form {
      display: grid;
      gap: 10px;
    }
    #send-form label {
      display: grid;
      gap: 5px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }
    #send-form input,
    #send-form select,
    #send-form textarea {
      color: var(--text);
      font-size: 14px;
    }
    #send-form textarea {
      min-height: 260px;
      line-height: 1.5;
      resize: vertical;
    }
    .compose-message {
      margin-top: 4px;
    }
    .compose-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      justify-content: flex-start;
      padding-top: 4px;
    }
    .outbound-panel {
      max-width: 1040px;
      margin-inline: auto;
    }
    .outbound-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    #view-compose .panel,
    #view-api .panel {
      margin-bottom: 12px;
    }
    #view-api {
      padding: 12px;
    }
    .panel {
      background: #0d121a;
      border-color: #1b2430;
      border-radius: 0;
      box-shadow: none;
    }
    #view-accounts .panel,
    #view-compose .panel,
    #view-api .panel {
      border-radius: 7px;
      overflow: hidden;
    }
    .panel-head {
      min-height: 38px;
      padding: 9px 12px;
      background: #111925;
      border-bottom-color: #202a37;
      color: #dfe7f1;
    }
    .panel-body {
      padding: 10px;
    }
    input, select, textarea {
      background: #0a0f16;
      border-color: #253244;
      color: #edf3fa;
      border-radius: 6px;
    }
    input::placeholder, textarea::placeholder {
      color: #5f6d80;
    }
    input:focus, select:focus, textarea:focus {
      border-color: #00a3a6;
      box-shadow: 0 0 0 3px rgba(0, 163, 166, 0.12);
    }
    button {
      background: #111925;
      border-color: #253244;
      color: #dfe7f1;
      border-radius: 6px;
      box-shadow: none;
    }
    button:hover {
      border-color: var(--accent);
      background: #162131;
      box-shadow: none;
    }
    button.primary {
      background: var(--accent);
      border-color: var(--accent);
    }
    button.primary:hover {
      background: var(--accent-strong);
    }
    label {
      color: #95a1b2;
    }
    .muted {
      color: #7f8b9c;
    }
    .message-list {
      align-content: start;
      gap: 0;
      background: #0a0f16;
      border-right: 1px solid #1b2430;
      overflow: auto;
      max-height: calc(100vh - 216px);
    }
    .message {
      gap: 4px;
      padding: 10px 12px;
      background: #0d121a;
      border: 0;
      border-bottom: 1px solid #1b2430;
      border-radius: 0;
      color: #dce5ef;
    }
    .message:hover {
      background: #111925;
      box-shadow: inset 2px 0 0 #00a3a6;
    }
    .message strong {
      font-size: 13px;
      line-height: 1.25;
      color: #f1f5f9;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .message .muted,
    .message span {
      font-size: 12px;
      line-height: 1.35;
    }
    #message-title {
      min-height: 46px;
      font-size: 15px;
      background: #0d121a;
    }
    #message-meta,
    #message-attachments {
      padding-top: 8px;
      padding-bottom: 8px;
      border-bottom: 1px solid #18212c;
    }
    .message-meta-summary {
      display: grid;
      gap: 3px;
      color: var(--text);
      font-size: 13px;
      line-height: 1.45;
    }
    .message-technical-details {
      margin-top: 6px;
      color: var(--muted);
      font-size: 12px;
    }
    .message-technical-details summary {
      cursor: pointer;
      width: max-content;
    }
    .message-technical-grid {
      display: grid;
      grid-template-columns: max-content minmax(0, 1fr);
      gap: 4px 10px;
      margin-top: 6px;
    }
    .message-technical-grid code {
      overflow-wrap: anywhere;
      color: var(--muted);
      font-family: var(--font-mono);
      font-size: 11px;
    }
    .attachment-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 7px;
      white-space: normal;
    }
    .message-resource-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-width: 0;
    }
    .message-resource-actions {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      margin-left: auto;
      min-width: 0;
    }
    .attachment-download {
      min-height: 28px;
      padding: 5px 8px;
      border-color: #244052;
      background: #0c1824;
      color: #a7d9ea;
      font-size: 12px;
    }
    .body-view {
      min-height: calc(100vh - 352px);
      max-height: none;
      color: #b9c4d2;
      line-height: 1.55;
      background: #090d13;
      overflow: auto;
    }
    #message-body {
      padding: 18px;
      font-size: 13px;
    }
    #message-body.is-html-rendered {
      display: flex;
      min-height: calc(100vh - 352px);
      padding: 0;
      overflow: hidden;
    }
    .guide {
      background: #101722;
      border-color: #263244;
      border-left: 3px solid var(--accent);
      border-radius: 6px;
    }
    .guide strong {
      color: #f2f6fb;
    }
    .guide a,
    #provider-password-link {
      color: #ff737a;
      font-weight: 800;
    }
    .stack {
      gap: 0;
    }
    #account-list,
    #share-list,
    #outbound-list {
      gap: 8px;
    }
    #account-list .message,
    #share-list .message,
    #outbound-list .message {
      border: 1px solid #1f2a38;
      border-radius: 7px;
      background: #101722;
    }
    .account-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) max-content max-content;
      gap: 12px;
      align-items: center;
      padding: 12px;
      border-bottom: 1px solid #1b2430;
    }
    .account-row:last-child {
      border-bottom: 0;
    }
    .account-main {
      display: grid;
      gap: 3px;
      min-width: 0;
    }
    .account-main strong {
      overflow: hidden;
      color: var(--text);
      font-size: 15px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .account-status {
      font-size: 12px;
      font-weight: 800;
    }
    .account-status.ok {
      color: var(--success);
    }
    .account-status.pending {
      color: var(--warning);
    }
    .account-status.failed {
      color: var(--danger);
    }
    .account-error {
      margin-top: 5px;
      padding: 6px 8px;
      border: 1px solid rgba(239, 68, 68, 0.35);
      border-radius: 6px;
      background: rgba(239, 68, 68, 0.08);
      color: #ff9aa2;
      font-size: 12px;
    }
    .account-details {
      color: var(--muted);
      font-size: 12px;
    }
    .account-details summary {
      cursor: pointer;
    }
    .account-technical-grid {
      display: grid;
      grid-template-columns: max-content minmax(0, 1fr);
      gap: 4px 10px;
      margin-top: 6px;
      min-width: 280px;
    }
    .account-technical-grid code {
      overflow-wrap: anywhere;
      color: var(--muted);
      font-family: var(--font-mono);
      font-size: 11px;
    }
    .account-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
    }
    #share-form .check-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    #provider-password-link {
      width: max-content;
      color: var(--accent-strong);
      font-size: 12px;
      font-weight: 700;
    }
    .outbound-row {
      display: grid;
      grid-template-columns: 24px minmax(0, 1fr) max-content max-content;
      gap: 10px;
      align-items: center;
      padding: 9px 10px;
      border-bottom: 1px solid #1b2430;
    }
    .outbound-row:last-child {
      border-bottom: 0;
    }
    .outbound-row-content {
      display: grid;
      gap: 3px;
      min-width: 0;
    }
    .outbound-row-content strong {
      overflow: hidden;
      color: var(--text);
      font-size: 14px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .outbound-state,
    .outbound-status {
      font-size: 12px;
      font-weight: 800;
    }
    .outbound-state.sent,
    .outbound-status.sent {
      color: var(--success);
    }
    .outbound-state.pending,
    .outbound-status.pending {
      color: var(--warning);
    }
    .outbound-state.failed,
    .outbound-status.failed {
      color: var(--danger);
    }
    .outbound-details {
      color: var(--muted);
      font-size: 12px;
    }
    .outbound-details summary {
      cursor: pointer;
    }
    .outbound-details code {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 11px;
      white-space: nowrap;
    }
    .mail-row {
      display: grid;
      grid-template-columns: 32px minmax(0, 1fr);
      gap: 9px;
      min-height: 84px;
      position: relative;
    }
    .mail-row-actions {
      display: none;
      position: absolute;
      right: 12px;
      top: 10px;
      background: #101722;
      border: 1px solid #1f2a38;
      border-radius: 4px;
      padding: 2px 4px;
      gap: 4px;
      z-index: 2;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }
    .mail-row:hover .mail-row-actions {
      display: flex;
    }
    .mail-action-btn {
      background: transparent;
      border: 0;
      font-size: 13px;
      cursor: pointer;
      padding: 3px 6px;
      border-radius: 3px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.1s ease;
    }
    .mail-action-btn:hover {
      background: rgba(255, 255, 255, 0.08);
    }
    .mail-row.is-selected {
      background: #13202e;
      box-shadow: inset 3px 0 0 var(--accent);
    }
    .avatar {
      display: inline-grid;
      width: 28px;
      height: 28px;
      place-items: center;
      align-self: start;
      border: 1px solid rgba(0, 163, 166, 0.35);
      border-radius: 999px;
      background:
        linear-gradient(135deg, rgba(0, 163, 166, 0.24), rgba(228, 30, 38, 0.14)),
        #0a111a;
      color: #7ee6e8;
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
    }
    .mail-row-main {
      display: grid;
      gap: 5px;
      min-width: 0;
    }
    .mail-row-head,
    .mail-row-meta,
    .chip-row {
      display: flex;
      align-items: center;
      min-width: 0;
    }
    .mail-row-head {
      gap: 7px;
    }
    .mail-row-head strong {
      flex: 1;
      min-width: 0;
    }
    .mail-row-meta {
      gap: 8px;
      color: #7f8b9c;
      font-size: 11px;
    }
    .mail-from,
    .mail-date {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .mail-from {
      flex: 1;
    }
    .mail-date {
      flex: 0 0 auto;
      max-width: 82px;
      color: #6f7b8c;
    }
    .chip-row {
      gap: 5px;
      flex-wrap: wrap;
    }
    .chip {
      display: inline-flex;
      align-items: center;
      min-height: 18px;
      padding: 2px 6px;
      border: 1px solid transparent;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 900;
      line-height: 1;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      white-space: nowrap;
    }
    .chip.combined {
      min-height: 16px;
      gap: 0;
      overflow: hidden;
      padding: 0;
      border-color: rgba(255, 255, 255, 0.09);
      background: rgba(255, 255, 255, 0.035);
      font-size: 9px;
      letter-spacing: 0.035em;
    }
    .chip.combined .chip-label,
    .chip.combined .chip-segment {
      display: inline-flex;
      align-items: center;
      min-height: 16px;
      padding: 1px 5px;
      border-left: 1px solid rgba(255, 255, 255, 0.09);
    }
    .chip.combined .chip-label {
      border-left: 0;
      color: #9bbcff;
      background: rgba(79, 140, 255, 0.13);
    }
    .chip.combined .chip-segment.read {
      color: #8bb4ff;
      background: rgba(79, 140, 255, 0.12);
    }
    .chip.combined .chip-segment.write {
      color: #78e2c9;
      background: rgba(38, 198, 162, 0.12);
    }
    .chip.combined .chip-segment.execute {
      color: #ffd27a;
      background: rgba(242, 184, 75, 0.13);
    }
    .chip.combined .chip-segment.manage {
      color: #c9aaff;
      background: rgba(165, 108, 255, 0.13);
    }
    .chip.combined .chip-segment.audit {
      color: #82d8ee;
      background: rgba(85, 193, 217, 0.12);
    }
    .chip.combined .chip-segment.danger {
      color: #ff8b93;
      background: rgba(228, 30, 38, 0.14);
    }
    .chip.read {
      color: #8bb4ff;
      background: rgba(79, 140, 255, 0.15);
      border-color: rgba(79, 140, 255, 0.22);
    }
    .chip.write {
      color: #78e2c9;
      background: rgba(38, 198, 162, 0.16);
      border-color: rgba(38, 198, 162, 0.24);
    }
    .chip.execute {
      color: #ffd27a;
      background: rgba(242, 184, 75, 0.17);
      border-color: rgba(242, 184, 75, 0.25);
    }
    .chip.manage {
      color: #c9aaff;
      background: rgba(165, 108, 255, 0.16);
      border-color: rgba(165, 108, 255, 0.25);
    }
    .chip.share {
      color: #ffa5c6;
      background: rgba(239, 111, 156, 0.16);
      border-color: rgba(239, 111, 156, 0.25);
    }
    .chip.audit {
      color: #82d8ee;
      background: rgba(85, 193, 217, 0.15);
      border-color: rgba(85, 193, 217, 0.25);
    }
    .chip.danger {
      color: #ff8b93;
      background: rgba(228, 30, 38, 0.17);
      border-color: rgba(228, 30, 38, 0.26);
    }
    .message-detail-head {
      display: grid;
      gap: 3px;
      min-height: 56px;
      padding: 10px 12px;
      background: #0d121a;
      border-bottom: 1px solid #18212c;
    }
    .message-detail-head strong {
      color: #f1f5f9;
      font-size: 15px;
    }
    .message-detail-head .chip-row {
      margin-top: 2px;
    }
    .actions {
      gap: 7px;
    }
    .form-feedback.ok { color: #78e2c9; }
    .form-feedback.error { color: #ff6a72; }
    .form-feedback.busy { color: #82d8ee; }
    table, th, td {
      border-color: #1b2430;
    }
    th {
      background: #111925;
      color: #8793a4;
    }
    @media (min-width: 1500px) {
      .ribbon-row {
        min-height: 108px;
        padding-left: 18px;
        padding-right: 18px;
      }
      .ribbon-command {
        min-width: 92px;
        min-height: 52px;
      }
      .ribbon-field.search {
        min-width: 360px;
      }
      #view-inbox .grid {
        grid-template-columns: 360px minmax(0, 1fr);
      }
    }
    @media (max-width: 1100px) {
      .inbox-shell {
        grid-template-columns: 1fr;
      }
      .mail-nav {
        max-height: 220px;
        border-right: 0;
        border-bottom: 1px solid #1b2430;
      }
      #view-inbox .grid,
      #view-accounts .grid {
        grid-template-columns: 1fr;
      }
      .message-list {
        max-height: 340px;
        border-right: 0;
        border-bottom: 1px solid #1b2430;
      }
      .body-view {
        min-height: 300px;
      }
    }

    /* Logicalis operations shell refresh. */
    body {
      font-size: 14px;
      background:
        linear-gradient(180deg, rgba(228, 30, 38, 0.05), transparent 190px),
        #080b10;
    }
    header {
      display: grid;
      grid-template-columns: minmax(220px, 280px) minmax(240px, 560px) auto;
      gap: 16px;
      min-height: 46px;
      padding: 0 14px;
    }
    .brand-lockup {
      display: flex;
      align-items: baseline;
      gap: 10px;
      min-width: 0;
    }
    .brand-subtitle {
      color: #758195;
      font-family: var(--font-heading);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      white-space: nowrap;
    }
    header h1::after {
      content: "v4.4";
    }
    .header-search {
      min-width: 0;
    }
    .header-search input {
      height: 32px;
      min-height: 32px;
      background: #101722;
      border-color: #263244;
    }
    .header-actions {
      justify-content: end;
      flex-wrap: nowrap;
      white-space: nowrap;
    }
    .live-dot {
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: #00a3a6;
      box-shadow: 0 0 0 3px rgba(0, 163, 166, 0.12);
    }
    .ribbon {
      top: 46px;
    }
    .ribbon-primary {
      min-height: 36px;
      gap: 3px;
      padding-right: 14px;
    }
    .primary-tab {
      min-height: 36px;
      font-size: 13px;
    }
    .shell-mail-filter {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-left: auto;
      padding: 4px 0;
      min-width: 0;
    }
    .inbox-filterbar {
      flex-wrap: wrap;
      justify-content: flex-start;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: var(--border-radius-md);
      background: var(--panel);
      box-shadow: var(--shadow-sm);
    }
    .inbox-filterbar .active-scope {
      margin-right: auto;
    }
    .compact-action {
      min-height: 32px;
      padding: 5px 10px;
      white-space: nowrap;
    }
    .shell-search {
      width: min(34vw, 430px);
    }
    .ribbon-row {
      min-height: 86px;
    }
    .ribbon-command {
      min-width: 88px;
      min-height: 44px;
      font-size: 13px;
    }
    .side-rail {
      position: fixed;
      top: 112px;
      right: 0;
      bottom: 22px;
      z-index: 4;
      display: grid;
      align-content: start;
      gap: 7px;
      width: 42px;
      padding: 8px 5px;
      background: #0a0f16;
      border-left: 1px solid #1b2430;
    }
    .side-rail button {
      min-width: 0;
      width: 30px;
      min-height: 36px;
      padding: 4px 2px;
      border-radius: 6px;
      color: #7f8b9c;
      font-size: 10px;
      text-transform: uppercase;
      writing-mode: vertical-rl;
      transform: rotate(180deg);
    }
    .side-rail button.active {
      border-color: rgba(0, 163, 166, 0.42);
      background: rgba(0, 163, 166, 0.15);
      color: #8ee8ea;
    }
    main {
      margin-right: 0;
    }
    .inbox-shell {
      grid-template-columns: auto 246px minmax(0, 1fr);
    }
    .mail-nav {
      padding: 12px 10px;
    }
    .nav-item {
      min-height: 34px;
      font-size: 13px;
      border-radius: 6px;
    }
    .nav-icon {
      width: 20px;
      height: 20px;
      font-size: 10px;
    }
    .nav-count {
      min-width: 24px;
      font-size: 11px;
    }
    #view-inbox .grid {
      grid-template-columns: minmax(310px, 380px) minmax(0, 1fr);
    }
    .message-list {
      max-height: calc(100vh - 210px);
    }
    .mail-row {
      min-height: 92px;
      grid-template-columns: 34px minmax(0, 1fr);
    }
    .mail-row-head strong,
    .message-detail-head strong {
      font-size: 14px;
    }
    .mail-row-meta,
    .message .muted,
    .message span {
      font-size: 12.5px;
    }
    #message-body {
      font-size: 14px;
      line-height: 1.6;
    }
    .toolbar h2 {
      font-size: 13px;
    }
    .active-scope {
      color: #a8b3c2;
      font-family: var(--font-heading);
      font-size: 13px;
      font-weight: 700;
    }
    .assistant-layout,
    .settings-layout {
      display: grid;
      gap: 12px;
      padding: 12px;
      align-items: start;
    }
    .assistant-layout {
      grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    }
    .assistant-context {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 14px;
      border-bottom: 1px solid #1b2430;
      background: #0a0f16;
    }
    .assistant-context strong {
      display: block;
      margin-top: 4px;
      color: #f2f6fb;
      font-family: var(--font-heading);
      font-size: 18px;
      line-height: 1.25;
    }
    .eyebrow {
      color: #6f7b8c;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }
    .assistant-tabbar {
      display: flex;
      gap: 6px;
      padding: 10px 12px;
      border-bottom: 1px solid #1b2430;
      background: #0d131c;
      overflow-x: auto;
    }
    .assistant-tab {
      min-height: 34px;
      padding: 6px 11px;
      border-radius: 6px;
      font-size: 13px;
    }
    .assistant-tab.active,
    .assistant-mode.active {
      border-color: rgba(0, 163, 166, 0.52);
      background: rgba(0, 163, 166, 0.16);
      color: #8ee8ea;
    }
    .assistant-output {
      display: grid;
      gap: 12px;
      min-height: 320px;
      padding: 16px;
      background: #090d13;
    }
    .assistant-empty {
      display: grid;
      place-items: center;
      min-height: 220px;
      color: #758195;
      text-align: center;
    }
    .assistant-empty-card {
      display: grid;
      justify-items: center;
      gap: 10px;
      max-width: 420px;
      padding: 18px;
    }
    .assistant-empty-card strong {
      color: var(--text);
      font-size: 16px;
    }
    .assistant-empty-icon {
      color: var(--accent);
      font-size: 28px;
      line-height: 1;
    }
    .assistant-result {
      display: grid;
      gap: 12px;
    }
    .assistant-result-block {
      padding: 12px;
      border: 1px solid #1f2a38;
      border-radius: 7px;
      background: #101722;
    }
    .assistant-result-block h3 {
      margin: 0 0 8px;
      color: #f2f6fb;
      font-size: 15px;
    }
    .assistant-result-block p,
    .assistant-result-block li {
      color: #c1cad6;
      font-size: 14px;
    }
    .assistant-result-block ul {
      margin: 0;
      padding-left: 20px;
    }
    .assistant-guardrails {
      display: grid;
      gap: 10px;
    }
    .assistant-guardrails div {
      display: grid;
      gap: 3px;
      padding-bottom: 10px;
      border-bottom: 1px solid #1b2430;
    }
    .assistant-guardrails div:last-child {
      border-bottom: 0;
      padding-bottom: 0;
    }
    .assistant-guardrails strong {
      color: #f2f6fb;
      font-family: var(--font-heading);
      font-size: 13px;
    }
    .assistant-guardrails span {
      color: #8b98aa;
      font-size: 13px;
      line-height: 1.45;
    }
    .productivity-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
      gap: 12px;
      padding: 12px;
      align-items: start;
    }
    .calendar-workspace,
    .todo-workspace {
      min-width: 0;
      border: 1px solid #1b2430;
      background: #090d13;
    }
    .productivity-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      min-height: 52px;
      padding: 9px 12px;
      border-bottom: 1px solid #1b2430;
      background: #0d131c;
    }
    .productivity-head h2 {
      margin: 0;
      color: #f2f6fb;
      font-family: var(--font-heading);
      font-size: 18px;
      letter-spacing: 0;
    }
    .calendar-weekdays,
    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
    }
    .calendar-weekdays {
      border-bottom: 1px solid #1b2430;
      background: #101722;
    }
    .calendar-weekdays span {
      padding: 8px;
      color: #768397;
      font-size: 11px;
      font-weight: 800;
      text-align: right;
      text-transform: uppercase;
    }
    .calendar-cell {
      min-width: 0;
      min-height: 116px;
      padding: 7px;
      border-right: 1px solid #18212d;
      border-bottom: 1px solid #18212d;
      background: #0a0f16;
    }
    .calendar-cell:nth-child(7n) {
      border-right: 0;
    }
    .calendar-cell.outside {
      background: #080b10;
      color: #465164;
    }
    .calendar-cell.today {
      box-shadow: inset 0 3px 0 var(--logicalis-red);
    }
    .calendar-day-number {
      display: block;
      margin-bottom: 5px;
      color: #9ba8b9;
      font-size: 12px;
      font-weight: 800;
      text-align: right;
    }
    .calendar-cell.today .calendar-day-number {
      color: #fff;
    }
    .calendar-cell-events {
      display: grid;
      gap: 3px;
    }
    .calendar-event-chip {
      width: 100%;
      min-width: 0;
      min-height: 24px;
      padding: 4px 6px;
      overflow: hidden;
      border: 0;
      border-left: 3px solid var(--logicalis-teal);
      border-radius: 3px;
      background: rgba(0, 163, 166, 0.14);
      color: #c9f3f3;
      font-size: 11px;
      text-align: left;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .productivity-side {
      display: grid;
      gap: 12px;
    }
    .productivity-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 9px;
    }
    .productivity-form label,
    .productivity-form .form-span {
      min-width: 0;
      grid-column: 1;
    }
    .productivity-form input:not([type="checkbox"]),
    .productivity-form select,
    .productivity-form textarea {
      width: 100%;
      min-width: 0;
      max-width: 100%;
    }
    .productivity-form .check-label {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .productivity-form .check-label input[type="checkbox"] {
      flex: 0 0 auto;
      width: 18px;
      min-width: 18px;
      height: 18px;
      margin: 0;
    }
    .form-actions {
      display: flex;
      gap: 7px;
      grid-column: 1 / -1;
    }
    .agenda-list,
    .todo-list {
      display: grid;
      min-height: 120px;
    }
    .agenda-row,
    .todo-row {
      display: grid;
      gap: 5px;
      padding: 11px 12px;
      border-bottom: 1px solid #1b2430;
      background: #0d131c;
    }
    .agenda-row:last-child,
    .todo-row:last-child {
      border-bottom: 0;
    }
    .agenda-row strong,
    .todo-row strong {
      min-width: 0;
      color: #edf2f8;
      font-size: 14px;
      overflow-wrap: anywhere;
    }
    .agenda-meta,
    .todo-meta {
      color: #7f8b9c;
      font-size: 12px;
    }
    .agenda-actions,
    .todo-actions,
    .draft-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .agenda-actions button,
    .todo-actions button,
    .draft-actions button {
      min-height: 28px;
      padding: 4px 8px;
      font-size: 11px;
    }
    .todo-toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .segmented {
      display: inline-flex;
      padding: 2px;
      border: 1px solid #263244;
      border-radius: 6px;
      background: #090d13;
    }
    .segmented button {
      min-height: 29px;
      padding: 4px 10px;
      border: 0;
      border-radius: 4px;
      font-size: 12px;
    }
    .segmented button.active {
      background: #243040;
      color: #fff;
    }
    .todo-row {
      grid-template-columns: 26px minmax(0, 1fr) auto;
      align-items: start;
    }
    .todo-toggle {
      width: 18px;
      height: 18px;
      margin-top: 2px;
      accent-color: var(--logicalis-teal);
    }
    .todo-content {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .todo-row.completed strong {
      color: #657184;
      text-decoration: line-through;
    }
    .priority-mark {
      display: inline-block;
      width: 8px;
      height: 8px;
      margin-right: 5px;
      border-radius: 999px;
      background: #6d7a8d;
    }
    .priority-mark.medium { background: #e0a524; }
    .priority-mark.high { background: var(--logicalis-red); }
    .draft-list {
      display: grid;
      gap: 8px;
      margin-top: 8px;
    }
    .draft-row {
      display: grid;
      gap: 6px;
      padding: 10px;
      border: 1px solid #263244;
      border-radius: 6px;
      background: #0b1119;
    }
    .draft-row strong {
      color: #edf2f8;
      font-size: 13px;
    }
    .empty-productivity {
      padding: 24px 14px;
      color: #687589;
      font-size: 13px;
      text-align: center;
    }
    .settings-layout {
      grid-template-columns: minmax(260px, 360px) minmax(0, 1fr) minmax(280px, 420px);
    }
    .settings-metrics {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }
    #settings-outbound-list .message {
      border: 1px solid #1f2a38;
      border-radius: 7px;
      background: #101722;
    }
    @media (max-width: 1150px) {
      header {
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 8px 12px;
      }
      .header-actions {
        justify-content: start;
      }
      .ribbon {
        top: 0;
      }
      .shell-mail-filter {
        width: 100%;
        margin-left: 0;
      }
      .shell-search {
        width: 100%;
      }
      .side-rail {
        display: none;
      }
      main {
        margin-right: 0;
      }
      .assistant-layout,
      .productivity-layout,
      .settings-layout {
        grid-template-columns: 1fr;
      }
      .calendar-cell {
        min-height: 92px;
      }
    }
    @media (max-width: 720px) {
      .calendar-cell {
        min-height: 68px;
        padding: 4px;
      }
      .calendar-event-chip {
        min-height: 20px;
        padding: 3px;
        font-size: 0;
      }
      .calendar-event-chip::after {
        content: "";
        display: block;
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: var(--logicalis-teal);
      }
      .productivity-form {
        grid-template-columns: 1fr;
      }
      .productivity-form label,
      .productivity-form .form-span {
        grid-column: 1;
      }
    }

    .ribbon-spacer {
      flex: 1 1 auto;
    }
    .ribbon-grid-2x3 {
      display: grid !important;
      grid-template-rows: repeat(2, minmax(0, 1fr));
      grid-auto-flow: column;
      gap: 4px;
    }
    .ribbon-command-small {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 6px;
      height: 22px;
      border: 1px solid var(--line);
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.03);
      color: var(--text);
      font-size: 11px;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.1s ease, border-color 0.1s ease;
    }
    .ribbon-command-small:hover:not(:disabled) {
      background: rgba(255, 255, 255, 0.08);
      border-color: var(--accent);
    }
    .ribbon-command-small:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
    .ribbon-command-small .icon {
      font-size: 11px;
    }
    .ribbon-command-small.read {
      color: #8bb4ff;
      background: rgba(79, 140, 255, 0.12);
      border-color: rgba(79, 140, 255, 0.24);
    }
    .ribbon-command-small.write {
      color: #78e2c9;
      background: rgba(38, 198, 162, 0.13);
      border-color: rgba(38, 198, 162, 0.25);
    }
    .ribbon-command-small.execute {
      color: #ffd27a;
      background: rgba(242, 184, 75, 0.14);
      border-color: rgba(242, 184, 75, 0.25);
    }
    .ribbon-command-small.manage {
      color: #c9aaff;
      background: rgba(165, 108, 255, 0.13);
      border-color: rgba(165, 108, 255, 0.26);
    }
    .ribbon-command-small.share {
      color: #ffa5c6;
      background: rgba(239, 111, 156, 0.13);
      border-color: rgba(239, 111, 156, 0.28);
    }
    .nav-item .nav-count {
      margin-left: auto;
      font-size: 11px;
      font-weight: bold;
      color: var(--muted);
      background: rgba(255, 255, 255, 0.05);
      padding: 1px 6px;
      border-radius: 99px;
    }
    .nav-item.active .nav-count {
      color: #fff;
      background: rgba(228, 30, 38, 0.2);
    }
    .message-detail-actions {
      display: none;
      gap: 8px;
      padding: 8px 12px;
      background: #0a0f16;
      border-bottom: 1px solid #18212c;
    }
    .detail-action-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 10px;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid #1b2430;
      border-radius: 4px;
      color: #b0c4de;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.1s ease;
    }
    .detail-action-btn:hover {
      background: rgba(255, 255, 255, 0.06);
      border-color: var(--accent);
      color: #fff;
    }

    /* ── HTML mail view ─────────────────────────────────────────────────── */
    .html-view-container {
      margin-top: 12px;
      border-top: 1px solid #18212c;
      padding-top: 10px;
    }
    .html-view-notice {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 6px;
    }
    .html-view-btn {
      min-height: 24px;
      font-size: 11px;
      padding: 3px 9px;
      border-radius: 5px;
      border: 1px solid #2a3a50;
      background: rgba(100, 180, 255, 0.06);
      color: #7ec8f8;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .html-view-btn:hover:not(:disabled) {
      background: rgba(100, 180, 255, 0.14);
      border-color: #7ec8f8;
      color: #fff;
    }
    .html-view-btn:disabled {
      opacity: 0.5;
      cursor: wait;
    }
    .html-view-remote-warning {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      min-width: 24px;
      height: 24px;
      padding: 0;
      background: rgba(255, 180, 0, 0.08);
      border: 1px solid rgba(255, 180, 0, 0.2);
      border-radius: 999px;
      font-size: 13px;
      font-weight: 900;
      color: #f0c040;
      cursor: help;
    }
    .btn-link {
      background: none;
      border: none;
      color: #7ec8f8;
      cursor: pointer;
      font-size: 12px;
      text-decoration: underline;
      padding: 0;
    }
    .mail-html-frame {
      width: 100%;
      flex: 1 1 auto;
      min-height: 100%;
      height: 100%;
      border: 1px solid #18212c;
      border-radius: 6px;
      background: #fff;
      display: block;
    }

    .custom-context-menu {
      position: fixed;
      z-index: 10050;
      min-width: 210px;
      max-width: min(320px, calc(100vw - 16px));
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
      color: var(--text);
      box-shadow: 0 18px 45px rgb(0 0 0 / 35%);
      backdrop-filter: blur(10px);
    }
    .context-menu-title {
      padding: 5px 8px 7px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 900;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .context-menu-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      width: 100%;
      min-height: 28px;
      padding: 5px 8px;
      border: 0;
      border-radius: 5px;
      background: transparent;
      color: var(--text);
      font: inherit;
      font-size: 12px;
      text-align: left;
      cursor: pointer;
    }
    .context-menu-item:hover:not(:disabled) {
      background: var(--color-red-light);
      color: var(--accent-strong);
    }
    .context-menu-item:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
    .context-menu-shortcut {
      color: var(--text-soft);
      font-size: 10px;
    }
    .context-menu-divider {
      height: 1px;
      margin: 5px 3px;
      background: var(--line);
    }
