
    /*
      ============================================================
      CORE THEME / LAYOUT VARIABLES
      ============================================================
    */
    :root {
      --bg: #07070a;
      --panel: #101014;
      --panel-2: #15151d;
      --button: #242434;
      --button-active: #34344a;
      --admin-button: #1d1d28;

      --text: #ffffff;
      --muted: #a0a0ad;
      --border: #2d2d3a;
      --accent: #7aa2ff;
      --danger: #ff7a7a;

      --radius: clamp(18px, 2.2vw, 34px);

      --page-pad-x: clamp(18px, 3vw, 48px);
      --page-pad-y: clamp(10px, 1.8vh, 28px);
      --gap: clamp(16px, 2vw, 34px);

      --header-height: clamp(52px, 10vh, 78px);
      --tabs-height: clamp(58px, 8vh, 84px);
      --footer-height: clamp(34px, 4vh, 52px);
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      overflow: hidden;
      background: var(--bg);
      color: var(--text);
      font-family: Arial, Helvetica, sans-serif;
    }

    body {
      min-width: 320px;
      min-height: 240px;
    }

    /*
      ============================================================
      MAIN DASHBOARD SHELL
      ============================================================
    */
    .dashboard {
      width: 100vw;
      height: 100vh;
      height: 100dvh;
      display: grid;
      grid-template-rows:
        var(--header-height)
        var(--tabs-height)
        1fr
        var(--footer-height);
      background: var(--bg);
      overflow: hidden;
    }

    /*
      ============================================================
      HEADER
      ============================================================
    */
    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 12px var(--page-pad-x) 8px;
      background: var(--panel);
      border-bottom: 1px solid var(--border);
      min-height: 0;
    }

    .title-block {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: clamp(6px, 1vw, 12px);
    }

    .title-block h1 {
      margin: 0;
      font-size: clamp(22px, 3vw, 38px);
      line-height: 1;
      font-weight: 800;
      white-space: nowrap;
    }

    .header-logo {
      display: block;
      width: auto;
      height: clamp(46px, 8vh, 68px);
      max-width: min(44vw, 372px);
    }

    .logo-link {
      display: block;
      flex: 0 0 auto;
      text-decoration: none;
      -webkit-tap-highlight-color: transparent;
    }

    .subtitle {
      margin: 0;
      color: var(--muted);
      font-size: clamp(12px, 1.5vw, 18px);
      white-space: nowrap;
    }

    .clock {
      text-align: right;
      min-width: max-content;
      flex-shrink: 0;
    }

    .time {
      font-size: clamp(22px, 3vw, 38px);
      font-weight: 800;
      line-height: 1;
    }

    .date {
      margin-top: 5px;
      color: var(--muted);
      font-size: clamp(12px, 1.5vw, 18px);
      white-space: nowrap;
    }

    /*
      ============================================================
      TABS
      ============================================================
    */
    .tabs {
      display: flex;
      align-items: center;
      gap: clamp(12px, 1.8vw, 26px);
      padding: 10px var(--page-pad-x);
      background: #0d0d12;
      border-bottom: 1px solid var(--border);
      min-height: 0;
      overflow-x: auto;
      overflow-y: hidden;
    }

    .tab {
      height: 100%;
      flex: 0 0 auto;
      min-width: max-content;
      min-width: -webkit-max-content;
      padding: 0 clamp(28px, 4vw, 54px);
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--panel-2);
      color: var(--muted);
      font-size: clamp(22px, 2.8vw, 36px);
      font-weight: 800;
      white-space: nowrap;
      overflow: visible;
      text-overflow: clip;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .tab.active {
      background: var(--accent);
      color: #06101f;
      border-color: var(--accent);
    }

    /*
      ============================================================
      MAIN CONTENT / PANELS
      ============================================================
    */
    main {
      min-height: 0;
      padding: var(--page-pad-y) var(--page-pad-x);
      overflow: hidden;
    }

    .tab-panel {
      display: none;
      width: 100%;
      height: 100%;
      min-height: 0;
    }

    .tab-panel.active {
      display: block;
    }

    .grid {
      width: 100%;
      height: 100%;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: repeat(2, minmax(0, 1fr));
      gap: var(--gap);
      min-height: 0;
    }

    .admin-grid {
      width: 100%;
      height: 100%;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: 1fr;
      gap: var(--gap);
      min-height: 0;
    }

    /*
      ============================================================
      BUTTONS
      ============================================================
    */
    .button {
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: clamp(18px, 3vw, 46px);
      border-radius: var(--radius);
      background: var(--button);
      color: var(--text);
      text-decoration: none;
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
      border: 1px solid rgba(255, 255, 255, 0.055);
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      overflow: hidden;
    }

    .button:active {
      transform: scale(0.985);
      background: var(--button-active);
    }

    .admin-button {
      background: var(--admin-button);
    }

    .lan-only-button.hidden {
      display: none;
    }

    .button-title {
      display: block;
      font-size: 64px;
      font-weight: 800;
      line-height: 1.05;
      white-space: normal;
      overflow: visible;
      text-overflow: clip;
      word-break: keep-all;
      overflow-wrap: normal;
    }

    .button-subtitle {
      display: block;
      margin-top: clamp(8px, 1.4vh, 18px);
      color: var(--muted);
      font-size: 22px;
      line-height: 1.2;
      white-space: normal;
      overflow: visible;
      word-break: normal;
      overflow-wrap: normal;
    }

    /*
      ============================================================
      FOOTER
      ============================================================
    */
    footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: clamp(10px, 2vw, 24px);
      padding: 0 var(--page-pad-x);
      background: #0d0d12;
      border-top: 1px solid var(--border);
      color: var(--muted);
      font-size: clamp(12px, 1.4vw, 17px);
      white-space: nowrap;
      overflow: hidden;
      min-height: 0;
    }

    .local-only {
      color: var(--accent);
      font-weight: 800;
    }

    .warning {
      color: var(--danger);
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /*
      ============================================================
      SMALL LANDSCAPE CLEANUP
      ============================================================
    */
    @media (max-width: 760px) and (orientation: landscape) {
      .date,
      .subtitle,
      footer .warning {
        display: none;
      }
    }

    @media (max-height: 520px) and (orientation: landscape) {
      :root {
        --header-height: 48px;
        --tabs-height: 54px;
        --footer-height: 30px;
        --page-pad-y: 8px;
        --gap: 12px;
      }

      .subtitle,
      .date {
        display: none;
      }

      .tab {
        font-size: 22px;
      }
    }

    /*
      ============================================================
      PORTRAIT LAYOUT
      ============================================================
    */
    @media (orientation: portrait) {
      :root {
        --header-height: clamp(78px, 11vh, 118px);
        --tabs-height: clamp(62px, 7vh, 90px);
        --footer-height: clamp(42px, 5vh, 62px);
        --page-pad-x: clamp(14px, 4vw, 30px);
        --page-pad-y: clamp(14px, 2vh, 26px);
        --gap: clamp(14px, 3vw, 24px);
      }

      header {
        align-items: flex-start;
        padding-top: clamp(12px, 2vh, 22px);
        padding-bottom: clamp(10px, 1.6vh, 18px);
      }

      .title-block h1 {
        font-size: clamp(24px, 6vw, 42px);
      }

      .header-logo {
        height: clamp(54px, 9vh, 82px);
        max-width: min(54vw, 420px);
      }

      .subtitle,
      .date {
        font-size: clamp(12px, 3vw, 18px);
      }

      .time {
        font-size: clamp(24px, 6vw, 42px);
      }

      .tabs {
        gap: clamp(8px, 2vw, 16px);
        padding-top: 9px;
        padding-bottom: 9px;
      }

      .tab {
        padding: 0 clamp(20px, 5vw, 38px);
        font-size: clamp(20px, 5vw, 32px);
      }

      .grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, minmax(0, 1fr));
      }

      .admin-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, minmax(0, 1fr));
      }

      .button {
        padding: clamp(20px, 5vw, 38px);
      }

      .button-title {
        font-size: 56px;
      }

      .button-subtitle {
        font-size: 22px;
      }

      footer {
        font-size: clamp(12px, 3vw, 18px);
      }
    }
