
    :root {
      --radius: 4px;
      --accent-red: #d2222c;
      --accent-green: #008e46;
      --accent-blue: #3c8dbc;
      --transition: 0.25s ease;
    }

    [data-theme="dark"] {
      --sidebar-bg: #1a2332;
      --sidebar-hover: #243447;
      --brand-bg: #111c2a;
      --bg-color: #0f1923;
      --card-bg: #1a2332;
      --card-header-bg: #1f2d3d;
      --text-main: #d0dbe8;
      --text-muted: #6b8299;
      --text-label: #9ab1c8;
      --border-color: #2a3f55;
      --input-bg: #0f1923;
      --input-border: #2a3f55;
      --input-text: #d0dbe8;
      --preview-bg: #0d1620;
      --preview-text: #a8c4dc;
      --btn-secondary-bg: #243447;
      --btn-secondary-text: #9ab1c8;
      --btn-secondary-border: #2a3f55;
      --btn-secondary-hover: #2e4460;
      --tab-inactive: #6b8299;
      --tab-hover: #d0dbe8;
      --banner-bg: #1a2332;
      --banner-border: #2a3f55;
      --nav-label-color: #4a6480;
      --sidebar-link: #7a9ab8;
      --shadow: 0 4px 20px rgba(0,0,0,0.4);
      --scrollbar-bg: #1a2332;
      --scrollbar-thumb: #2a3f55;
      --toast-bg: #1f2d3d;
      --toast-border: #2a3f55;
    }

    [data-theme="light"] {
      --sidebar-bg: #2c3e50;
      --sidebar-hover: #34495e;
      --brand-bg: #233140;
      --bg-color: #ecf0f5;
      --card-bg: #ffffff;
      --card-header-bg: #ffffff;
      --text-main: #333333;
      --text-muted: #777777;
      --text-label: #444444;
      --border-color: #d2d6de;
      --input-bg: #ffffff;
      --input-border: #cccccc;
      --input-text: #333333;
      --preview-bg: #fdfdfd;
      --preview-text: #333333;
      --btn-secondary-bg: #f4f4f4;
      --btn-secondary-text: #444444;
      --btn-secondary-border: #dddddd;
      --btn-secondary-hover: #e7e7e7;
      --tab-inactive: #666666;
      --tab-hover: #333333;
      --banner-bg: #ffffff;
      --banner-border: #d2d6de;
      --nav-label-color: #8aa4af;
      --sidebar-link: #b8c7ce;
      --shadow: 0 1px 3px rgba(0,0,0,0.1);
      --scrollbar-bg: #f0f0f0;
      --scrollbar-thumb: #c0c0c0;
      --toast-bg: #ffffff;
      --toast-border: #d2d6de;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background-color: var(--bg-color);
      color: var(--text-main);
      display: flex;
      min-height: 100vh;
      font-size: 14px;
      transition: background-color var(--transition), color var(--transition);
    }

    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
    ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }


    aside {
      width: 250px;
      background-color: var(--sidebar-bg);
      color: #ecf0f1;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      position: fixed;
      height: 100vh;
      overflow-y: auto;
      box-shadow: 2px 0 12px rgba(0,0,0,0.3);
      z-index: 100;
      transition: background-color var(--transition);
    }

    .brand {
      background-color: var(--brand-bg);
      padding: 15px;
      font-size: 18px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 10px;
      text-transform: uppercase;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      transition: background-color var(--transition);
    }
    .brand img { height: 50px; width: auto; object-fit: contain; filter: drop-shadow(0 0 6px rgba(210,34,44,0.4)); }

    nav { padding: 10px 0; flex-grow: 1; }

    .nav-label {
      font-size: 11px;
      color: var(--nav-label-color);
      margin: 14px 15px 4px 15px;
      display: block;
      text-transform: uppercase;
      font-weight: 700;
      letter-spacing: 0.06em;
      transition: color var(--transition);
    }

    .forum-link, .panel-tab {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 10px 15px;
      color: var(--sidebar-link);
      text-decoration: none;
      font-size: 14px;
      border: none;
      background: transparent;
      text-align: left;
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease, border-left-color 0.15s ease, padding-left 0.15s ease;
      border-left: 3px solid transparent;
    }

    .forum-link:hover, .panel-tab:hover {
      background: var(--sidebar-hover);
      color: #ffffff;
      padding-left: 20px;
    }

    .panel-tab.active {
      background: var(--sidebar-hover);
      color: #ffffff;
      border-left-color: var(--accent-red);
    }


    .theme-toggle-wrap {
      padding: 12px 15px;
      border-top: 1px solid rgba(255,255,255,0.06);
    }

    .theme-toggle {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 9px 12px;
      border-radius: var(--radius);
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.04);
      color: var(--sidebar-link);
      font-size: 13px;
      cursor: pointer;
      transition: background 0.2s, color 0.2s;
      font-family: inherit;
    }
    .theme-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }

    .toggle-track {
      width: 34px; height: 18px;
      background: #2a3f55;
      border-radius: 9px;
      position: relative;
      margin-left: auto;
      transition: background 0.25s;
      flex-shrink: 0;
    }
    [data-theme="light"] .toggle-track { background: var(--accent-blue); }

    .toggle-thumb {
      width: 14px; height: 14px;
      border-radius: 50%;
      background: #fff;
      position: absolute;
      top: 2px; left: 2px;
      transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
      box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }
    [data-theme="light"] .toggle-thumb { transform: translateX(16px); }


    main {
      margin-left: 250px;
      padding: 20px;
      width: calc(100% - 250px);
      max-width: 1400px;
      animation: fadeInUp 0.45s ease both;
    }

    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(18px); }
      to   { opacity: 1; transform: translateY(0); }
    }


    .okf-banner {
      background-color: var(--banner-bg);
      border-top: 4px solid var(--accent-red);
      border-bottom: 1px solid var(--banner-border);
      padding: 15px 25px;
      margin-bottom: 20px;
      display: flex;
      align-items: center;
      gap: 20px;
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      transition: background-color var(--transition), border-color var(--transition);
      animation: slideDown 0.4s ease both;
    }
    @keyframes slideDown {
      from { opacity: 0; transform: translateY(-10px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .okf-banner img { height: 82px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(210,34,44,0.3)); }
    .okf-banner h1 { margin: 0 0 4px 0; font-size: 21px; color: var(--text-main); text-transform: uppercase; transition: color var(--transition); }
    .okf-banner p  { margin: 0; color: var(--text-muted); font-size: 13px; transition: color var(--transition); }

    .header-title {
      margin: 0 0 18px 0;
      font-size: 18px;
      font-weight: 500;
      color: var(--text-main);
      transition: color var(--transition);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .header-title::before {
      content: '';
      display: inline-block;
      width: 4px; height: 20px;
      background: var(--accent-red);
      border-radius: 2px;
      flex-shrink: 0;
    }


    .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

    .card {
      background: var(--card-bg);
      border-radius: var(--radius);
      border-top: 3px solid var(--border-color);
      box-shadow: var(--shadow);
      margin-bottom: 20px;
      transition: background-color var(--transition), box-shadow var(--transition);
      animation: fadeInUp 0.5s ease both;
    }
    .card.primary-box   { border-top-color: var(--accent-red); }
    .card.secondary-box { border-top-color: var(--accent-blue); animation-delay: 0.08s; }

    .card-header {
      padding: 14px 15px;
      border-bottom: 1px solid var(--border-color);
      background: var(--card-header-bg);
      transition: background-color var(--transition), border-color var(--transition);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .card-header h2 { margin: 0; font-size: 15px; font-weight: 500; color: var(--text-main); transition: color var(--transition); }
    .card-body { padding: 15px; }


    .subtabs {
      display: flex;
      border-bottom: 2px solid var(--border-color);
      margin-bottom: 18px;
      overflow-x: auto;
      transition: border-color var(--transition);
    }

    .tab {
      padding: 9px 14px;
      border: none;
      background: transparent;
      font-size: 13px;
      font-weight: 500;
      color: var(--tab-inactive);
      cursor: pointer;
      white-space: nowrap;
      margin-bottom: -2px;
      border-bottom: 2px solid transparent;
      border-radius: var(--radius) var(--radius) 0 0;
      transition: color 0.2s, border-color 0.2s, background 0.2s;
      font-family: inherit;
    }
    .tab:hover { color: var(--tab-hover); background: rgba(255,255,255,0.03); }
    .tab.active { color: var(--accent-red); border-bottom-color: var(--accent-red); }


    .field { margin-bottom: 14px; }

    label {
      display: block;
      margin-bottom: 5px;
      font-weight: 700;
      color: var(--text-label);
      font-size: 13px;
      transition: color var(--transition);
    }

    input, select, textarea {
      width: 100%;
      border: 1px solid var(--input-border);
      border-radius: var(--radius);
      background: var(--input-bg);
      color: var(--input-text);
      padding: 8px 12px;
      font-size: 14px;
      font-family: inherit;
      transition: border-color 0.2s ease, background-color var(--transition), color var(--transition), box-shadow 0.2s ease;
    }
    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: var(--accent-blue);
      box-shadow: 0 0 0 3px rgba(60,141,188,0.15);
    }
    select option { background: var(--card-bg); color: var(--text-main); }
    textarea { resize: vertical; min-height: 80px; }

    .field-wrap { position: relative; }
    .char-counter {
      position: absolute;
      bottom: 6px; right: 8px;
      font-size: 11px;
      color: var(--text-muted);
      pointer-events: none;
      transition: color 0.2s;
      background: var(--input-bg);
      padding: 0 3px;
    }
    .char-counter.warn { color: #e67e22; }


    .actions {
      display: flex;
      gap: 10px;
      margin-top: 18px;
      padding-top: 14px;
      border-top: 1px solid var(--border-color);
      flex-wrap: wrap;
      transition: border-color var(--transition);
    }

    .btn {
      padding: 8px 18px;
      border-radius: var(--radius);
      font-weight: 500;
      cursor: pointer;
      border: 1px solid transparent;
      font-size: 14px;
      font-family: inherit;
      transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, color var(--transition), border-color var(--transition);
      position: relative;
      overflow: hidden;
    }
    .btn:active { transform: scale(0.97); }

    .btn-primary { background-color: var(--accent-red); color: white; border-color: #a81820; }
    .btn-primary:hover { background-color: #b91c1c; box-shadow: 0 3px 10px rgba(210,34,44,0.35); }

    .btn-secondary { background-color: var(--btn-secondary-bg); color: var(--btn-secondary-text); border-color: var(--btn-secondary-border); }
    .btn-secondary:hover { background-color: var(--btn-secondary-hover); }

    .btn-reset { background-color: transparent; color: var(--text-muted); border-color: var(--border-color); }
    .btn-reset:hover { color: var(--accent-red); border-color: var(--accent-red); }

    .btn-copy-done { background-color: var(--accent-green) !important; color: #fff !important; border-color: #006b35 !important; }


    .badge {
      font-size: 11px;
      font-weight: 600;
      padding: 2px 8px;
      border-radius: 20px;
      background: rgba(60,141,188,0.12);
      color: var(--accent-blue);
      letter-spacing: 0.02em;
      border: 1px solid rgba(60,141,188,0.22);
      white-space: nowrap;
    }


    .preview {
      color: var(--preview-text);
      padding: 15px;
      font-family: Consolas, "Courier New", monospace;
      font-size: 13px;
      line-height: 1.6;
      white-space: pre-wrap;
      word-break: break-all;
      min-height: 400px;
      border-top: 1px solid var(--border-color);
      overflow-y: auto;
      max-height: 700px;
      background: var(--preview-bg);
      transition: background-color var(--transition), color var(--transition), border-color var(--transition);
    }

    .preview-empty {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 12px;
      color: var(--text-muted);
      font-family: 'Roboto', sans-serif;
      font-size: 14px;
      min-height: 400px;
      text-align: center;
    }
    .preview-empty svg { opacity: 0.25; }


    .panel-anim {
      animation: panelFadeIn 0.3s ease both;
    }
    @keyframes panelFadeIn {
      from { opacity: 0; transform: translateX(8px); }
      to   { opacity: 1; transform: translateX(0); }
    }


    #toast-container {
      position: fixed;
      bottom: 24px; right: 24px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 10px;
      pointer-events: none;
    }
    .toast {
      background: var(--toast-bg);
      border: 1px solid var(--toast-border);
      color: var(--text-main);
      padding: 12px 18px;
      border-radius: 6px;
      font-size: 14px;
      box-shadow: 0 6px 24px rgba(0,0,0,0.35);
      display: flex;
      align-items: center;
      gap: 10px;
      pointer-events: all;
      animation: toastIn 0.3s cubic-bezier(.34,1.56,.64,1) both;
      border-left: 3px solid var(--accent-blue);
      min-width: 220px;
      max-width: 320px;
      transition: background-color var(--transition);
    }
    .toast.success { border-left-color: var(--accent-green); }
    .toast.error   { border-left-color: var(--accent-red); }
    .toast.leaving { animation: toastOut 0.25s ease forwards; }
    @keyframes toastIn {
      from { opacity: 0; transform: translateX(30px) scale(0.95); }
      to   { opacity: 1; transform: translateX(0) scale(1); }
    }
    @keyframes toastOut {
      from { opacity: 1; transform: translateX(0); }
      to   { opacity: 0; transform: translateX(30px); }
    }

    .hidden { display: none !important; }

    @media (max-width: 1000px) {
      aside { width: 100%; height: auto; position: static; box-shadow: none; }
      main  { margin-left: 0; width: 100%; padding: 15px; }
      .grid { grid-template-columns: 1fr; }
    }

    :focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }


    .profile-section {
      padding: 10px 15px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .profile-section input,
    .profile-section select {
      width: 100%;
      padding: 6px 10px;
      font-size: 13px;
      border-radius: var(--radius);
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.05);
      color: #d0dbe8;
      font-family: inherit;
    }
    .profile-section input::placeholder { color: #4a6480; }
    .profile-section select option { background: #1a2332; }
    .profile-section input:focus,
    .profile-section select:focus { outline: none; border-color: var(--accent-blue); }
    .btn-profile-save {
      padding: 6px 12px;
      border-radius: var(--radius);
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(60,141,188,0.18);
      color: #7ec8e3;
      font-size: 12px;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.2s, color 0.2s;
      width: 100%;
      font-weight: 600;
    }
    .btn-profile-save:hover { background: rgba(60,141,188,0.35); color: #fff; }
    .profile-active-row {
      font-size: 12px;
      color: #4a8f6a;
      padding: 4px 8px;
      background: rgba(0,142,70,0.1);
      border-radius: var(--radius);
      border: 1px solid rgba(0,142,70,0.2);
      text-align: center;
      display: none;
    }
    .profile-active-row.visible { display: flex; align-items: center; gap: 7px; text-align: left; }
    .sidebar-profile-avatar { width: 42px; height: 42px; flex: 0 0 42px; }
    .sidebar-profile-avatar img,
    .sidebar-profile-avatar-placeholder {
      display: flex; align-items: center; justify-content: center;
      width: 100%; height: 100%; box-sizing: border-box;
      border: 1px solid rgba(150, 165, 174, .45); border-radius: 50%;
      object-fit: cover; background: rgba(255, 255, 255, .07);
    }
    .sidebar-profile-avatar-placeholder { font-size: 21px; }
    .profile-active-row .rank-badge { margin-right: 0; }
    .sidebar-profile-identity { min-width: 0; overflow-wrap: anywhere; }


    .tab-wrap { position: relative; display: inline-flex; align-items: center; }
    .fav-star {
      font-size: 13px;
      cursor: pointer;
      line-height: 1;
      opacity: 0.4;
      transition: opacity 0.2s, transform 0.2s;
      padding: 0 4px 0 0;
      user-select: none;
    }
    .fav-star:hover { opacity: 0.9; transform: scale(1.2); }
    .fav-star.active { opacity: 1; color: #f0c040; }
    .tab.fav-tab { border-bottom-color: #f0c040 !important; color: #f0c040 !important; }


    .notes-section {
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px dashed var(--border-color);
    }
    .notes-label {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 6px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .notes-label::after {
      content: '(nem kerül a kódba)';
      font-weight: 400;
      font-size: 11px;
      text-transform: none;
      letter-spacing: 0;
      opacity: 0.7;
    }
    #private_notes {
      width: 100%;
      min-height: 60px;
      resize: vertical;
      border: 1px dashed var(--input-border);
      background: var(--input-bg);
      color: var(--input-text);
      padding: 8px 12px;
      font-size: 13px;
      border-radius: var(--radius);
      font-family: inherit;
      opacity: 0.8;
    }
    #private_notes:focus { opacity: 1; outline: none; border-color: #6b8299; border-style: solid; }


    .required-highlight {
      border-color: var(--accent-red) !important;
      box-shadow: 0 0 0 3px rgba(210,34,44,0.2) !important;
      animation: shakeField 0.35s ease;
    }
    @keyframes shakeField {
      0%,100% { transform: translateX(0); }
      25%      { transform: translateX(-4px); }
      75%      { transform: translateX(4px); }
    }


    .output-tabs {
      display: flex;
      border-bottom: 1px solid var(--border-color);
      padding: 0 15px;
      gap: 4px;
      background: var(--card-header-bg);
      transition: background-color var(--transition);
    }
    .output-tab {
      padding: 9px 14px;
      border: none;
      background: transparent;
      font-size: 13px;
      font-weight: 500;
      color: var(--tab-inactive);
      cursor: pointer;
      margin-bottom: -1px;
      border-bottom: 2px solid transparent;
      transition: color 0.2s, border-color 0.2s;
      font-family: inherit;
    }
    .output-tab:hover { color: var(--tab-hover); }
    .output-tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }

    #bb-visual-preview {
      padding: 20px 24px;
      font-size: 14px;
      line-height: 1.7;
      min-height: 400px;
      max-height: 700px;
      overflow-y: auto;
      background: var(--preview-bg);
      color: var(--preview-text);
      transition: background-color var(--transition);
    }
    #bb-visual-preview img { max-width: 200px; display: inline-block; }
    .bb-spoiler-toggle {
      background: rgba(60,141,188,0.15);
      border: 1px solid rgba(60,141,188,0.3);
      color: var(--accent-blue);
      padding: 4px 12px;
      border-radius: var(--radius);
      cursor: pointer;
      font-size: 13px;
      margin: 4px 0;
    }
    .bb-spoiler-content { display: none; padding: 8px 0; }
    .bb-spoiler-content.open { display: block; }


    .history-empty {
      text-align: center;
      color: var(--text-muted);
      padding: 60px 20px;
      font-size: 14px;
      opacity: 0.7;
    }
    .history-list { display: flex; flex-direction: column; gap: 12px; }
    .history-item {
      background: var(--card-bg);
      border: 1px solid var(--border-color);
      border-radius: var(--radius);
      border-left: 3px solid var(--accent-blue);
      overflow: hidden;
      transition: box-shadow 0.2s;
    }
    .history-item:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.2); }
    .history-item-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px;
      cursor: pointer;
    }
    .history-item-meta {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .history-type-badge {
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 20px;
      background: rgba(60,141,188,0.15);
      color: var(--accent-blue);
      border: 1px solid rgba(60,141,188,0.25);
      white-space: nowrap;
    }
    .history-time {
      font-size: 12px;
      color: var(--text-muted);
    }
    .history-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-main);
    }
    .history-item-actions { display: flex; gap: 6px; }
    .btn-sm {
      padding: 4px 10px;
      font-size: 12px;
      border-radius: var(--radius);
      border: 1px solid var(--border-color);
      background: var(--btn-secondary-bg);
      color: var(--btn-secondary-text);
      cursor: pointer;
      font-family: inherit;
      transition: background 0.15s, color 0.15s;
    }
    .btn-sm:hover { background: var(--btn-secondary-hover); }
    .btn-sm.danger:hover { background: rgba(210,34,44,0.1); color: var(--accent-red); border-color: var(--accent-red); }
    .history-code-preview {
      display: none;
      padding: 10px 14px;
      border-top: 1px solid var(--border-color);
      font-family: Consolas, monospace;
      font-size: 12px;
      color: var(--text-muted);
      white-space: pre-wrap;
      word-break: break-all;
      max-height: 140px;
      overflow-y: auto;
      background: var(--preview-bg);
    }
    .history-code-preview.open { display: block; }


    .stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
    .stat-card {
      background: var(--card-bg);
      border: 1px solid var(--border-color);
      border-radius: var(--radius);
      padding: 16px 18px;
      border-top: 3px solid var(--accent-blue);
      transition: box-shadow 0.2s;
    }
    .stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
    .stat-card-count { font-size: 32px; font-weight: 700; color: var(--text-main); line-height: 1.1; }
    .stat-card-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
    .stat-bar-section { margin-top: 24px; }
    .stat-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .stat-bar-label { width: 140px; font-size: 13px; color: var(--text-label); flex-shrink: 0; }
    .stat-bar-track { flex: 1; height: 10px; background: var(--border-color); border-radius: 5px; overflow: hidden; }
    .stat-bar-fill { height: 100%; border-radius: 5px; background: var(--accent-blue); transition: width 0.6s cubic-bezier(.34,1.56,.64,1); }
    .stat-bar-num { font-size: 12px; color: var(--text-muted); width: 28px; text-align: right; flex-shrink: 0; }
    .stat-reset-row { margin-top: 20px; text-align: right; }


    #fullPanelContainer {
      display: none;
      animation: fadeInUp 0.35s ease both;
    }
    #fullPanelContainer.visible { display: block; }
    #gridContainer { animation: fadeInUp 0.35s ease both; }




    :root {
      --display-font: 'Oswald', 'Roboto', sans-serif;
      --mono-font: 'Roboto Mono', ui-monospace, monospace;
      --accent-amber: #e8a020;
    }

    .brand {
      font-family: var(--display-font);
      font-weight: 600;
      letter-spacing: 0.10em;
      font-size: 17px;
    }
    .brand img { filter: drop-shadow(0 0 6px rgba(210,34,44,0.45)); }

    .nav-label { font-family: var(--display-font); font-weight: 600; letter-spacing: 0.14em; }
    .panel-tab { font-family: var(--display-font); font-weight: 500; letter-spacing: 0.04em; font-size: 14.5px; }


    .okf-banner { border-top-width: 0; position: relative; overflow: hidden; padding-left: 25px; }
    .okf-banner::before {
      content: '';
      position: absolute; inset: 0 auto 0 0; width: 8px;
      background: repeating-linear-gradient(
        135deg,
        var(--accent-red) 0 14px,
        #f4f4f4 14px 28px
      );
      opacity: 0.9;
    }
    .okf-banner > * { position: relative; }
    .okf-banner h1 {
      font-family: var(--display-font);
      font-weight: 700;
      letter-spacing: 0.02em;
      font-size: 23px;
    }
    .header-title { font-family: var(--display-font); font-weight: 600; letter-spacing: 0.05em; font-size: 19px; text-transform: uppercase; }
    .card-header h2 { font-family: var(--display-font); font-weight: 600; letter-spacing: 0.04em; font-size: 16px; text-transform: uppercase; }




    #authGate {
      position: fixed; inset: 0; z-index: 9999;
      display: flex; align-items: center; justify-content: center;
      background:
        radial-gradient(900px 600px at 80% -10%, rgba(210,34,44,0.18), transparent 60%),
        var(--bg-color);
      padding: 20px;
    }
    #authGate.hidden { display: none; }
    .auth-card {
      width: 100%; max-width: 380px;
      background: var(--card-bg);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 18px 50px rgba(0,0,0,0.5);
      overflow: hidden;
      animation: fadeInUp 0.4s ease both;
    }
    .auth-top {
      background: var(--brand-bg);
      padding: 22px 24px 18px;
      text-align: center;
      border-bottom: 1px solid var(--border-color);
      position: relative;
    }
    .auth-top::after {
      content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
      background: repeating-linear-gradient(135deg, var(--accent-red) 0 12px, #f4f4f4 12px 24px);
    }
    .auth-top img { height: 76px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(210,34,44,0.4)); }
    .auth-top h2 {
      margin: 12px 0 2px; font-family: var(--display-font); font-weight: 600;
      letter-spacing: 0.08em; text-transform: uppercase; font-size: 18px; color: var(--text-main);
    }
    .auth-top p { margin: 0; font-size: 12px; color: var(--text-muted); letter-spacing: 0.04em; }
    .auth-body { padding: 22px 24px 24px; }
    .auth-body label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-label); margin: 0 0 5px; font-weight: 700; }
    .auth-body input {
      width: 100%; padding: 11px 12px; margin-bottom: 15px;
      background: var(--input-bg); border: 1px solid var(--input-border);
      border-radius: var(--radius); color: var(--input-text); font-size: 14px; font-family: inherit;
    }
    .auth-body input:focus { outline: none; border-color: var(--accent-red); }
    .auth-btn {
      width: 100%; padding: 12px; border: none; border-radius: var(--radius);
      background: var(--accent-red); color: #fff; font-family: var(--display-font);
      font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px;
      cursor: pointer; transition: filter 0.18s;
    }
    .auth-btn:hover { filter: brightness(1.12); }
    .auth-hint { margin: 14px 0 0; font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.5; }
    .auth-error { color: var(--accent-red); font-size: 12.5px; margin: -6px 0 12px; min-height: 16px; }


    .session-row {
      margin: 4px 15px 0; padding: 9px 11px; border-radius: var(--radius);
      background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
      font-size: 12.5px; color: var(--sidebar-link);
    }
    .session-row .who { color: #fff; font-weight: 600; }
    .session-row .role-tag {
      display: inline-block; margin-top: 3px; font-size: 10px; letter-spacing: 0.08em;
      text-transform: uppercase; padding: 1px 7px; border-radius: 3px; font-weight: 700;
    }
    .role-tag.admin { background: rgba(210,34,44,0.22); color: #ff8f96; border: 1px solid rgba(210,34,44,0.4); }
    .role-tag.user  { background: rgba(60,141,188,0.18); color: #9fd0ee; border: 1px solid rgba(60,141,188,0.4); }
    .role-tag.super { background: rgba(232,160,32,0.2); color: var(--accent-amber); border: 1px solid rgba(232,160,32,0.5); }
    .logout-link {
      background: none; border: none; color: var(--text-muted); font-size: 11.5px;
      cursor: pointer; padding: 0; margin-top: 7px; text-decoration: underline; font-family: inherit;
    }
    .logout-link:hover { color: var(--accent-red); }




    .panel-toolbar {
      display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
      margin-bottom: 16px;
    }
    .panel-toolbar .spacer { flex: 1; }
    .ro-search {
      padding: 9px 12px; min-width: 220px; flex: 1;
      background: var(--input-bg); border: 1px solid var(--input-border);
      border-radius: var(--radius); color: var(--input-text); font-size: 13px; font-family: inherit;
    }
    .ro-search:focus { outline: none; border-color: var(--accent-blue); }
    .btn-add {
      padding: 9px 16px; border: none; border-radius: var(--radius);
      background: var(--accent-green); color: #fff; font-weight: 600;
      font-family: var(--display-font); letter-spacing: 0.05em; text-transform: uppercase;
      font-size: 12.5px; cursor: pointer; transition: filter 0.18s;
    }
    .btn-add:hover { filter: brightness(1.12); }

    .roster-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
    .roster-table thead th {
      text-align: left; padding: 10px 12px; font-family: var(--display-font);
      font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11.5px;
      color: var(--text-label); border-bottom: 2px solid var(--border-color); white-space: nowrap;
    }
    .roster-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border-color); color: var(--text-main); vertical-align: middle; }
    .roster-table tbody tr:hover { background: rgba(255,255,255,0.025); }
    .roster-table .col-code { font-family: var(--mono-font); font-weight: 600; color: var(--accent-amber); white-space: nowrap; }
    .roster-table .name-cell { font-weight: 600; }
    .pos-pill {
      display: inline-block; font-family: var(--mono-font); font-size: 11px; font-weight: 600;
      padding: 2px 8px; border-radius: 3px; background: rgba(60,141,188,0.16);
      color: var(--accent-blue); border: 1px solid rgba(60,141,188,0.3); white-space: nowrap;
    }
    .rank-pill {
      display: inline-block; font-family: var(--mono-font); font-size: 11px; font-weight: 600;
      padding: 2px 8px; border-radius: 3px; background: rgba(210,34,44,0.16);
      color: var(--accent-red); border: 1px solid rgba(210,34,44,0.3); white-space: nowrap;
    }
    .rank-badge {
      display: inline-flex; align-items: center; justify-content: center;
      flex-shrink: 0; margin-right: 7px; padding: 2px; vertical-align: middle;
      box-sizing: border-box; overflow: hidden;
      background: var(--card-header-bg); border: 1px solid var(--border-color);
      border-radius: 3px;
    }
    .rank-ico { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; image-rendering: auto; }
    .rank-cell { display: inline-flex; align-items: center; }
    .rank-cell-secondary { color: var(--text-muted); font-size: 12.5px; }
    .pos-cell-dominant { font-weight: 600; }
    .rank-preview { display: inline-flex; align-items: center; margin-left: 8px; min-height: 44px; }
    .rank-preview .rank-badge { margin-right: 0; }
    #rosterTableWrap { overflow-x: auto; }
    .roster-member-table { min-width: 1180px; }
    .roster-member-table .name-cell { min-width: 145px; font-size: 14px; }
    .roster-rank-card {
      min-width: 190px; max-width: 260px; padding: 6px 9px;
      display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 9px;
      background: var(--card-header-bg); border: 1px solid var(--border-color);
      border-left: 3px solid var(--accent-red); border-radius: 3px;
    }
    .roster-rank-card.no-image { grid-template-columns: minmax(0,1fr); }
    .roster-rank-card .rank-badge { margin: 0; }
    .roster-rank-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
    .roster-rank-copy small {
      color: var(--text-muted); font-family: var(--mono-font); font-size: 8px;
      font-weight: 700; letter-spacing: .09em; line-height: 1; text-transform: uppercase;
    }
    .roster-rank-copy strong {
      overflow: hidden; color: var(--text-main); font-size: 12px; font-weight: 700;
      line-height: 1.25; text-overflow: ellipsis; white-space: nowrap;
    }
    .rank-badge.administrator-badge {
      border-color: rgba(190,156,82,.55);
      background: rgba(20,24,28,.86);
    }
    .rank-badge.administrator-badge .rank-ico {
      filter: none;
    }
    .roster-rank-card.administrator-rank {
      border-color: rgba(190,156,82,.4); border-left-color: #a98949;
      background: rgba(24,29,34,.78);
    }
    .roster-rank-card.administrator-rank .roster-rank-copy strong,
    .name-cell.administrator-name {
      color: #d8c28c; text-shadow: none;
    }
    .profile-active-row.administrator-profile {
      color: #d8c28c; border-color: rgba(190,156,82,.42);
      background: rgba(24,29,34,.78);
    }
    .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
    .icon-btn {
      border: 1px solid var(--border-color); background: var(--btn-secondary-bg);
      color: var(--text-label); border-radius: var(--radius); padding: 5px 10px;
      font-size: 11.5px; cursor: pointer; font-family: inherit; transition: all 0.15s;
    }
    .icon-btn:hover { color: #fff; border-color: var(--accent-blue); }
    .icon-btn.danger:hover { color: #fff; background: var(--accent-red); border-color: var(--accent-red); }
    .empty-note { color: var(--text-muted); text-align: center; padding: 36px 12px; font-size: 13px; }
    .readonly-note {
      font-size: 12px; color: var(--text-muted); background: rgba(255,255,255,0.03);
      border: 1px dashed var(--border-color); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 14px;
    }
    .sync-note { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .sync-note.ok { border-color:rgba(0,166,90,.45); color:#85d5a5; }
    .sync-note.error, .sync-note.stale { border-color:rgba(243,156,18,.5); color:var(--accent-amber); }
    .presence { display:inline-flex; align-items:center; gap:5px; margin-left:7px; vertical-align:middle; }
    .presence-dot { width:8px; height:8px; border-radius:50%; display:inline-block; box-shadow:0 0 0 2px rgba(255,255,255,.06); }
    .presence-dot.online { background:#18b66a; }
    .presence-dot.duty { background:#318fd4; }
    .api-details { min-width:210px; color:var(--text-muted); font-size:11.5px; line-height:1.55; }
    .api-details strong { color:var(--text-label); font-weight:600; }
    .api-unmapped { display:inline-block; margin-top:3px; color:var(--accent-amber); font-size:10.5px; }
    .api-managed-note { margin-bottom:14px; border-color:rgba(60,141,188,.5); }
    .weekly-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; margin:14px 0 18px; }
    .weekly-stat { padding:16px; border:1px solid var(--border-color); border-left:3px solid var(--accent-blue); border-radius:4px; background:var(--card-header-bg); }
    .weekly-stat small { display:block; color:var(--text-muted); text-transform:uppercase; letter-spacing:.08em; font:700 9px var(--mono-font); }
    .weekly-stat strong { display:block; margin-top:6px; color:var(--text-main); font-size:20px; }
    .quality-tag { display:inline-block; padding:2px 7px; border-radius:3px; font:700 10px var(--mono-font); text-transform:uppercase; }
    .quality-tag.exact { color:#85d5a5; background:rgba(0,166,90,.14); border:1px solid rgba(0,166,90,.3); }
    .quality-tag.partial, .quality-tag.estimated { color:var(--accent-amber); background:rgba(243,156,18,.12); border:1px solid rgba(243,156,18,.3); }
    .quality-tag.unavailable { color:#ff9da3; background:rgba(210,34,44,.12); border:1px solid rgba(210,34,44,.3); }


    .duty-commander-bar {
      display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
      padding: 14px 18px; margin-bottom: 20px; border-radius: 6px;
      background: linear-gradient(135deg, rgba(210,34,44,0.14), rgba(210,34,44,0.04));
      border: 1px solid rgba(210,34,44,0.32); border-left: 4px solid var(--accent-red);
    }
    .duty-commander-bar .dc-label { font-family: var(--display-font); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; color: #ff9da3; }
    .duty-commander-bar .dc-name { font-size: 16px; font-weight: 700; color: var(--text-main); }
    .duty-commander-bar .dc-name.vacant { color: var(--text-muted); font-weight: 500; font-style: italic; }
    .duty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
    .duty-slot {
      background: var(--card-bg); border: 1px solid var(--border-color);
      border-radius: 6px; padding: 13px 15px; transition: border-color 0.18s, transform 0.18s;
    }
    .duty-slot:hover { border-color: var(--accent-blue); transform: translateY(-2px); }
    .duty-slot .ds-code { font-family: var(--mono-font); font-weight: 600; font-size: 15px; color: var(--accent-amber); letter-spacing: 0.04em; display: flex; align-items: center; justify-content: space-between; }
    .duty-slot .ds-count { font-family: var(--mono-font); font-size: 11px; font-weight: 600; color: var(--text-muted); background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); border-radius: 10px; padding: 1px 8px; }
    .duty-slot .ds-occupant { margin-top: 8px; font-size: 14px; color: var(--text-main); font-weight: 600; }
    .duty-slot .ds-occupant.vacant { color: var(--text-muted); font-weight: 400; font-style: italic; }
    .duty-slot .ds-people { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
    .duty-slot .ds-person {
      font-size: 13.5px; color: var(--text-main); font-weight: 600; padding: 6px 9px;
      background: rgba(60,141,188,0.1); border-left: 3px solid var(--accent-blue); border-radius: 0 var(--radius) var(--radius) 0;
      display: flex; flex-direction: column; gap: 2px; overflow: hidden;
    }
    .ds-person-main { display: flex; align-items: center; min-width: 0; }
    .ds-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ds-person-rank { font-weight: 400; color: var(--text-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .duty-slot select {
      width: 100%; margin-top: 7px; padding: 6px 9px; font-size: 12.5px;
      background: var(--input-bg); border: 1px solid var(--input-border);
      border-radius: var(--radius); color: var(--input-text); font-family: inherit;
    }
    .ds-select-rank {
      font-size: 11px; color: var(--text-muted); padding: 2px 2px 0 2px;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .duty-slot select:focus { outline: none; border-color: var(--accent-blue); }


    .btn-handover {
      padding: 8px 14px; border: 1px solid var(--accent-red); background: transparent;
      color: #ff9da3; border-radius: var(--radius); font-family: var(--display-font);
      font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; font-size: 12px;
      cursor: pointer; transition: all 0.16s;
    }
    .btn-handover:hover { background: var(--accent-red); color: #fff; }
    .btn-clear-duty {
      padding: 8px 14px; border: 1px solid #c73742; background: #a71924;
      color: #fff; border-radius: var(--radius); font-family: var(--display-font);
      font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 12px;
      cursor: pointer; transition: background .16s, border-color .16s;
    }
    .btn-clear-duty:hover { background: #d02d39; border-color: #e54a55; }
    .btn-clear-duty:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    .handover-inbox {
      margin-bottom: 20px; border-radius: 6px; overflow: hidden;
      border: 1px solid var(--accent-amber);
    }
    .handover-inbox .hi-head {
      padding: 10px 16px; background: rgba(232,160,32,0.16); color: var(--accent-amber);
      font-family: var(--display-font); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12.5px;
    }
    .handover-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
    .handover-row + .handover-row { border-top: 1px solid var(--border-color); }
    .handover-row .hr-text { flex: 1; font-size: 13.5px; color: var(--text-main); min-width: 200px; }
    .handover-row .hr-text b { color: var(--accent-amber); }
    .btn-accept { padding: 7px 14px; border: none; border-radius: var(--radius); background: var(--accent-green); color: #fff; font-weight: 600; font-size: 12px; cursor: pointer; font-family: inherit; }
    .btn-accept:hover { filter: brightness(1.12); }
    .btn-decline { padding: 7px 14px; border: 1px solid var(--border-color); border-radius: var(--radius); background: transparent; color: var(--text-muted); font-weight: 600; font-size: 12px; cursor: pointer; font-family: inherit; }
    .btn-decline:hover { color: var(--accent-red); border-color: var(--accent-red); }
    .pending-tag { font-size: 11px; color: var(--accent-amber); font-style: italic; }


    .btn-submit { background-color: var(--accent-green); color: #fff; border-color: #006b35; }
    .btn-submit:hover { filter: brightness(1.12); box-shadow: 0 3px 10px rgba(0,142,70,0.35); }
    .btn-submit:disabled { opacity: 0.55; cursor: wait; filter: none; box-shadow: none; }

    .status-pill {
      font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
      text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
    }
    .status-pill.pending  { background: rgba(232,160,32,0.16); color: var(--accent-amber); border: 1px solid rgba(232,160,32,0.45); }
    .status-pill.approved { background: rgba(0,142,70,0.16);  color: #35c97e; border: 1px solid rgba(0,142,70,0.45); }
    .status-pill.rejected { background: rgba(210,34,44,0.14); color: #ff8f96; border: 1px solid rgba(210,34,44,0.4); }

    .tab-badge {
      display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
      padding: 0 5px; margin-left: 6px; border-radius: 10px;
      background: var(--accent-red); color: #fff;
      font-size: 11px; font-weight: 700; text-align: center; vertical-align: middle;
    }

    .btn-sm.ok:hover { background: rgba(0,142,70,0.12); color: #35c97e; border-color: var(--accent-green); }


    .nav-group-toggle { font-weight: 600; }
    .nav-caret {
      margin-left: auto; font-size: 11px; opacity: 0.7;
      transition: transform 0.25s ease;
    }
    .nav-group-toggle.open .nav-caret { transform: rotate(180deg); }
    .nav-group {
      overflow: hidden; max-height: 0;
      transition: max-height 0.3s ease;
    }
    .nav-group.open { max-height: 260px; }
    .panel-tab.sub { padding-left: 36px; font-size: 13.5px; position: relative; }
    .panel-tab.sub::before {
      content: ''; position: absolute; left: 22px; top: 50%;
      width: 5px; height: 5px; border-radius: 50%;
      background: currentColor; opacity: 0.45; transform: translateY(-50%);
    }
    .panel-tab.sub:hover { padding-left: 40px; }


    #submitReportBtn { display: none; }
    #submitReportBtn.ready { display: inline-block; animation: popIn 0.3s cubic-bezier(.34,1.56,.64,1) both; }
    @keyframes popIn {
      from { opacity: 0; transform: scale(0.85); }
      to   { opacity: 1; transform: scale(1); }
    }
    .submit-hint {
      align-self: center; color: var(--text-muted);
      font-size: 12.5px; font-style: italic;
    }


    .status-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
    .stab {
      display: flex; align-items: center; gap: 7px;
      padding: 7px 13px; border-radius: 20px;
      border: 1px solid var(--border-color); background: transparent;
      color: var(--tab-inactive); font-family: inherit; font-size: 13px;
      cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
    }
    .stab:hover { color: var(--tab-hover); border-color: var(--accent-blue); }
    .stab.active { color: #fff; border-color: var(--accent-blue); background: rgba(60,141,188,0.16); }
    .stab-count {
      min-width: 18px; text-align: center; padding: 1px 7px;
      border-radius: 10px; font-size: 11.5px; font-weight: 700;
      background: rgba(127,127,127,0.15); color: var(--text-label);
    }
    .stab.active .stab-count { background: var(--accent-blue); color: #fff; }

    .user-chip-row {
      display: flex; gap: 6px; flex-wrap: wrap;
      max-height: 104px; overflow-y: auto;
      padding: 8px; margin-bottom: 12px;
      border: 1px solid var(--border-color); border-radius: var(--radius);
      background: var(--input-bg);
    }
    .uchip {
      display: flex; align-items: center; gap: 6px;
      padding: 4px 11px; border-radius: 14px;
      border: 1px solid var(--border-color); background: transparent;
      color: var(--text-label); font-family: inherit; font-size: 12.5px;
      cursor: pointer; white-space: nowrap;
      transition: color 0.15s, border-color 0.15s, background 0.15s;
    }
    .uchip:hover { color: #fff; border-color: var(--accent-blue); }
    .uchip.active { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
    .uchip .ucount { font-size: 11px; opacity: 0.75; }
    .uchip.zero { opacity: 0.5; }
    .uchip.zero:hover, .uchip.active.zero { opacity: 1; }



    .site-report {
      font-family: 'Roboto', sans-serif;
      max-width: 560px; margin: 2px auto; padding: 22px 26px 16px;
      background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012) 120px),
                  var(--card-bg, #10161d);
      border: 1px solid var(--border-color); border-radius: 12px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
      position: relative; overflow: hidden;
    }

    .site-report::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
      background: linear-gradient(90deg, #D2222C 0 33.4%, #e8e8e8 33.4% 66.7%, #008E46 66.7% 100%);
    }
    [data-theme="light"] .site-report {
      background: #fdfdfb;
      box-shadow: 0 8px 26px rgba(28,43,58,0.12), inset 0 1px 0 #fff;
    }
    .sr-head { text-align: center; padding-top: 4px; }
    .site-report .sr-logo {
      display: block; margin: 0 auto 10px; height: 82px; width: auto; object-fit: contain;
      filter: drop-shadow(0 3px 8px rgba(210,34,44,0.35));
    }
    .sr-org {
      text-align: center; font-family: 'Oswald', sans-serif;
      font-size: 12px; font-weight: 600; letter-spacing: 0.22em;
      text-transform: uppercase; color: var(--preview-text); opacity: 0.75;
    }
    .sr-title {
      text-align: center; font-family: 'Oswald', sans-serif;
      font-size: 21px; font-weight: 700; letter-spacing: 0.06em;
      color: #f0f5fa; margin: 3px 0 0;
    }
    [data-theme="light"] .sr-title { color: #1c2b3a; }
    .sr-rule {
      height: 2px; margin: 14px auto 16px; max-width: 300px; border-radius: 2px; border: 0;
      background: linear-gradient(90deg, transparent, var(--accent-red) 18%, #b3872a 50%, var(--accent-green) 82%, transparent);
    }
    .sr-rule.thin { height: 1px; background: var(--border-color); margin: 16px auto 10px; max-width: 100%; }


    .sr-fields {
      display: grid; grid-template-columns: max-content 1fr;
      column-gap: 14px; row-gap: 7px; align-items: baseline;
      margin: 2px 0 4px; padding: 12px 14px;
      background: rgba(255,255,255,0.025);
      border: 1px solid var(--border-color); border-radius: 10px;
    }
    [data-theme="light"] .sr-fields { background: #f3f5f2; }
    .sr-label {
      font-weight: 600; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
      color: #cfa15c; text-align: right; white-space: nowrap;
    }
    [data-theme="light"] .sr-label { color: #9a6a1f; }
    .sr-value { color: var(--preview-text); word-break: break-word; font-size: 14px; line-height: 1.5; }


    .sr-sec {
      margin-top: 14px; border: 1px solid var(--border-color); border-radius: 10px;
      overflow: hidden; background: rgba(255,255,255,0.018);
    }
    [data-theme="light"] .sr-sec { background: #fbfbf8; }
    .sr-sec-title {
      display: flex; align-items: center; gap: 8px;
      font-size: 11.5px; font-weight: 700; letter-spacing: 0.10em;
      text-transform: uppercase; color: #7fb9e6;
      padding: 8px 13px; background: rgba(106,178,232,0.07);
      border-bottom: 1px solid var(--border-color);
    }
    .sr-sec-title::before {
      content: ''; width: 8px; height: 8px; border-radius: 2px; flex: none;
      background: linear-gradient(135deg, var(--accent-red), var(--accent-green));
    }
    [data-theme="light"] .sr-sec-title { color: #2a6a9e; background: rgba(42,106,158,0.06); }
    .sr-sec-body {
      white-space: pre-wrap; color: var(--preview-text); line-height: 1.6;
      word-break: break-word; padding: 11px 14px; font-size: 14px;
    }
    .sr-sec-body a, .sr-value a { color: var(--accent-blue); text-decoration: none; border-bottom: 1px dotted var(--accent-blue); }
    .sr-sec-body a:hover, .sr-value a:hover { border-bottom-style: solid; }
    .report-image-preview-wrap {
      display: block; max-width: 100%; margin: 9px 0 5px;
    }
    .sr-sec-body .report-image-preview-link,
    .sr-value .report-image-preview-link {
      display: inline-block; max-width: 100%; border-bottom: 0;
    }
    #bb-visual-preview .report-image-preview,
    .rep-visual .report-image-preview {
      display: block; width: auto; max-width: 100%; max-height: 420px;
      object-fit: contain; border: 1px solid var(--border-color); border-radius: 3px;
      background: var(--card-bg);
    }
    .report-imgur-embed {
      display: block; width: 100%; max-width: 540px; margin: 9px auto 5px !important;
    }
    .report-imgur-embed iframe {
      display: block; max-width: 100% !important; margin: 0 auto !important;
    }
    .report-image-caption {
      display: block; width: max-content; max-width: 100%; margin-top: 4px;
      font-size: 11px; line-height: 1.35; word-break: break-word;
    }
    .sr-p { color: var(--preview-text); margin: 6px 0; line-height: 1.55; }


    .sr-foot {
      margin-top: 4px; display: flex; justify-content: center;
    }
    .sr-foot span.sr-foot-chip {
      font-size: 11.5px; color: var(--text-muted); letter-spacing: 0.03em;
      padding: 5px 14px; border: 1px dashed var(--border-color); border-radius: 999px;
      background: rgba(255,255,255,0.02);
    }
    .sr-missing {
      color: #ff98a0; font-style: italic; font-size: 12.5px;
      background: rgba(210,34,44,0.10); border: 1px dashed rgba(210,34,44,0.45);
      border-radius: 6px; padding: 1px 8px;
    }
    [data-theme="light"] .sr-missing { color: #b3212b; background: rgba(210,34,44,0.06); }


    .alo-pill {
      display: inline-block; padding: 2px 9px; border-radius: 12px;
      font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
      background: rgba(0,142,70,0.14); color: #35c97e;
      border: 1px solid rgba(0,142,70,0.4); white-space: nowrap;
    }
    .alo-none { color: var(--text-muted); }
    .alo-cell .alo-pill { margin: 1px 3px 1px 0; }


    .label-hint { font-weight: 400; font-size: 11px; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
    .alo-checks { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }


    .modal-card .alo-checks label {
      display: flex; align-items: center; gap: 9px; margin: 0;
      font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0;
      color: var(--preview-text); cursor: pointer; line-height: 1.4;
      padding: 7px 10px; border: 1px solid var(--border-color); border-radius: 8px;
      transition: border-color 0.15s, background 0.15s;
    }
    .modal-card .alo-checks label:hover { border-color: rgba(0,142,70,0.5); }
    .modal-card .alo-checks input { accent-color: #008E46; width: 15px; height: 15px; margin: 0; cursor: pointer; flex: none; }
    .modal-card .alo-checks label:has(input:checked) { border-color: rgba(0,142,70,0.65); background: rgba(0,142,70,0.10); }
    .modal-card .alo-checks .alo-code { font-weight: 800; letter-spacing: 0.04em; min-width: 44px; flex: none; }


    .locked-note { color: var(--text-muted); font-size: 12px; white-space: nowrap; }


    .profile-rank-note { font-size: 11px; color: var(--text-muted); margin: -4px 0 8px; line-height: 1.45; }
    select:disabled { opacity: 0.65; cursor: not-allowed; }

    .rep-review-note {
      margin: 0 14px 10px; padding: 8px 12px;
      border-left: 3px solid var(--accent-blue);
      background: var(--preview-bg); color: var(--text-label);
      font-size: 12.5px; line-height: 1.5;
      border-radius: 0 var(--radius) var(--radius) 0;
    }
    .rep-review-note b { color: var(--text-main); }

    .rep-visual {
      display: none; padding: 16px 14px;
      border-top: 1px dashed var(--border-color);
      background: var(--preview-bg); color: var(--preview-text);
      font-size: 13px; line-height: 1.5; overflow-x: auto;
    }
    .rep-visual.open { display: block; }
    .rep-visual img { max-width: 100%; }


    .modal-overlay {
      position: fixed; inset: 0; z-index: 5000; display: none;
      align-items: center; justify-content: center; background: rgba(0,0,0,0.6); padding: 20px;
    }
    .modal-overlay.open { display: flex; }
    .modal-card {
      width: 100%; max-width: 420px; background: var(--card-bg);
      border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow);
      animation: fadeInUp 0.3s ease both;
    }
    .modal-card .mc-head {
      padding: 15px 20px; border-bottom: 1px solid var(--border-color);
      font-family: var(--display-font); font-weight: 600; letter-spacing: 0.05em;
      text-transform: uppercase; font-size: 15px; color: var(--text-main);
    }
    .modal-card .mc-body { padding: 18px 20px; }
    .modal-card label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-label); margin: 0 0 5px; font-weight: 700; }
    .modal-card input, .modal-card select {
      width: 100%; padding: 9px 11px; margin-bottom: 14px; background: var(--input-bg);
      border: 1px solid var(--input-border); border-radius: var(--radius); color: var(--input-text);
      font-size: 13.5px; font-family: inherit;
    }
    .modal-card input:focus, .modal-card select:focus { outline: none; border-color: var(--accent-blue); }
    .mc-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 18px; }

    @media (max-width: 720px) {
      .roster-table thead { display: none; }
      .roster-table, .roster-table tbody, .roster-table tr, .roster-table td { display: block; width: 100%; }
      .roster-table tr { border: 1px solid var(--border-color); border-radius: 6px; margin-bottom: 10px; padding: 4px 0; }
      .roster-table td { border: none; padding: 6px 14px; }
      .row-actions { justify-content: flex-start; padding-bottom: 10px; }
      .roster-member-table { min-width: 0; }
      .roster-member-table td {
        display: grid; grid-template-columns: 92px minmax(0,1fr); align-items: center; gap: 9px;
      }
      .roster-member-table td::before {
        content: attr(data-label); color: var(--text-muted); font-family: var(--mono-font);
        font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
      }
      .roster-member-table .row-actions { padding-bottom: 0; }
      .roster-rank-card { min-width: 0; max-width: none; }
    }


    .stop-btn {
      display: block; width: 100%; margin-top: 9px; padding: 9px 10px;
      border: 1px solid var(--accent-red); background: var(--accent-red); color: #fff;
      font-family: var(--display-font); font-weight: 600; letter-spacing: 0.04em;
      text-transform: uppercase; font-size: 12px; border-radius: var(--radius);
      cursor: pointer; transition: filter 0.16s;
    }
    .stop-btn:hover { filter: brightness(1.12); }
    .stop-btn.unlock { background: var(--accent-green); border-color: var(--accent-green); }
    .lock-state {
      margin-top: 9px; font-family: var(--display-font); font-weight: 600; letter-spacing: 0.06em;
      text-transform: uppercase; font-size: 11px; color: var(--accent-amber);
      display: flex; align-items: center; gap: 6px;
    }


    #lockGate {
      position: fixed; inset: 0; z-index: 10000;
      display: flex; align-items: center; justify-content: center; padding: 20px;
      background:
        radial-gradient(900px 600px at 50% -10%, rgba(210,34,44,0.22), transparent 60%),
        var(--bg-color);
    }
    #lockGate.hidden { display: none; }
    .lock-card {
      width: 100%; max-width: 440px; text-align: center;
      background: var(--card-bg); border: 1px solid var(--border-color);
      border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,0.5);
      padding: 0 30px 30px; overflow: hidden; animation: fadeInUp 0.4s ease both;
    }
    .lock-bars {
      height: 10px; margin: 0 -30px 26px;
      background: repeating-linear-gradient(135deg, var(--accent-red) 0 16px, #f4f4f4 16px 32px);
    }
    .lock-icon { font-size: 46px; line-height: 1; margin-bottom: 6px; }
    .lock-card h2 {
      margin: 6px 0 8px; font-family: var(--display-font); font-weight: 700;
      letter-spacing: 0.06em; text-transform: uppercase; font-size: 22px; color: var(--text-main);
    }
    .lock-card p { margin: 0 0 22px; color: var(--text-muted); font-size: 14px; line-height: 1.55; }




    :root {
      --radius: 3px;
      --accent-red: #a92a32;
      --accent-green: #28734c;
      --accent-blue: #3f6278;
      --accent-amber: #9b6b22;
      --display-font: 'Roboto', 'Segoe UI', Arial, sans-serif;
      --mono-font: 'Roboto Mono', Consolas, monospace;
      --transition: 0.12s ease;
    }

    [data-theme="light"] {
      color-scheme: light;
      --sidebar-bg: #20282f;
      --sidebar-hover: #2c353d;
      --brand-bg: #171d22;
      --bg-color: #e9e7e2;
      --card-bg: #fdfdfb;
      --card-header-bg: #f4f3ef;
      --text-main: #252b30;
      --text-muted: #697077;
      --text-label: #424a50;
      --border-color: #c9c7c0;
      --input-bg: #ffffff;
      --input-border: #b9b8b2;
      --input-text: #20262a;
      --preview-bg: #f4f3ef;
      --preview-text: #30373c;
      --btn-secondary-bg: #eeede8;
      --btn-secondary-text: #30383e;
      --btn-secondary-border: #bdbbb5;
      --btn-secondary-hover: #e1dfd8;
      --tab-inactive: #70767b;
      --tab-hover: #20262a;
      --banner-bg: #fdfdfb;
      --banner-border: #c6c4bd;
      --nav-label-color: #8d969e;
      --sidebar-link: #c3c9ce;
      --shadow: 0 1px 2px rgba(20,25,29,0.09);
      --scrollbar-bg: #e1dfda;
      --scrollbar-thumb: #a9a7a1;
      --toast-bg: #fff;
      --toast-border: #bdbbb5;
    }

    [data-theme="dark"] {
      color-scheme: dark;
      --sidebar-bg: #181e23;
      --sidebar-hover: #252d33;
      --brand-bg: #101519;
      --bg-color: #101417;
      --card-bg: #181d21;
      --card-header-bg: #1d2327;
      --text-main: #e1e1dc;
      --text-muted: #92999e;
      --text-label: #c0c4c6;
      --border-color: #353d42;
      --input-bg: #111619;
      --input-border: #465057;
      --input-text: #ededE8;
      --preview-bg: #111619;
      --preview-text: #d2d5d5;
      --btn-secondary-bg: #242b30;
      --btn-secondary-text: #d2d5d6;
      --btn-secondary-border: #424a50;
      --btn-secondary-hover: #30383e;
      --tab-inactive: #92999e;
      --tab-hover: #f1f1ed;
      --banner-bg: #181d21;
      --banner-border: #3a4247;
      --nav-label-color: #77828a;
      --sidebar-link: #bac1c5;
      --shadow: none;
      --scrollbar-bg: #181d21;
      --scrollbar-thumb: #465057;
      --toast-bg: #1d2327;
      --toast-border: #465057;
    }

    html { background: var(--bg-color); }

    body {
      font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
      font-size: 14px;
      line-height: 1.45;
      letter-spacing: 0;
      background: var(--bg-color);
    }

    aside {
      width: 274px;
      background: var(--sidebar-bg);
      border-right: 1px solid #343c42;
      box-shadow: none;
    }

    .brand {
      min-height: 78px;
      padding: 13px 18px 12px;
      gap: 13px;
      background: var(--brand-bg);
      border-top: 4px solid var(--accent-red);
      border-bottom: 1px solid #343c42;
      font-family: inherit;
      text-transform: none;
      letter-spacing: 0;
    }
    .brand img {
      width: 48px;
      height: 48px;
      filter: none;
    }
    .brand-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
    .brand-name {
      color: #fff;
      font-size: 17px;
      font-weight: 700;
      letter-spacing: .01em;
      line-height: 1.18;
      text-wrap: balance;
    }
    .brand-name::after {
      content: ''; display: block; width: 42px; height: 2px; margin-top: 7px;
      background: var(--accent-red);
    }

    nav { padding: 8px 0 16px; }
    .nav-label {
      margin: 18px 18px 6px;
      font-family: inherit;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.12em;
    }
    .forum-link, .panel-tab {
      min-height: 38px;
      padding: 9px 18px;
      gap: 9px;
      border-left-width: 3px;
      font-family: inherit;
      font-size: 13.5px;
      font-weight: 400;
      letter-spacing: 0;
      transition: background-color var(--transition), color var(--transition), border-color var(--transition);
    }
    .forum-link:hover, .panel-tab:hover { padding-left: 18px; }
    .panel-tab.active {
      background: #303940;
      border-left-color: #c63b43;
      font-weight: 600;
    }
    .panel-tab.sub { padding-left: 35px; font-size: 13px; }
    .panel-tab.sub:hover { padding-left: 35px; }
    .panel-tab.sub::before {
      left: 21px;
      width: 8px;
      height: 1px;
      border-radius: 0;
    }
    .nav-group, .nav-caret { transition-duration: 0.12s; }

    .session-row {
      margin: 5px 18px 0;
      padding: 10px 11px;
      border-radius: 2px;
      background: #171d22;
      border-color: #363f45;
      color: #b7bfc4;
    }
    .session-row .role-tag,
    .profile-active-row,
    .role-tag.admin,
    .role-tag.user,
    .role-tag.super {
      border-radius: 2px;
      background: transparent;
    }
    .profile-section { padding: 8px 18px 4px; gap: 7px; }
    .profile-section input,
    .profile-section select {
      border-radius: 2px;
      border-color: #465057;
      background: #171d22;
      color: #e1e5e7;
      padding: 8px 10px;
    }
    .profile-section input::placeholder { color: #7e898f; }
    .btn-profile-save {
      min-height: 34px;
      border-radius: 2px;
      background: #303940;
      border-color: #4a555c;
      color: #f1f3f4;
      font-weight: 500;
    }
    .btn-profile-save:hover { background: #3a454d; }

    .theme-toggle-wrap { padding: 12px 18px 16px; border-top-color: #343c42; }
    .theme-toggle {
      min-height: 36px;
      border-radius: 2px;
      background: transparent;
      border-color: #40494f;
      color: #b8c0c5;
    }
    .toggle-track { height: 16px; width: 30px; border-radius: 1px; background: #515b62; }
    .toggle-thumb { width: 10px; height: 10px; top: 2px; left: 2px; border-radius: 1px; box-shadow: none; }
    [data-theme="light"] .toggle-track { background: #6d777e; }
    [data-theme="light"] .toggle-thumb { transform: translateX(14px); }

    main {
      margin-left: 274px;
      width: calc(100% - 274px);
      max-width: none;
      padding: 26px clamp(20px, 3vw, 46px) 48px;
      animation: none;
    }

    .okf-banner {
      min-height: 88px;
      margin: 0 0 25px;
      padding: 18px 22px;
      gap: 17px;
      overflow: visible;
      background: var(--banner-bg);
      border: 1px solid var(--banner-border);
      border-left: 5px solid var(--accent-red);
      border-radius: 0;
      box-shadow: var(--shadow);
      animation: none;
    }
    .okf-banner::before { display: none; }
    .okf-banner img { width: 66px; height: 66px; filter: none; flex: 0 0 auto; }
    .okf-banner-copy { min-width: 0; }
    .okf-banner h1 {
      margin: 0;
      font-family: inherit;
      font-size: clamp(19px, 2.1vw, 26px);
      font-weight: 700;
      letter-spacing: -0.015em;
      line-height: 1.2;
      text-transform: none;
    }

    .header-title {
      margin: 0 0 14px;
      gap: 10px;
      font-family: inherit;
      font-size: 20px;
      font-weight: 700;
      letter-spacing: -0.01em;
      text-transform: none;
    }
    .header-title::before { width: 16px; height: 2px; border-radius: 0; }

    .grid { gap: 16px; align-items: start; }
    .card,
    .card.primary-box,
    .card.secondary-box {
      border: 1px solid var(--border-color);
      border-top-color: var(--border-color);
      border-radius: 0;
      box-shadow: var(--shadow);
      animation: none;
    }
    .card-header {
      min-height: 48px;
      padding: 12px 16px;
      background: var(--card-header-bg);
    }
    .primary-box > .card-header { border-left: 3px solid var(--accent-red); }
    .secondary-box > .card-header { border-left: 3px solid var(--accent-blue); }
    .card-header h2 {
      font-family: inherit;
      font-size: 14px;
      font-weight: 700;
      letter-spacing: 0.025em;
      text-transform: uppercase;
    }
    .card-body { padding: 17px; }

    .subtabs { margin-bottom: 20px; border-bottom-width: 1px; gap: 0; }
    .tab,
    .output-tab {
      border-radius: 0;
      font-weight: 500;
      transition: color var(--transition), border-color var(--transition), background-color var(--transition);
    }
    .tab { padding: 10px 12px; }
    .tab:hover { background: var(--card-header-bg); }
    .output-tabs { gap: 0; }

    .field { margin-bottom: 16px; }
    label { margin-bottom: 6px; font-size: 12.5px; font-weight: 600; }
    input, select, textarea,
    .ro-search,
    .modal-card input,
    .modal-card select {
      border-radius: 2px;
      min-height: 38px;
      padding: 8px 10px;
    }
    input:focus, select:focus, textarea:focus,
    .ro-search:focus,
    .modal-card input:focus,
    .modal-card select:focus {
      border-color: var(--accent-blue);
      box-shadow: 0 0 0 2px rgba(63,98,120,0.16);
    }
    textarea { min-height: 92px; }
    #private_notes { border-radius: 2px; opacity: 1; }

    .actions { gap: 8px; margin-top: 20px; padding-top: 16px; }
    .btn,
    .btn-add,
    .btn-sm,
    .icon-btn,
    .btn-accept,
    .btn-decline,
    .auth-btn,
    .stop-btn,
    .bb-spoiler-toggle {
      min-height: 36px;
      border-radius: 2px;
      box-shadow: none;
      font-family: inherit;
      font-weight: 600;
      letter-spacing: 0;
      text-transform: none;
      transition: background-color var(--transition), border-color var(--transition), color var(--transition);
    }
    .btn:active { transform: none; }
    .btn-primary:hover,
    .btn-submit:hover { box-shadow: none; filter: none; }
    .btn-add { border: 1px solid #1f6340; }
    .btn-add:hover, .btn-accept:hover, .auth-btn:hover, .stop-btn:hover { filter: none; }

    .badge,
    .history-type-badge,
    .pos-pill,
    .rank-pill,
    .status-pill,
    .tab-badge,
    .stab,
    .stab-count,
    .uchip,
    .alo-pill,
    .sr-foot span.sr-foot-chip {
      border-radius: 2px;
    }
    .badge {
      padding: 3px 7px;
      background: transparent;
      border-color: var(--border-color);
      color: var(--text-muted);
    }
    .history-type-badge,
    .pos-pill,
    .rank-pill,
    .alo-pill {
      background: transparent;
    }

    .preview,
    #bb-visual-preview { min-height: 430px; background: var(--preview-bg); }
    .preview-empty svg { opacity: 0.16; }

    .history-item,
    .stat-card,
    .duty-card,
    .duty-commander-bar,
    .readonly-note,
    .rep-review-note,
    .modal-card .alo-checks label {
      border-radius: 2px;
      box-shadow: none;
    }
    .history-item:hover, .stat-card:hover { box-shadow: none; }
    .stat-card { border-top-width: 1px; border-left: 3px solid var(--accent-blue); }
    .stat-card-count { font-size: 28px; font-variant-numeric: tabular-nums; }
    .stat-bar-track, .stat-bar-fill { border-radius: 1px; }
    .stat-bar-fill { transition: width 0.25s ease; }
    .readonly-note { background: var(--card-header-bg); border-style: solid; line-height: 1.5; }
    .duty-commander-bar { background: var(--card-header-bg); }

    .status-tabs { gap: 0; border-bottom: 1px solid var(--border-color); }
    .stab {
      margin-bottom: -1px;
      border-bottom-color: var(--border-color);
      background: var(--card-header-bg);
    }
    .stab.active { color: var(--text-main); background: var(--card-bg); border-color: var(--accent-blue); }
    .user-chip-row { border-radius: 2px; background: var(--card-header-bg); }
    .uchip.active { background: var(--accent-blue); }

    .site-report {
      border-radius: 0;
      background: var(--card-bg);
      box-shadow: none;
    }
    [data-theme="light"] .site-report { background: #fff; box-shadow: none; }
    .site-report .sr-logo { filter: none; }
    .sr-title { font-family: inherit; }
    .sr-rule { background: var(--accent-red); }
    .sr-fields,
    .sr-sec { border-radius: 2px; background: transparent; }
    .sr-sec-title::before { border-radius: 0; background: var(--accent-red); }

    .modal-overlay { background: rgba(15,18,20,0.76); }
    .modal-card {
      max-width: 460px;
      border-radius: 0;
      box-shadow: 0 10px 30px rgba(0,0,0,0.25);
      animation: none;
    }
    .modal-card .mc-head { font-family: inherit; text-transform: none; letter-spacing: 0; font-size: 16px; }

    #toast-container { right: 18px; bottom: 18px; gap: 7px; }
    .toast {
      min-width: 250px;
      padding: 10px 13px;
      border-radius: 2px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.22);
      animation: none;
    }
    .toast > span:first-child {
      display: inline-grid;
      place-items: center;
      width: 20px;
      height: 20px;
      border: 1px solid currentColor;
      font-size: 11px;
      font-weight: 700;
    }

    #authGate, #lockGate { background: var(--bg-color); }
    .auth-card {
      max-width: 760px;
      display: grid;
      grid-template-columns: 290px minmax(0, 1fr);
      border-radius: 0;
      box-shadow: 0 12px 36px rgba(20,24,27,0.24);
      animation: none;
    }
    .auth-top {
      padding: 42px 34px;
      text-align: left;
      border: 0;
      border-right: 1px solid #343c42;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
    }
    .auth-top::after {
      top: 0;
      right: auto;
      bottom: 0;
      width: 5px;
      height: auto;
      background: var(--accent-red);
    }
    .auth-top img { width: 82px; height: 82px; filter: none; }
    .auth-top h2 {
      margin-top: 18px;
      font-family: inherit;
      font-size: 22px;
      letter-spacing: -0.01em;
      text-transform: none;
    }
    .auth-top p { margin-top: 5px; line-height: 1.5; letter-spacing: 0; }
    .auth-body { padding: 38px 42px; display: flex; flex-direction: column; justify-content: center; }
    .auth-body::before {
      content: 'Bejelentkezés';
      display: block;
      margin-bottom: 22px;
      color: var(--text-main);
      font-size: 19px;
      font-weight: 700;
    }
    .auth-body label { font-size: 12px; letter-spacing: 0; text-transform: none; }
    .auth-body input { min-height: 42px; border-radius: 2px; }
    .auth-btn { min-height: 42px; }
    .auth-hint { text-align: left; }

    .lock-card {
      max-width: 430px;
      border-radius: 0;
      box-shadow: 0 12px 36px rgba(0,0,0,0.24);
      animation: none;
    }
    .lock-bars { height: 5px; background: var(--accent-red); }
    .lock-icon {
      display: grid;
      place-items: center;
      width: 44px;
      height: 44px;
      margin: 0 auto 12px;
      border: 2px solid var(--accent-red);
      color: var(--accent-red);
      font-size: 25px;
      font-weight: 700;
    }
    .lock-card h2 { font-family: inherit; text-transform: none; letter-spacing: 0; }

    .mobile-menu-toggle { display: none; }

    #fullPanelContainer,
    #gridContainer,
    .panel-anim,
    #submitReportBtn.ready { animation: none; }

    @media (max-width: 1120px) {
      body { display: block; }
      aside {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        max-height: 100vh;
        overflow: visible;
        z-index: 1000;
        border-right: 0;
        border-bottom: 1px solid #343c42;
      }
      .brand { min-height: 66px; padding: 9px 15px; border-top-width: 3px; }
      .brand img { width: 42px; height: 42px; }
      .mobile-menu-toggle {
        display: block;
        margin-left: auto;
        min-width: 72px;
        min-height: 34px;
        border: 1px solid #4a555c;
        border-radius: 2px;
        background: #252d33;
        color: #e7eaec;
        font-family: inherit;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
      }
      aside nav,
      aside .theme-toggle-wrap { display: none; }
      aside.nav-open nav {
        display: block;
        max-height: calc(100vh - 124px);
        overflow-y: auto;
      }
      aside.nav-open .theme-toggle-wrap { display: block; }
      main { margin-left: 0; width: 100%; padding: 20px; }
      .grid { grid-template-columns: 1fr; }
    }

    @media (max-width: 680px) {
      main { padding: 14px 12px 32px; }
      .okf-banner { min-height: 0; padding: 15px; gap: 12px; }
      .okf-banner img { width: 52px; height: 52px; }
      .okf-banner h1 { font-size: 18px; }
      .card-body { padding: 14px; }
      .actions .btn { flex: 1 1 calc(50% - 8px); }
      .auth-card { max-width: 420px; grid-template-columns: 1fr; }
      .auth-top { padding: 25px 28px 22px; border-right: 0; border-bottom: 1px solid #343c42; }
      .auth-top img { width: 62px; height: 62px; }
      .auth-top h2 { margin-top: 10px; font-size: 19px; }
      .auth-body { padding: 26px 28px 30px; }
      .auth-body::before { margin-bottom: 18px; }
      #toast-container { left: 12px; right: 12px; bottom: 12px; }
      .toast { min-width: 0; max-width: none; width: 100%; }
    }





    .duty-card-head-tools {
      display: flex; align-items: center; gap: 8px;
    }
    .duty-print-btn {
      min-height: 28px; padding: 5px 10px;
      border: 1px solid var(--border-color); border-radius: 2px;
      background: transparent; color: var(--text-muted);
      font-size: 11px; font-weight: 600; font-family: inherit;
      cursor: pointer;
    }
    .duty-print-btn:hover { color: var(--text-main); border-color: var(--text-muted); }

    .real-duty-board {
      --board-ink: #202729;
      --board-muted: #667074;
      --board-line: #aeb6b5;
      --board-soft-line: #d5dad8;
      --board-paper: #f7f9f6;
      --board-panel: #ffffff;
      --board-red: #a71925;
      --board-green: #287148;
      --board-amber: #9b6a12;
      position: relative;
      padding: 17px;
      background: var(--board-paper);
      color: var(--board-ink);
      border: 6px solid #747e80;
      border-top-color: #9ca4a5;
      border-left-color: #90999a;
      border-radius: 2px;
      box-shadow: inset 0 0 0 1px #fff, 0 3px 12px rgba(0,0,0,.18);
      font-family: Arial, 'Segoe UI', sans-serif;
    }
    .real-duty-board::before,
    .real-duty-board::after {
      content: '';
      position: absolute; top: -4px;
      width: 7px; height: 7px;
      background: #474f51; border: 2px solid #c4c9c8; border-radius: 50%;
    }
    .real-duty-board::before { left: 8px; }
    .real-duty-board::after { right: 8px; }

    .duty-board-mast {
      display: grid;
      grid-template-columns: 74px minmax(0,1fr) auto;
      align-items: center;
      min-height: 88px;
      margin-bottom: 12px;
      background: var(--board-panel);
      border: 2px solid var(--board-ink);
    }
    .duty-board-emblem {
      align-self: stretch;
      display: grid; place-items: center;
      padding: 8px;
      border-right: 2px solid var(--board-ink);
    }
    .duty-board-emblem img { width: 54px; height: 54px; object-fit: contain; filter: none; }
    .duty-board-title { min-width: 0; padding: 10px 15px; }
    .duty-board-title .db-org {
      display: block; margin-bottom: 2px;
      color: var(--board-muted); font-size: 9px; font-weight: 700;
      letter-spacing: .14em; text-transform: uppercase;
    }
    .duty-board-title h3 {
      margin: 0;
      color: var(--board-ink); font-family: Arial, sans-serif;
      font-size: clamp(17px,2vw,24px); font-weight: 800;
      letter-spacing: .025em; line-height: 1.15; text-transform: uppercase;
    }
    .duty-board-title p { margin: 4px 0 0; color: var(--board-muted); font-size: 10.5px; }
    .duty-board-date {
      align-self: stretch;
      min-width: 178px; padding: 9px 12px;
      display: flex; flex-direction: column; justify-content: center;
      border-left: 2px solid var(--board-ink); text-align: center;
    }
    .duty-board-date span {
      color: var(--board-muted); font-size: 8.5px; font-weight: 700;
      letter-spacing: .12em; text-transform: uppercase;
    }
    .duty-board-date strong {
      margin-top: 4px; color: var(--board-ink);
      font-family: 'Roboto Mono', Consolas, monospace; font-size: 13px;
    }
    .duty-board-date small { margin-top: 3px; color: var(--board-red); font-size: 9px; font-weight: 700; }

    .real-duty-board .handover-inbox {
      margin-bottom: 11px; border-radius: 0;
      background: #fff; border: 2px solid var(--board-amber);
    }
    .real-duty-board .handover-inbox .hi-head {
      background: #f4ead3; color: #6f4b0c; border-bottom: 1px solid var(--board-amber);
      font-family: Arial, sans-serif;
    }
    .real-duty-board .handover-row { color: var(--board-ink); }
    .real-duty-board .handover-row .hr-text { color: var(--board-ink); }

    .real-duty-board .duty-commander-bar {
      min-height: 58px; margin: 0 0 11px; padding: 9px 11px;
      display: grid;
      grid-template-columns: minmax(280px,1fr) minmax(270px,auto);
      gap: 12px; align-items: center;
      background: #fff; color: var(--board-ink);
      border: 2px solid var(--board-red); border-left-width: 9px;
      border-radius: 0;
    }
    .dc-identity {
      min-width: 0; display: grid;
      grid-template-columns: minmax(130px,auto) auto minmax(0,1fr);
      align-items: center; gap: 9px;
    }
    .dc-identity.no-rank { grid-template-columns: minmax(130px,auto) minmax(0,1fr); }
    .dc-person { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
    .dc-meta { display: flex; flex-wrap: wrap; gap: 4px; }
    .dc-controls { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
    .dc-controls select { min-width: 220px; max-width: 330px; }
    .real-duty-board .duty-commander-bar .dc-label {
      color: var(--board-red); font-family: Arial, sans-serif;
      font-size: 9px; font-weight: 800; letter-spacing: .11em;
    }
    .real-duty-board .duty-commander-bar .dc-name {
      max-width: 100%; overflow: hidden; color: var(--board-ink); font-size: 16px; font-weight: 800;
      line-height: 1.15; text-overflow: ellipsis; white-space: nowrap;
    }
    .real-duty-board .duty-commander-bar .dc-name.vacant { color: var(--board-muted); font-size: 12px; }
    .real-duty-board .duty-commander-bar select {
      min-height: 34px; padding: 6px 8px;
      background: #fff !important; color: var(--board-ink) !important;
      border: 1px solid var(--board-line) !important; border-radius: 1px !important;
    }
    .real-duty-board .duty-commander-bar .rank-pill,
    .real-duty-board .duty-commander-bar .pos-pill {
      background: #fff; border-radius: 1px;
    }
    .real-duty-board .btn-handover {
      padding: 7px 10px; background: #fff; color: var(--board-red);
      border-color: var(--board-red); border-radius: 1px;
    }
    .real-duty-board .btn-clear-duty {
      padding: 7px 10px; background: var(--board-red); color: #fff;
      border-color: #6f1820; border-radius: 1px;
    }
    .real-duty-board .btn-clear-duty:hover { background: #a9202a; }

    .real-duty-board .readonly-note {
      margin: 0 0 11px; padding: 7px 10px;
      background: #e8eff2; color: #33464e;
      border: 1px solid #9aabb2; border-left: 4px solid #466b7a;
      border-radius: 0; font-size: 10.5px;
    }

    .real-duty-board .duty-grid { display: block; }
    .duty-board-section { margin-top: 12px; }
    .duty-board-section:first-child { margin-top: 0; }
    .duty-section-head {
      min-height: 31px; padding: 6px 9px;
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      background: var(--board-ink); color: #fff;
      border: 2px solid var(--board-ink);
    }
    .duty-section-head strong {
      font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
    }
    .duty-section-head span { color: #cbd1d1; font-size: 9px; }
    .duty-apparatus-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit,minmax(290px,1fr));
      border-left: 2px solid var(--board-ink);
    }

    .real-duty-board .duty-slot {
      min-width: 0; margin: 0; padding: 0;
      display: flex; flex-direction: column;
      background: var(--board-panel); color: var(--board-ink);
      border: 0; border-right: 2px solid var(--board-ink); border-bottom: 2px solid var(--board-ink);
      border-radius: 0; transform: none; box-shadow: none;
    }
    .real-duty-board .duty-slot:hover { border-color: var(--board-ink); transform: none; }
    .real-duty-board .duty-slot .ds-code {
      min-height: 44px; padding: 6px 9px;
      display: grid; grid-template-columns: minmax(70px,auto) 1fr auto; align-items: center; gap: 8px;
      background: #e8ece9; color: var(--board-ink);
      border-bottom: 1px solid var(--board-line);
      font-family: Arial, sans-serif;
    }
    .ds-call-sign {
      color: var(--board-red); font-family: 'Roboto Mono', Consolas, monospace;
      font-size: 14px; font-weight: 800; letter-spacing: .02em;
    }
    .ds-vehicle-type {
      overflow: hidden; color: var(--board-muted);
      font-size: 8.5px; font-weight: 700; letter-spacing: .06em;
      text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap;
    }
    .ds-readiness {
      padding: 3px 5px; border: 1px solid currentColor;
      border-radius: 1px; font-size: 7.5px; font-weight: 900;
      letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
    }
    .ds-readiness.ready { background: #e6f0e9; color: var(--board-green); }
    .ds-readiness.partial { background: #f5ecd7; color: var(--board-amber); }
    .ds-readiness.empty { background: #f4e2e4; color: var(--board-red); }
    .ds-status-stack {
      display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
    }
    .ds-dual-role {
      padding: 3px 6px; background: #234b5b; color: #fff;
      border: 1px solid #173744; border-radius: 1px;
      font-size: 7.5px; font-weight: 900; letter-spacing: .08em;
      line-height: 1; text-transform: uppercase; white-space: nowrap;
    }

    .ds-crew-table { width: 100%; flex: 1; display: flex; flex-direction: column; }
    .ds-crew-row {
      min-height: 74px; flex: 1;
      display: grid; grid-template-columns: 122px minmax(0,1fr); align-items: stretch;
      border-bottom: 1px solid var(--board-soft-line);
    }
    .ds-crew-row:last-child { border-bottom: 0; }
    .ds-role-label {
      min-width: 0; padding: 7px 8px;
      display: flex; align-items: center;
      background: #f0f2ef; color: var(--board-muted);
      border-right: 1px solid var(--board-line);
      font-size: 8px; font-weight: 800; line-height: 1.25;
      letter-spacing: .035em; text-transform: uppercase;
      overflow-wrap: anywhere; hyphens: auto;
    }
    .ds-role-label.required::before { content: '•'; margin-right: 5px; color: var(--board-red); font-size: 14px; line-height: 0; }
    .ds-assignee { min-width: 0; min-height: 73px; padding: 6px 7px; display: flex; flex-direction: column; justify-content: center; }
    .ds-assignee.is-dual-role { background: #eef5f7; }
    .ds-assignee select {
      width: 100%; min-height: 32px; margin: 0; padding: 5px 7px;
      background: #fff; color: var(--board-ink);
      border: 1px solid var(--board-line); border-radius: 1px;
      font-size: 11px;
    }
    .ds-assignee select:focus { outline: 2px solid #557887; outline-offset: 0; }
    .ds-rank-line {
      min-width: 0; min-height: 34px; margin-top: 4px;
      display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 7px;
    }
    .ds-rank-line.no-image { grid-template-columns: minmax(0,1fr) auto; }
    .ds-rank-line .rank-badge { margin: 0; background: #f7f4e9; border-color: #b8b29f; }
    .ds-rank-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
    .ds-rank-copy small {
      color: #68777d; font-size: 7px; font-weight: 800; letter-spacing: .07em;
      line-height: 1; text-transform: uppercase;
    }
    .ds-rank-copy strong {
      overflow: hidden; color: #29383e; font-size: 9px; font-weight: 800;
      line-height: 1.2; text-overflow: ellipsis; white-space: nowrap;
    }
    .ds-dual-inline {
      align-self: center; margin: 0; padding: 2px 5px;
      background: #dce9ed; color: #234b5b; border: 1px solid #9db5be;
      font-size: 7.5px; font-weight: 900; letter-spacing: .06em;
      line-height: 1.2; text-transform: uppercase; white-space: nowrap;
    }
    .ds-name-strip {
      min-height: 54px; padding: 6px 7px;
      display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 7px;
      background: #fffdf4; color: var(--board-ink);
      border: 1px solid #bdb8a7; border-left: 4px solid #455e69;
      box-shadow: 0 1px 2px rgba(0,0,0,.12);
      font-size: 11px; font-weight: 700;
    }
    .ds-name-strip.no-rank-image { grid-template-columns: minmax(0,1fr) auto; }
    .ds-name-strip .rank-badge { margin: 0; background: #f7f4e9; border-color: #b8b29f; }
    .ds-person-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
    .ds-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ds-rank-text {
      overflow: hidden; color: #5c6c72; font-size: 8.5px; font-weight: 700;
      letter-spacing: .02em; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap;
    }
    .ds-empty-strip { color: #9ba1a0; font-size: 10px; font-style: italic; }

    .duty-board-foot {
      margin-top: 13px; padding-top: 8px;
      display: flex; justify-content: flex-end; gap: 15px;
      color: var(--board-muted); border-top: 1px solid var(--board-line);
      font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    }

    @media (max-width: 900px) {
      .duty-board-mast { grid-template-columns: 62px minmax(0,1fr); }
      .duty-board-date { grid-column: 1/-1; min-width: 0; border-top: 2px solid var(--board-ink); border-left: 0; }
      .real-duty-board .duty-commander-bar { grid-template-columns: 1fr; }
      .dc-controls { justify-content: flex-start; }
      .dc-controls select { width: min(100%,360px); max-width: none; }
    }
    @media (max-width: 560px) {
      #beosztasFullPanel .card-body { padding: 8px; }
      .real-duty-board { padding: 8px; border-width: 3px; }
      .duty-board-emblem { display: none; }
      .duty-board-mast { grid-template-columns: 1fr; }
      .duty-board-title { padding: 10px; }
      .duty-board-date { grid-column: auto; }
      .dc-identity { grid-template-columns: auto minmax(0,1fr); }
      .dc-identity .dc-label { grid-column: 1/-1; }
      .dc-controls, .dc-controls select, .dc-controls button { width: 100%; }
      .ds-crew-row { grid-template-columns: 112px minmax(0,1fr); }
      .duty-apparatus-grid { grid-template-columns: 1fr; }
      .duty-card-head-tools { gap: 5px; }
      .duty-print-btn { display: none; }
    }

    @media print {
      body { display: block; background: #fff !important; }
      aside, .okf-banner, .header-title, #gridContainer,
      #sajatjelentesekFullPanel, #ellenorzesFullPanel, #elozmenyFullPanel,
      #statisztikaFullPanel, #allomanyFullPanel, #hetiidoFullPanel, #naploFullPanel,
      .duty-print-btn, #handoverInboxWrap, .theme-toggle-wrap { display: none !important; }
      main { width: 100% !important; margin: 0 !important; padding: 0 !important; }
      #fullPanelContainer, #beosztasFullPanel { display: block !important; }
      #beosztasFullPanel .card { margin: 0 !important; border: 0 !important; box-shadow: none !important; }
      #beosztasFullPanel .card-header { padding: 0 0 8px !important; background: #fff !important; color: #000 !important; }
      #beosztasFullPanel .card-body { padding: 0 !important; }
      .real-duty-board { border: 2px solid #333 !important; box-shadow: none !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
      .duty-apparatus-grid { grid-template-columns: repeat(3,1fr); }
      .ds-crew-row { min-height: 39px; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
    }


    #authGate {
      display: block;
      padding: 0;
      overflow-x: hidden;
      overflow-y: auto;
      background: #101417;
      color: #f5f5f2;
    }
    #authGate.hidden { display: none; }
    #authGate .auth-shell {
      display: grid;
      grid-template-columns: minmax(0, 58fr) minmax(410px, 42fr);
      min-height: 100vh;
      min-height: 100svh;
    }
    #authGate .auth-hero {
      position: relative;
      min-height: 100%;
      overflow: hidden;
      background: #343735;
    }
    #authGate .auth-hero > img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: 28% center;
    }
    #authGate .auth-hero::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(10,12,15,.1) 15%, rgba(8,11,13,.24) 54%, rgba(6,9,11,.8) 100%);
      pointer-events: none;
    }
    #authGate .auth-hero-copy {
      position: absolute;
      z-index: 1;
      left: clamp(28px, 5vw, 104px);
      right: 24px;
      bottom: clamp(35px, 8vh, 100px);
      color: #fff;
      text-shadow: 0 2px 18px rgba(0,0,0,.55);
    }
    #authGate .auth-hero-copy::before {
      content: '';
      display: block;
      width: 82px;
      height: 3px;
      margin-bottom: 22px;
      background: #e6b154;
    }
    #authGate .auth-hero-eyebrow {
      display: block;
      color: #f1c46a;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: .32em;
      text-transform: uppercase;
    }
    #authGate .auth-hero-copy h1 {
      margin: 10px 0 5px;
      color: #fff;
      font-family: var(--display-font), sans-serif;
      font-size: clamp(40px, 4.8vw, 76px);
      font-weight: 700;
      line-height: .99;
      letter-spacing: .01em;
      text-transform: uppercase;
    }
    #authGate .auth-hero-copy p {
      margin: 14px 0 0;
      color: #e4e8e8;
      font-size: clamp(14px, 1.2vw, 18px);
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    #authGate .auth-right {
      position: relative;
      isolation: isolate;
      display: grid;
      place-items: center;
      padding: 42px 28px;
      overflow: hidden;
      background: #15191b;
    }
    #authGate .auth-right::before {
      content: '';
      position: absolute;
      z-index: -1;
      inset: -36px;
      background: linear-gradient(rgba(9,12,14,.82),rgba(9,12,14,.88)), url('../kepek/laktanya.png?v=20261010a') center/cover;
      filter: blur(18px);
      pointer-events: none;
    }
    #authGate .auth-card {
      display: block;
      width: min(100%, 430px);
      max-width: 430px;
      margin: 0;
      overflow: hidden;
      border: 1px solid rgba(233,174,87,.3);
      border-radius: 18px;
      background: rgba(12,15,18,.96);
      box-shadow: 0 28px 80px rgba(0,0,0,.43);
      animation: none;
    }
    #authGate .auth-top {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 34px 36px 10px;
      border: 0;
      background: transparent;
      text-align: center;
    }
    #authGate .auth-top::after { display: none; }
    #authGate .auth-top img { width: 88px; height: 88px; object-fit: contain; filter: none; }
    #authGate .auth-top h2 {
      margin: 15px 0 0;
      color: #fff;
      font-family: var(--display-font), sans-serif;
      font-size: 26px;
      font-weight: 600;
      letter-spacing: .01em;
      text-transform: none;
    }
    #authGate .auth-top p { margin: 6px 0 0; color: #aeb6b9; font-size: 13px; }
    #authGate .auth-body { display: flex; flex-direction: column; padding: 25px 30px 30px; }
    #authGate .auth-body::before { display: none; }
    #authGate .auth-body label { margin: 0 0 7px; color: #e6e9e9; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
    #authGate .auth-body input {
      box-sizing: border-box;
      min-height: 47px;
      margin-bottom: 20px;
      padding: 11px 13px;
      border: 1px solid #464c52;
      border-radius: 9px;
      background: #181c20;
      color: #fff;
      font-size: 14px;
    }
    #authGate .auth-body input::placeholder { color: #939ca1; }
    #authGate .auth-body input:focus { outline: 2px solid rgba(225,74,75,.3); border-color: #dc4a4d; }
    #authGate .auth-error { min-height: 18px; margin: -6px 0 13px; color: #ff8589; }
    #authGate .auth-btn {
      min-height: 48px;
      border-radius: 9px;
      background: #c82632;
      color: #fff;
      font-family: inherit;
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0;
      text-transform: none;
    }
    #authGate .auth-btn:hover { background: #df303c; filter: none; }
    #authGate .auth-hint { margin-top: 15px; color: #aeb6b9; font-size: 11px; line-height: 1.55; text-align: center; }
    @media (max-width: 960px) {
      #authGate .auth-shell { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 33vh) minmax(0, 1fr); }
      #authGate .auth-hero > img { object-position: center 57%; }
      #authGate .auth-hero-copy { left: 28px; bottom: 24px; }
      #authGate .auth-hero-copy::before { margin-bottom: 10px; }
      #authGate .auth-hero-copy h1 { font-size: clamp(31px, 6vw, 54px); }
      #authGate .auth-right { min-height: 430px; padding: 24px 18px 36px; }
    }
    @media (max-width: 520px) {
      #authGate .auth-shell { grid-template-rows: minmax(195px, 28vh) minmax(0, 1fr); }
      #authGate .auth-hero-copy { left: 18px; right: 16px; bottom: 17px; }
      #authGate .auth-hero-eyebrow { font-size: 10px; letter-spacing: .2em; }
      #authGate .auth-hero-copy h1 { margin-top: 8px; font-size: clamp(29px, 8.5vw, 42px); }
      #authGate .auth-hero-copy p { margin-top: 6px; font-size: 12px; }
      #authGate .auth-right { padding: 0 12px 24px; }
      #authGate .auth-card { border-radius: 0 0 16px 16px; }
      #authGate .auth-top { padding: 24px 24px 8px; }
      #authGate .auth-top img { width: 70px; height: 70px; }
      #authGate .auth-top h2 { font-size: 23px; }
      #authGate .auth-body { padding: 18px 22px 24px; }
    }

    #authGate { background: #111618; }
    #authGate .auth-shell {
      position: relative;
      isolation: isolate;
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: auto minmax(180px, 1fr) auto;
      min-height: 100vh;
      min-height: 100svh;
    }
    #authGate .auth-shell::before {
      content: '';
      position: absolute;
      z-index: -1;
      inset: 0;
      background: linear-gradient(90deg, rgba(7,13,16,.76) 0%, rgba(7,13,16,.22) 62%, rgba(7,13,16,.07) 100%),
                  linear-gradient(0deg, rgba(7,13,16,.7) 0%, transparent 58%);
      pointer-events: none;
    }
    #authGate .auth-shell::after {
      content: '';
      position: absolute;
      left: 0; right: 0; bottom: 0;
      height: 5px;
      background: linear-gradient(90deg, #ba2934 0 38%, #f2eee6 38% 64%, #288357 64% 100%);
    }
    #authGate .auth-hero {
      position: absolute;
      z-index: -2;
      inset: 0;
      min-height: 0;
      background: #343735;
    }
    #authGate .auth-hero > img {
      object-position: center 50%;
      filter: saturate(.78) contrast(1.05);
    }
    #authGate .auth-hero::after { display: none; }
    #authGate .auth-masthead {
      position: relative;
      z-index: 1;
      grid-row: 1;
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 22px clamp(22px, 5vw, 84px);
      border: 0;
      background: none;
      backdrop-filter: none;
    }
    #authGate .auth-masthead img { width: 46px; height: 46px; object-fit: contain; }
    #authGate .auth-masthead-name { display: flex; flex-direction: column; gap: 3px; }
    #authGate .auth-masthead-name span {
      color: #f0b7bb;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: .2em;
    }
    #authGate .auth-masthead-name strong {
      color: #fff;
      font-family: var(--display-font), sans-serif;
      font-size: 18px;
      font-weight: 600;
      letter-spacing: .025em;
    }
    #authGate .auth-masthead-tag {
      margin-left: auto;
      padding: 7px 12px;
      border: 1px solid rgba(255,255,255,.32);
      color: #fff;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    #authGate .auth-hero-copy {
      position: relative;
      z-index: 1;
      grid-row: 2;
      align-self: end;
      left: auto; right: auto; bottom: auto;
      max-width: none;
      padding: 32px clamp(22px, 5vw, 84px) 20px;
      text-shadow: 0 3px 16px rgba(0,0,0,.5);
    }
    #authGate .auth-hero-copy::before { display: none; }
    #authGate .auth-hero-copy h1 {
      margin: 0;
      font-family: var(--display-font), sans-serif;
      font-size: clamp(24px, 6vw, 74px);
      font-weight: 600;
      line-height: 1.05;
      letter-spacing: -.025em;
      text-transform: none;
      white-space: nowrap;
    }
    #authGate .auth-right {
      position: relative;
      z-index: 1;
      grid-row: 3;
      display: flex;
      justify-content: flex-start;
      min-height: 0;
      padding: 0 clamp(22px, 5vw, 84px) clamp(30px, 6vh, 70px);
      overflow: visible;
      background: none;
    }
    #authGate .auth-right::before { display: none; }
    #authGate .auth-card {
      display: block;
      width: min(100%, 460px);
      max-width: none;
      border: 1px solid rgba(255,255,255,.28);
      border-left: 4px solid #c32b37;
      border-radius: 3px;
      background: rgba(13,22,26,.88);
      box-shadow: 0 24px 70px rgba(0,0,0,.42);
      backdrop-filter: blur(15px);
    }
    #authGate .auth-body {
      display: flex;
      flex-direction: column;
      padding: 26px 30px 27px;
    }
    #authGate .auth-form-title {
      margin: 0 0 20px;
      color: #fff;
      font-family: var(--display-font), sans-serif;
      font-size: 24px;
      font-weight: 600;
    }
    #authGate .auth-body label { color: #e7eeee; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
    #authGate .auth-body input {
      min-height: 44px;
      margin-bottom: 16px;
      border: 1px solid #617078;
      border-radius: 2px;
      background: rgba(4,10,13,.64);
    }
    #authGate .auth-body input:focus { outline: 2px solid rgba(201,53,64,.32); border-color: #d74b56; }
    #authGate .auth-error { min-height: 16px; margin: 0 0 7px; }
    #authGate .auth-btn {
      width: 100%;
      min-height: 44px;
      border-radius: 2px;
      background: #c32b37;
      color: #fff;
      font-weight: 700;
    }
    #authGate .auth-hint {
      margin: 15px 0 0;
      text-align: center;
      font-size: 11px;
    }
    #authGate .auth-hint .account-link { font-size: 11px; color: #f2bec2; }
    @media (max-width: 800px) {
      #authGate .auth-shell { grid-template-rows: auto minmax(180px, 1fr) auto; }
      #authGate .auth-body { padding: 22px 24px 24px; }
    }
    @media (max-width: 560px) {
      #authGate .auth-masthead { gap: 10px; padding: 12px 18px; }
      #authGate .auth-masthead img { width: 42px; height: 42px; }
      #authGate .auth-masthead-name strong { font-size: 15px; }
      #authGate .auth-hero-copy { padding: 20px 18px 17px; }
      #authGate .auth-hero-copy h1 { font-size: clamp(21px, 6.2vw, 35px); }
      #authGate .auth-right { padding: 0 12px 20px; }
      #authGate .auth-body { padding: 22px 22px 23px; }
      #authGate .auth-body input { margin-bottom: 11px; }
      #authGate .auth-error { margin: 0 0 9px; }
      #authGate .auth-hint { margin-top: 13px; }
    }
    @media print { #authGate { display: none !important; } }
