
    :root {
      --ph-bg: #070708;
      --ph-surface-tray: #0a0b0c;
      --ph-surface-1: #100d0d;
      --ph-surface-2: #0f1112;
      --ph-surface-3: #121215;
      --ph-surface-4: #16161a;
      --ph-surface-5: #1c1c20;
      --ph-line-1: #16161a;
      --ph-line-2: #1f1f24;
      --ph-line-3: #222227;
      --ph-line-4: #2a2a30;
      --ph-accent: #ff0008;
      --ph-accent-glow: rgba(255, 0, 8, 0.35);
      --ph-accent-soft: rgba(255, 0, 8, 0.12);
      --ph-accent-line: rgba(255, 0, 8, 0.4);
      --ph-accent-ink: #130b0c;
      --ph-accent-text: #ff0008;
      --ph-text-1: #f2f2f3;
      --ph-text-2: #e7e7ea;
      --ph-text-3: #c9c9cf;
      --ph-text-4: #a9a9b0;
      --ph-text-5: #8b8b92;
      --ph-text-6: #6a6a72;
      --ph-text-7: #5d5d64;
      --ph-text-8: #4a4a52;
      --ph-ok: #66da85;
      --ph-ok-text: #86efac;
      --ph-bad: #ff645f;
      --ph-bad-text: #ff948c;
      --ph-warn: #f7bc50;
      --ph-cut-xs: 4px;
      --ph-cut-sm: 8px;
      --ph-cut-md: 12px;
      --ph-cut-lg: 16px;
      --ph-dur: 0.18s;
      --ph-press-scale: 0.98;
      --ph-font-display: 'Tektur', 'Chakra Petch', sans-serif;
      --ph-font-body: 'Chakra Petch', sans-serif;
      --ph-font-mono: 'JetBrains Mono', monospace;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
    }

    body {
      background-color: var(--ph-bg);
      color: var(--ph-text-1);
      font-family: var(--ph-font-body);
      min-height: 100vh;
      min-height: 100dvh;
      overflow-x: hidden;
      display: flex;
      justify-content: center;
    }

    /* Viewport Frame */
    .ph-viewport {
      width: 100%;
      max-width: 440px;
      min-height: 100dvh;
      background: var(--ph-bg);
      position: relative;
      display: flex;
      flex-direction: column;
      box-shadow: 0 0 50px rgba(0, 0, 0,0.8);
      border-inline: 1px solid rgba(255, 255, 255,0.04);
    }

    /* Scanlines */
    .ph-scanlines {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      pointer-events: none;
      z-index: 9999;
      background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
      background-size: 100% 4px;
      opacity: 0.65;
    }

    /* Ambient cyber background */
    .cyber-bg-glow {
      position: absolute;
      top: -100px;
      left: 50%;
      transform: translateX(-50%);
      width: 380px;
      height: 380px;
      background: radial-gradient(circle, var(--ph-accent-soft) 0%, transparent 70%);
      pointer-events: none;
      z-index: 0;
      filter: blur(40px);
    }

    /* App Header */
    .ph-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px;
      border-bottom: 1px solid var(--ph-line-1);
      background: rgba(7, 7, 8, 0.85);
      backdrop-filter: blur(12px);
      position: sticky;
      top: 0;
      z-index: 50;
    }

    .ph-header__title {
      font-family: var(--ph-font-display);
      font-size: 19px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--ph-text-1);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .ph-header__actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* Cut clip path shapes */
    .cut-xs {
      clip-path: polygon(var(--ph-cut-xs) 0, 100% 0, 100% calc(100% - var(--ph-cut-xs)), calc(100% - var(--ph-cut-xs)) 100%, 0 100%, 0 var(--ph-cut-xs));
    }
    .cut-sm {
      clip-path: polygon(var(--ph-cut-sm) 0, 100% 0, 100% calc(100% - var(--ph-cut-sm)), calc(100% - var(--ph-cut-sm)) 100%, 0 100%, 0 var(--ph-cut-sm));
    }
    .cut-md {
      clip-path: polygon(var(--ph-cut-md) 0, 100% 0, 100% calc(100% - var(--ph-cut-md)), calc(100% - var(--ph-cut-md)) 100%, 0 100%, 0 var(--ph-cut-md));
    }

    /* Buttons */
    .ph-btn {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border: none;
      outline: none;
      cursor: pointer;
      font-family: var(--ph-font-display);
      transition: all var(--ph-dur) ease;
    }
    .ph-btn:active {
      transform: scale(var(--ph-press-scale));
    }

    .ph-btn--primary {
      background: var(--ph-accent);
      color: var(--ph-accent-ink);
      font-size: 15px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      height: 48px;
      width: 100%;
      box-shadow: 0 0 20px var(--ph-accent-glow);
    }
    .ph-btn--primary:hover {
      background: #ff383e;
      box-shadow: 0 0 30px rgba(255, 0, 8, 0.6);
    }

    .ph-btn--secondary {
      background: var(--ph-surface-4);
      color: var(--ph-text-2);
      border: 1px solid var(--ph-line-2);
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.05em;
      height: 40px;
    }
    .ph-btn--secondary:hover {
      background: var(--ph-surface-5);
      border-color: var(--ph-line-3);
    }

    .ph-btn--danger-soft {
      background: rgba(255, 100, 95, 0.12);
      color: var(--ph-bad-text);
      border: 1px solid rgba(255, 100, 95, 0.3);
      font-size: 14px;
      font-weight: 800;
      letter-spacing: 0.08em;
      height: 52px;
      width: 100%;
    }
    .ph-btn--danger-soft:hover {
      background: rgba(255, 100, 95, 0.2);
    }

    .ph-iconbtn {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--ph-surface-3);
      border: 1px solid var(--ph-line-2);
      color: var(--ph-text-3);
      cursor: pointer;
      position: relative;
    }
    .ph-iconbtn:hover {
      background: var(--ph-surface-4);
      color: var(--ph-text-1);
    }

    .ph-bell__dot {
      position: absolute;
      top: 6px;
      right: 6px;
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--ph-bad);
      box-shadow: 0 0 8px var(--ph-bad);
    }

    /* Main View Container */
    .ph-view {
      flex: 1;
      padding: 16px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 14px;
      position: relative;
      z-index: 1;
    }

    /* Status Pill */
    .ph-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      background: var(--ph-surface-3);
      border: 1px solid var(--ph-line-2);
      color: var(--ph-text-3);
    }
    .ph-status::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: currentColor;
    }
    .ph-status--ok {
      color: var(--ph-ok);
      border-color: rgba(102, 218, 133, 0.3);
      background: rgba(102, 218, 133, 0.08);
    }
    .ph-status--ok::before {
      box-shadow: 0 0 8px var(--ph-ok);
      animation: pulse-dot 1.8s infinite;
    }
    .ph-status--bad {
      color: var(--ph-bad);
      border-color: rgba(255, 100, 95, 0.3);
      background: rgba(255, 100, 95, 0.08);
    }

    @keyframes pulse-dot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.4; transform: scale(0.85); }
    }

    /* HUD Time Ring */
    .ph-hud {
      position: relative;
      width: 100%;
      height: 310px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: radial-gradient(circle at 50% 50%, var(--ph-accent-soft) 0%, transparent 68%);
      border: 1px solid var(--ph-line-2);
      border-radius: 6px;
      overflow: hidden;
    }
    .ph-hud__corner {
      position: absolute;
      width: 10px;
      height: 10px;
      border-color: var(--ph-accent);
      border-style: solid;
      pointer-events: none;
    }
    .ph-hud__corner:nth-child(1) { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
    .ph-hud__corner:nth-child(2) { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
    .ph-hud__corner:nth-child(3) { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
    .ph-hud__corner:nth-child(4) { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }

    .ph-ring__center {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      text-align: center;
      z-index: 2;
    }
    .ph-ring__time {
      font-family: var(--ph-font-display);
      font-size: 26px;
      font-weight: 900;
      letter-spacing: 0.06em;
      color: var(--ph-text-1);
      text-shadow: 0 0 16px var(--ph-accent-glow);
    }
    .ph-ring__label {
      font-size: 11px;
      letter-spacing: 0.08em;
      color: var(--ph-text-5);
      text-transform: uppercase;
    }

    /* Key Chip */
    .ph-keychip {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--ph-surface-2);
      border: 1px solid var(--ph-line-2);
      padding: 10px 14px;
    }
    .ph-keychip__val {
      font-family: var(--ph-font-mono);
      font-size: 14px;
      letter-spacing: 0.08em;
      color: var(--ph-accent-text);
      font-weight: 600;
    }
    .ph-keychip__btn {
      padding: 6px 12px;
      background: var(--ph-surface-4);
      color: var(--ph-text-3);
      border: 1px solid var(--ph-line-3);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .ph-keychip__btn:hover {
      background: var(--ph-surface-5);
      color: var(--ph-text-1);
    }

    /* Fact Grid */
    .ph-fact-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .ph-fact-card {
      background: var(--ph-surface-2);
      border: 1px solid var(--ph-line-2);
      padding: 10px 8px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .ph-fact__label {
      font-size: 10px;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--ph-text-6);
    }
    .ph-fact__val {
      font-family: var(--ph-font-display);
      font-size: 12px;
      font-weight: 700;
      color: var(--ph-text-2);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Connect Dock Button */
    .ph-connect-dock {
      padding: 10px 16px 12px;
      background: var(--ph-bg);
      border-top: 1px solid var(--ph-line-1);
    }
    .ph-connect {
      width: 100%;
      height: 60px;
      background: linear-gradient(135deg, #1f1313 0%, #281919 100%);
      border: 1px solid var(--ph-accent);
      color: var(--ph-text-1);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 18px;
      cursor: pointer;
      box-shadow: 0 0 24px var(--ph-accent-soft);
      transition: all var(--ph-dur) ease;
    }
    .ph-connect:active {
      transform: scale(0.98);
    }
    .ph-connect__title {
      font-family: var(--ph-font-display);
      font-size: 15px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--ph-accent-text);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .ph-connect__dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--ph-accent);
      box-shadow: 0 0 10px var(--ph-accent);
      animation: pulse-dot 1.4s infinite;
    }
    .ph-connect__sub {
      font-size: 11px;
      color: var(--ph-text-5);
      text-align: right;
    }

    /* Tab Bar */
    .ph-tabbar {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      background: #0c0909;
      border-top: 1px solid var(--ph-line-2);
      padding: 8px 12px 14px;
      gap: 4px;
    }
    .ph-tab {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
      background: transparent;
      border: none;
      color: var(--ph-text-6);
      cursor: pointer;
      padding: 6px 0;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      position: relative;
      transition: color var(--ph-dur) ease;
    }
    .ph-tab svg {
      transition: color var(--ph-dur) ease;
    }
    .ph-tab.active {
      color: var(--ph-text-1);
    }
    .ph-tab.active svg {
      color: var(--ph-accent);
      filter: drop-shadow(0 0 8px var(--ph-accent-glow));
    }
    .ph-tab.active::before {
      content: "";
      position: absolute;
      top: -9px;
      left: 50%;
      transform: translateX(-50%);
      width: 32px;
      height: 2px;
      background: var(--ph-accent);
      box-shadow: 0 0 10px var(--ph-accent);
    }

    /* Feature Cards */
    .ph-feature-card {
      background: var(--ph-surface-2);
      border: 1px solid var(--ph-line-2);
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .ph-feature-card__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .ph-feature-card__title {
      font-family: var(--ph-font-display);
      font-size: 14px;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .ph-feature-card__desc {
      font-size: 12px;
      color: var(--ph-text-5);
      line-height: 1.45;
    }

    /* Badges / Tags */
    .ph-tag {
      display: inline-flex;
      align-items: center;
      padding: 2px 6px;
      font-size: 9.5px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      background: var(--ph-surface-4);
      border: 1px solid var(--ph-line-3);
      color: var(--ph-text-4);
    }
    .ph-tag--new {
      background: rgba(255, 0, 8, 0.12);
      border-color: rgba(255, 0, 8, 0.4);
      color: var(--ph-accent-text);
    }
    .ph-tag--risk {
      background: rgba(255, 100, 95, 0.12);
      border-color: rgba(255, 100, 95, 0.4);
      color: var(--ph-bad-text);
    }

    /* Cyber Switches */
    .ph-switch {
      width: 44px;
      height: 24px;
      background: #191c1e;
      border: 1px solid var(--ph-line-3);
      border-radius: 12px;
      position: relative;
      cursor: pointer;
      transition: all var(--ph-dur) ease;
    }
    .ph-switch__knob {
      position: absolute;
      top: 2px;
      left: 2px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: var(--ph-text-4);
      transition: all var(--ph-dur) cubic-bezier(0.18, 0.89, 0.32, 1.28);
    }
    .ph-switch[aria-checked="true"] {
      background: var(--ph-accent);
      border-color: var(--ph-accent);
      box-shadow: 0 0 12px var(--ph-accent-glow);
    }
    .ph-switch[aria-checked="true"] .ph-switch__knob {
      left: 22px;
      background: var(--ph-accent-ink);
    }

    /* Chips Group */
    .ph-chips {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
    }
    .ph-chip {
      padding: 8px 4px;
      font-size: 11px;
      font-weight: 700;
      text-align: center;
      background: var(--ph-surface-3);
      border: 1px solid var(--ph-line-2);
      color: var(--ph-text-4);
      cursor: pointer;
      text-transform: uppercase;
      transition: all var(--ph-dur) ease;
    }
    .ph-chip:hover {
      background: var(--ph-surface-4);
      color: var(--ph-text-2);
    }
    .ph-chip.active {
      background: var(--ph-accent);
      border-color: var(--ph-accent);
      color: var(--ph-accent-ink);
      font-weight: 800;
      box-shadow: 0 0 10px var(--ph-accent-soft);
    }

    /* Slider */
    .ph-slider-box {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 6px;
    }
    .ph-slider-val {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;
    }
    .ph-range {
      -webkit-appearance: none;
      width: 100%;
      height: 6px;
      background: var(--ph-surface-5);
      outline: none;
      border-radius: 3px;
    }
    .ph-range::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 16px;
      height: 24px;
      background: var(--ph-accent);
      cursor: pointer;
      border-radius: 2px;
      box-shadow: 0 0 10px var(--ph-accent);
    }
    .ph-presets {
      display: flex;
      gap: 6px;
      justify-content: space-between;
    }
    .ph-preset-btn {
      flex: 1;
      padding: 4px 0;
      font-size: 10.5px;
      font-weight: 700;
      background: var(--ph-surface-3);
      border: 1px solid var(--ph-line-2);
      color: var(--ph-text-4);
      cursor: pointer;
    }
    .ph-preset-btn:hover {
      background: var(--ph-surface-4);
      color: var(--ph-text-1);
    }

    /* Migration Card */
    .ph-migr-card {
      background: linear-gradient(135deg, rgba(255, 0, 8, 0.1) 0%, rgba(16, 13, 13, 0.9) 60%);
      border: 1px solid var(--ph-accent-line);
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .ph-migr-eyebrow {
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--ph-accent-text);
    }
    .ph-migr-body {
      font-size: 12.5px;
      color: var(--ph-text-3);
      line-height: 1.45;
    }

    /* Key Input Gate */
    .ph-gate {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 22px;
      padding: 24px 16px;
      margin: auto 0;
      z-index: 10;
    }
    .ph-gate-input-box {
      width: 100%;
      background: var(--ph-surface-1);
      border: 1px solid var(--ph-line-3);
      padding: 4px 6px;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: border-color var(--ph-dur) ease;
    }
    .ph-gate-input-box:focus-within {
      border-color: var(--ph-accent);
      box-shadow: 0 0 16px var(--ph-accent-soft);
    }
    .ph-gate-input-box[data-error="true"] {
      border-color: var(--ph-bad);
      animation: shake 0.35s ease;
    }
    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      20%, 60% { transform: translateX(-6px); }
      40%, 80% { transform: translateX(6px); }
    }
    .ph-gate-input {
      flex: 1;
      height: 48px;
      background: transparent;
      border: none;
      outline: none;
      color: var(--ph-text-1);
      font-family: var(--ph-font-mono);
      font-size: 16px;
      font-weight: 700;
      letter-spacing: 0.12em;
      text-align: center;
    }

    /* Modal / Scrim */
    .ph-scrim {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(8px);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }
    .ph-modal {
      width: 100%;
      max-width: 400px;
      background: var(--ph-surface-1);
      border: 1px solid var(--ph-line-3);
      padding: 18px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      box-shadow: 0 0 40px rgba(0, 0, 0,0.9);
    }
    .ph-modal__head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--ph-line-2);
      padding-bottom: 10px;
    }
    .ph-modal__title {
      font-family: var(--ph-font-display);
      font-size: 16px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    /* Toast Notification */
    .ph-toast {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--ph-surface-4);
      border: 1px solid var(--ph-accent);
      color: var(--ph-accent-text);
      padding: 8px 18px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      box-shadow: 0 0 20px var(--ph-accent-glow);
      z-index: 2000;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.25s ease;
    }
    .ph-toast.show {
      opacity: 1;
    }

    .hidden {
      display: none !important;
    }

    /* Original KeyGate proportions, isolated from dashboard styles. */
    .ph-viewport { max-width:448px; border:0; box-shadow:none; }
    .ph-viewport:has(.gate-screen:not(.hidden)) > .cyber-bg-glow { display:none; }
    body > .ph-scanlines {
      position:fixed; left:50%; transform:translateX(-50%); width:min(100%,448px);
      background:repeating-linear-gradient(0deg,#ffffff04 0 1px,transparent 1px 3px); opacity:1;
    }
    .gate-screen {
      --ph-accent:#f8383e; --ph-accent-ink:#0b0b0c;
      --ph-accent-line:color-mix(in oklch,var(--ph-accent) 55%,transparent);
      --ph-accent-text:color-mix(in oklch,var(--ph-accent) 70%,white);
      --ph-accent-glow:color-mix(in oklch,var(--ph-accent) 45%,transparent);
      --ph-font-display:var(--ph-f-display),var(--ph-f-body),var(--ph-f-kufi),sans-serif;
      --ph-font-body:var(--ph-f-body),var(--ph-f-arabic),sans-serif;
      --ph-font-mono:var(--font-jetbrains-mono),var(--ph-f-body),monospace;
      --ph-cut-xs:6px; --ph-cut-sm:10px; --ph-cut-md:14px;
      min-height:100vh; min-height:100dvh; width:100%; display:flex; flex-direction:column;
      position:relative; overflow:hidden; font:var(--ph-type-body);
    }
    .gate-header { height:64px; flex:none; display:flex; align-items:center; justify-content:flex-end; padding:0 14px; }
    .gate-language { display:flex; align-items:center; gap:8px; height:38px; background:var(--ph-surface-3); padding:0 12px; color:var(--ph-text-3); }
    .gate-language select { appearance:none; border:0; background:transparent; color:inherit; font:var(--ph-type-label); letter-spacing:.08em; cursor:pointer; }
    .gate-language option { background:#16161a; color:#e7e7ea; }
    .gate-language:focus-within { outline:1px solid var(--ph-accent); }
    .gate-brand { min-height:214px; }
    .gate-brand img { max-width:100%; object-fit:contain; }
    .gate-form { position:relative; z-index:1; padding:0 20px 22px; display:flex; flex-direction:column; gap:14px; }
    .gate-field { display:flex; flex-direction:column; gap:10px; }
    .gate-key-label { display:flex; align-items:center; gap:8px; }
    .gate-key-label > span:first-child { width:6px; height:6px; background:var(--ph-accent); }
    .gate-error { color:var(--ph-bad-text); font:var(--ph-type-body-sm); }
    .gate-error:empty { display:none; }
    .gate-help { display:flex; flex-direction:column; gap:4px; text-align:center; }
    #txtNoKey { font:var(--ph-type-body); color:var(--ph-text-4); }
    #txtTimeStarts { font:var(--ph-type-body-sm); color:var(--ph-text-7); }
    #screenGate .ph-btn--primary { height:62px; min-height:62px; font:var(--ph-type-button-lg); letter-spacing:.1em; box-shadow:none; }
    #screenGate .ph-btn--primary:hover { background:#fa6569; box-shadow:none; }
    #screenGate .ph-btn--primary:disabled { opacity:.7; cursor:wait; }
    #screenGate input { user-select:text; }
    #screenGate .ph-keyinput__paste:focus-visible { outline:2px solid var(--ph-accent); outline-offset:-3px; }
  
@font-face{font-family:'LINE Seed Sans TH';src:url('../fonts/line-seed/LINESeedSansTH_W_Rg.woff2')}@font-face{font-family:'LINE Seed Sans TH';src:url('../fonts/line-seed/LINESeedSansTH_W_Bd.woff2');font-weight:700}
:root{--ph-font-body:'Chakra Petch','LINE Seed Sans TH',sans-serif;--ph-font-display:'Tektur','LINE Seed Sans TH',sans-serif}
[hidden]{display:none!important}.hidden{display:none!important}.gate-brand img{max-width:75vw;object-fit:contain}.ph-keychip__val{overflow-wrap:anywhere;user-select:text}.ph-keychip>div{min-width:0}.ph-keyinput input{min-width:0;width:100%;text-transform:none}.fw-controls{display:grid;gap:10px}.fw-controls label{font-size:11px;color:var(--ph-text-5);display:grid;gap:5px}.fw-controls select{width:100%;color:var(--ph-text-1);background:var(--ph-surface-3);border:1px solid var(--ph-line-3);padding:10px;font:inherit;border-radius:0}.fw-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.fw-copy{word-break:break-all;user-select:text;font-family:var(--ph-font-mono);font-size:10px;color:var(--ph-accent-text)}.fw-actions{display:flex;gap:8px;flex-wrap:wrap}.fw-actions>*{flex:1}.fw-link{color:var(--ph-accent-text);text-decoration:underline}.fw-note{font-size:12px;line-height:1.6;color:var(--ph-text-5)}.ph-ring__time{font-size:clamp(16px,5vw,25px);max-width:290px;text-align:center}.ph-fact__val{overflow-wrap:anywhere}.ph-view{min-height:0}button:focus-visible,a:focus-visible,select:focus-visible{outline:2px solid var(--ph-accent);outline-offset:3px}.gate-error{overflow-wrap:anywhere}.ph-tabbar{padding-bottom:env(safe-area-inset-bottom)}

.ph-viewport{min-width:0;overflow-x:clip}.cyber-bg-glow{max-width:100%}#screenDashboard{width:100%;min-width:0}.ph-view,.fw-controls,.fw-row>*{min-width:0}.ph-header__title{min-width:0}.ph-header__actions{flex-shrink:0}

.ph-keychip__btn{flex-shrink:0;white-space:nowrap;min-width:70px}.fw-controls .fw-check{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:var(--ph-text-3)}.fw-check input{accent-color:var(--ph-accent);width:18px;height:18px}#fw-network{border:1px solid var(--ph-line-2);padding:14px}#fw-network legend{font-size:12px;color:var(--ph-accent-text);padding:0 5px}
/* Login: layered cyan atmosphere, designed to stay behind the form. */
.gate-screen{isolation:isolate;background:radial-gradient(ellipse at 50% 35%,#28181938,transparent 58%),#0c0707}
.fw-gate-effects{position:absolute;inset:0;overflow:hidden;z-index:-1;pointer-events:none}
.gate-header{position:relative;z-index:2}.gate-language{border:1px solid #ff636820;box-shadow:0 0 20px #e90a1108}
.fw-gate-aura{position:absolute;width:340px;height:340px;border-radius:50%;background:radial-gradient(circle,#ff000827,transparent 68%);animation:fw-aura-drift 13s ease-in-out infinite alternate;will-change:transform}
.fw-gate-aura--one{top:10%;left:-45%;opacity:.8}.fw-gate-aura--two{bottom:5%;right:-55%;background:radial-gradient(circle,#ff161d20,transparent 67%);animation-delay:-7s}
.fw-gate-grid{position:absolute;inset:0;background-image:linear-gradient(#ff333906 1px,transparent 1px),linear-gradient(90deg,#ff333906 1px,transparent 1px);background-size:36px 36px;mask-image:linear-gradient(transparent,#000000 30%,#000000 70%,transparent);transform-origin:50% 80%;opacity:.7;animation:fw-grid-drift 24s linear infinite}
.fw-gate-orbit{position:absolute;top:38%;left:50%;width:276px;height:276px;margin:-138px;border:1px solid #f521271a;border-radius:50%;background:conic-gradient(from 0deg,transparent 0deg 70deg,#ff404625 80deg,transparent 95deg 250deg,#ff40461c 260deg,transparent 275deg);mask-image:radial-gradient(circle,transparent 67%,#000000 68%);animation:fw-orbit 32s linear infinite}
.fw-gate-orbit:after{content:'';position:absolute;inset:12px;border:1px dashed #f5353b2b;border-radius:50%}
.fw-gate-sweep{position:absolute;inset:-100% 0 100%;background:linear-gradient(transparent 80%,#ff454b08 96%,#ff454b1a 100%);animation:fw-scan 12s linear infinite;opacity:.5}
.fw-gate-effects>i{position:absolute;left:var(--x);bottom:-10px;width:2px;height:2px;border-radius:50%;background:#ff7a7e;box-shadow:0 0 8px #ff1920;animation:fw-particle calc(16s + var(--n)*1s) linear infinite;animation-delay:var(--delay);opacity:0}
.gate-brand img{filter:drop-shadow(0 0 22px #ff000828);animation:fw-logo-float 7s ease-in-out infinite}
.gate-form{animation:fw-form-enter .65s ease-out both}.gate-form .ph-keyinput{transition:box-shadow .25s,border-color .25s;background:#191010e0}
.gate-form .ph-keyinput:focus-within{box-shadow:0 0 0 1px #ff474d55,0 0 26px #ff000814}
#screenGate .ph-btn--primary{position:relative;overflow:hidden;box-shadow:0 8px 35px #ef000718;transition:box-shadow .25s,filter .25s}
#screenGate .ph-btn--primary:before{content:'';position:absolute;inset:0;background:linear-gradient(105deg,transparent 30%,#ffffff33 48%,transparent 65%);transform:translateX(-130%);animation:fw-button-shine 8s ease-in-out infinite;pointer-events:none}
#screenGate .ph-btn--primary:hover{box-shadow:0 8px 40px #ff000835;filter:brightness(1.05)}
@keyframes fw-aura-drift{to{transform:translate(130px,-35px) scale(1.18)}}
@keyframes fw-grid-drift{to{background-position:36px 72px}}
@keyframes fw-orbit{to{transform:rotate(360deg)}}
@keyframes fw-scan{to{transform:translateY(200%)}}
@keyframes fw-particle{0%{opacity:0;transform:translateY(0)}15%,70%{opacity:.45}100%{opacity:0;transform:translate(12px,-80vh)}}
@keyframes fw-logo-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes fw-form-enter{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:translateY(0)}}
@keyframes fw-button-shine{0%,70%{transform:translateX(-130%)}92%,100%{transform:translateX(130%)}}
/* Feature information and accessible native switches. */
.fw-module{gap:10px;padding:16px!important;background:linear-gradient(120deg,#1d1212,#150d0d)!important;border:1px solid #ff686d13}
.fw-module-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.fw-module-head strong{font-size:14px;line-height:1.5}
.fw-module-status{flex-shrink:0;align-self:flex-start;display:inline-flex;align-items:center;gap:5px;font-size:9px!important;white-space:nowrap;padding:4px 7px!important}.fw-module-status i{width:4px;height:4px;background:currentColor;border-radius:50%;display:inline-block}
.fw-setting-description{font-family:var(--ph-font-body);font-size:11.5px;line-height:1.7;font-weight:400;color:#ad9394;letter-spacing:0;margin:0}
#fw-network{border:1px solid #e5545829;background:linear-gradient(130deg,#1c1111,#160d0e);padding:16px;gap:12px}#fw-network legend{font-size:12px;letter-spacing:.04em;padding:0 7px}
.fw-preferences-note{font-size:11px;line-height:1.7;color:#cca6a7;background:#c60e140a;border-inline-start:2px solid #ef363c66;padding:10px 12px;margin-bottom:4px}
.fw-setting{display:flex;align-items:center;gap:16px;padding:15px 0;border-bottom:1px solid #ffc1c30c}.fw-setting-copy{flex:1;min-width:0}.fw-setting-title,.fw-controls label.fw-setting-title{display:block;color:#f8e5e6;font-size:12.5px;font-weight:700;line-height:1.6;margin:0 0 5px;cursor:pointer}
.fw-controls label.fw-toggle{display:flex;position:relative;flex:0 0 48px;flex-direction:column;align-items:center;gap:5px;cursor:pointer;align-self:center}
.fw-toggle input{position:absolute;inset:0;width:100%;height:100%;opacity:0;margin:0;cursor:pointer;z-index:1}
.fw-toggle-track{display:block;width:46px;height:26px;border-radius:16px;background:#392728;border:1px solid #956a6b4d;box-shadow:inset 0 1px 3px #00000055;transition:background .2s,border-color .2s,box-shadow .2s}
.fw-toggle-track>span{position:absolute;top:4px;left:4px;width:18px;height:18px;border-radius:50%;background:#c1a9aa;box-shadow:0 1px 4px #00000055;transition:transform .2s,background .2s}
.fw-toggle input:checked+.fw-toggle-track{background:#e51319;border-color:#ff676c;box-shadow:0 0 15px #ff000822}
.fw-toggle input:checked+.fw-toggle-track>span{transform:translateX(20px);background:#251617}
.fw-toggle input:focus-visible+.fw-toggle-track{outline:2px solid #ffb5b7;outline-offset:4px}
.fw-toggle-state{font:9px var(--ph-font-mono);color:#a58c8d;line-height:1.3;letter-spacing:.06em}.fw-toggle input:checked~.fw-toggle-state{color:#f84d52}
#fw-network:disabled{opacity:.65}.fw-select-setting{display:grid;gap:7px;margin-top:4px}.fw-select-setting select{margin-top:3px;min-height:44px}
@media(max-width:350px){.fw-module-head{flex-direction:column;gap:7px}.fw-setting{gap:12px}.fw-setting-description{font-size:11px}}
@media(prefers-reduced-motion:reduce){.fw-gate-effects *,.gate-brand img,.gate-form,#screenGate .ph-btn--primary:before{animation:none!important}.fw-gate-effects>i{display:none}.fw-toggle-track,.fw-toggle-track>span{transition:none}.gate-form{opacity:1;transform:none}}
.fw-self-reset{display:grid;gap:10px;margin-top:8px;padding-top:14px;border-top:1px solid #ff7c8016}.fw-self-reset button{width:100%;min-height:44px}#fw-reset-availability{color:var(--ph-accent-text);font-size:11px}
#fw-reset-dialog{position:fixed;inset:0;margin:auto;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow-y:auto;border:1px solid #f3454a4d;background:linear-gradient(145deg,#251617,#160d0e);color:var(--ph-text-1);padding:22px;box-shadow:0 20px 100px #000000cc;z-index:10000;font-family:var(--ph-font-body)}
#fw-reset-dialog::backdrop{background:#090606db;backdrop-filter:blur(7px)}.fw-reset-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}.fw-reset-dialog-head h2{font-size:18px;line-height:1.5}.fw-reset-dialog-head button{flex-shrink:0;font-size:23px}#fw-reset-key{margin-bottom:14px;font-size:12px}#fw-reset-description{line-height:1.8}#fw-reset-rule{margin:15px 0}.fw-reset-error{font-size:12px;color:var(--ph-bad-text);line-height:1.6;margin-bottom:12px}.fw-reset-error:empty{display:none}#fw-reset-dialog .fw-actions{gap:10px}#fw-reset-dialog .fw-actions button{min-height:44px;font-size:12px;padding:8px 12px}#fw-reset-dialog button:disabled{opacity:.45;cursor:wait}
