﻿* { box-sizing: border-box; }
    :root {
      --safe-top: max(16px, env(safe-area-inset-top));
      --safe-bottom: max(16px, env(safe-area-inset-bottom));
      --safe-left: env(safe-area-inset-left, 0px);
      --safe-right: env(safe-area-inset-right, 0px);
      --tab-bar-height: 56px;
      --top-bar-height: 48px;
      --phone-nav-h: 78px;
    }
    body {
      margin: 0;
      font-family: Inter, "Noto Sans TC", Arial, sans-serif;
      background: radial-gradient(circle at top, #1e293b, #0f172a 45%, #020617);
      color: #fff;
    }
    html, body {
      height: 100%;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }
    *, *::before, *::after { box-sizing: border-box; }
    img, svg { max-width: 100%; height: auto; }
    img { -webkit-user-drag: none; user-drag: none; pointer-events: auto; }
    button, input, select, textarea { font-family: inherit; }
    button, a, [role="button"], label, nav, header {
      touch-action: manipulation;
      -webkit-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
    }
    /* ============================================================
       Mobile Fix ? IG/Threads ???????
       ???????????????????????
       ============================================================ */
    @media (max-width: 860px) {
      html, body, #mainApp {
        margin: 0;
        padding: 0;
        width: 100%;
        min-height: 100%;
        height: 100%;
        height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
      }
      body {
        position: fixed;
        inset: 0;
      }
      input, textarea, select {
        font-size: 16px;
        -webkit-user-select: text;
        user-select: text;
        -webkit-touch-callout: default;
      }
      input[type="text"], input[type="password"], input[type="email"],
      input[type="tel"], input[type="number"], textarea {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 0;
      }
    }
    .app { max-width: 1480px; margin: 0 auto; padding: 16px; }
    .layout { display: block; min-height: calc(100vh - 32px); }
    .card {
      background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.038));
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 36px;
      box-shadow: 0 20px 60px rgba(0,0,0,.35);
      backdrop-filter: blur(16px);
      min-width: 0;
    }
    .sidebar { padding: 0; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 140; max-height: none; overflow: visible; }
    .hero {
      background: linear-gradient(135deg, #fdba74, #fecdd3, #fde68a);
      color: #0f172a;
      padding: 20px;
      border-radius: 32px;
    }
    .muted { color: rgba(255,255,255,.62); }
    .small { font-size: 12px; }
    .nav { margin-top: 16px; display: grid; gap: 10px; }
    .nav button, .action-btn, .secondary-btn, .ghost, .danger, .toggle {
      cursor: pointer;
      font-weight: 900;
      transition: transform .18s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease, opacity .22s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .nav button {
      width: 100%; border: 1px solid rgba(255,255,255,.08); text-align: left;
      padding: 14px 16px; border-radius: 22px; color: white;
      background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.045)); font-size: 15px;
      box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.06);
      backdrop-filter: blur(10px);
    }
    .nav button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.16); }
    .nav button:active { transform: scale(.985); }
    .nav button.active {
      background: linear-gradient(135deg, #ffffff, #f8fafc 46%, #fbcfe8 100%);
      color: #0f172a;
      border-color: rgba(255,255,255,.9);
      box-shadow: 0 14px 28px rgba(0,0,0,.2);
    }
    
    .iphone-nav-shell {
      padding: 10px 12px calc(10px + var(--safe-bottom));
      background: linear-gradient(180deg, rgba(2,6,23,.2), rgba(2,6,23,.88) 28%, rgba(2,6,23,.98) 100%);
      backdrop-filter: blur(24px);
      border-top: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 -12px 40px rgba(0,0,0,.24);
    }
    .nav.nav-dock {
      margin: 0 auto;
      max-width: 540px;
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 10px;
      padding: 8px;
      border-radius: 32px;
      background: linear-gradient(180deg, rgba(15,23,42,.96), rgba(15,23,42,.88));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 18px 40px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.04);
      backdrop-filter: blur(18px);
    }
    .nav.nav-dock button {
      position: relative;
      overflow: hidden;
      min-height: 64px;
      padding: 8px 8px 10px;
      border-radius: 24px;
      border: 1px solid transparent;
      display: grid;
      justify-items: center;
      align-content: center;
      gap: 0;
      text-align: center;
      background: transparent;
      color: rgba(255,255,255,.72);
      box-shadow: none;
      transition: transform .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
    }
    .nav.nav-dock button::before {
      content:'';
      position:absolute;
      inset: 5px 6px;
      border-radius: 20px;
      background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
      border: 1px solid rgba(255,255,255,.04);
      opacity: .65;
      transition: opacity .22s ease, transform .24s ease, background .24s ease, box-shadow .24s ease;
    }
    .nav.nav-dock button::after {
      content:'';
      position:absolute;
      left: 50%;
      bottom: 8px;
      width: 34px;
      height: 4px;
      border-radius: 999px;
      transform: translateX(-50%) scaleX(.35);
      background: linear-gradient(90deg, rgba(125,211,252,0), rgba(125,211,252,.92), rgba(110,231,183,0));
      opacity: 0;
      transition: transform .24s ease, opacity .24s ease;
    }
    .nav.nav-dock button.active {
      border-color: rgba(125,211,252,.18);
      color: #fff;
      box-shadow: 0 16px 30px rgba(14,165,233,.12);
      transform: translateY(-3px);
    }
    .nav.nav-dock button.active::before {
      opacity: 1;
      transform: scale(1);
      background:
        radial-gradient(circle at top, rgba(125,211,252,.26), rgba(125,211,252,0) 60%),
        linear-gradient(180deg, rgba(125,211,252,.18), rgba(59,130,246,.12) 55%, rgba(255,255,255,.04));
      border-color: rgba(125,211,252,.22);
      box-shadow: 0 18px 30px rgba(14,165,233,.14), inset 0 1px 0 rgba(255,255,255,.08);
    }
    .nav.nav-dock button.active::after {
      opacity: 1;
      transform: translateX(-50%) scaleX(1);
    }
    .nav.nav-dock button:hover { transform: translateY(-1px); }
    .tab-icon {
      position: relative;
      z-index: 1;
      display: grid;
      place-items: center;
      width: 44px;
      height: 44px;
      border-radius: 18px;
      line-height: 1;
      font-weight: 900;
      transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
    }
    .tab-icon::before {
      content:'';
      position:absolute;
      inset:0;
      border-radius: inherit;
      background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
      opacity: .45;
      transition: opacity .22s ease, transform .22s ease, background .22s ease;
    }
    .tab-icon svg {
      position:relative;
      z-index:1;
      width: 24px;
      height: 24px;
      width: 100%;
      height: 100%;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
      transition: transform .22s ease, stroke .22s ease, filter .22s ease, fill .22s ease;
    }
    .nav.nav-dock button.active .tab-icon {
      transform: translateY(-2px) scale(1.04);
    }
    .nav.nav-dock button.active .tab-icon::before {
      opacity: 1;
      transform: scale(1);
      background: linear-gradient(180deg, rgba(125,211,252,.2), rgba(56,189,248,.08));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 22px rgba(14,165,233,.18);
    }
    .nav.nav-dock button.active .tab-icon svg {
      stroke: #f8fbff;
      filter: drop-shadow(0 6px 12px rgba(56,189,248,.34));
      transform: scale(1.02);
    }
    .tab-label {
      display: none;
    }
    .attendance-reward-strip {
      margin-top: 18px;
      display:grid;
      grid-template-columns: repeat(3, minmax(0,1fr));
      gap: 10px;
    }
    .attendance-reward-card {
      padding: 14px 16px;
      border-radius: 22px;
      background:
        radial-gradient(circle at top, rgba(125,211,252,.14), rgba(125,211,252,0) 52%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028));
      border:1px solid rgba(255,255,255,.08);
      box-shadow: 0 16px 32px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.05);
      display:grid;
      gap:6px;
      min-width:0;
    }
    .attendance-reward-label {
      font-size:12px;
      color: rgba(255,255,255,.58);
      font-weight:800;
    }
    .attendance-reward-value {
      font-size:22px;
      font-weight:900;
      color:#fff;
      line-height:1.1;
    }
    .attendance-reward-sub {
      font-size:12px;
      line-height:1.6;
      color: rgba(255,255,255,.66);
    }
    .attendance-punch-panel {
      margin-top: 18px;
      padding: 22px;
      border-radius: 28px;
      border: 1px solid rgba(255,255,255,.08);
      background:
        radial-gradient(circle at top, rgba(255,255,255,.08), rgba(255,255,255,0) 52%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 40px rgba(0,0,0,.16);
      display: grid;
      justify-items: center;
      gap: 16px;
      text-align: center;
    }
    .attendance-punch-visual {
      width: 136px;
      height: 136px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: linear-gradient(180deg, rgba(148,163,184,.22), rgba(51,65,85,.18));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 30px rgba(0,0,0,.16);
      transition: background .2s ease, transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    }
    .attendance-punch-visual.is-clocked-in {
      background: linear-gradient(180deg, rgba(34,197,94,.32), rgba(21,128,61,.22));
      border-color: rgba(134,239,172,.3);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 18px 36px rgba(34,197,94,.22);
    }
    .attendance-punch-visual.is-clocked-out {
      background: linear-gradient(180deg, rgba(239,68,68,.3), rgba(153,27,27,.22));
      border-color: rgba(252,165,165,.28);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 18px 36px rgba(239,68,68,.2);
    }
    .attendance-punch-icon {
      font-size: 54px;
      font-weight: 900;
      color: #f8fafc;
      line-height: 1;
    }
    .attendance-punch-copy {
      display: grid;
      gap: 8px;
      max-width: 420px;
    }
    .attendance-punch-label {
      font-size: 13px;
      font-weight: 900;
      letter-spacing: .06em;
      text-transform: uppercase;
      color: rgba(255,255,255,.52);
    }
    .attendance-punch-state {
      font-size: 30px;
      font-weight: 900;
      line-height: 1.12;
    }
    .attendance-punch-hint {
      font-size: 14px;
      line-height: 1.8;
    }
    .attendance-punch-actions {
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    .main {
      display: grid;
      gap: 20px;
      min-width: 0;
      padding-bottom: calc(var(--phone-nav-h) + var(--safe-bottom) + 18px);
    }
    .app-topbar {
      position: relative;
      top: auto;
      z-index: 60;
      display: grid;
      grid-template-columns: auto 1fr;
      align-items: center;
      gap: 14px;
      padding: 6px 4px 2px;
      min-width: 0;
    }
    .top-profile-btn,
    .top-settings-link {
      border: 1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
      box-shadow: 0 12px 24px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.05);
      color: #fff;
      cursor: pointer;
      backdrop-filter: blur(14px);
    }
    .top-profile-btn {
      width: 62px;
      height: 62px;
      border-radius: 24px;
      padding: 0;
      display: grid;
      place-items: center;
    }
    .top-profile-btn.is-active,
    .top-settings-link.is-active {
      border-color: rgba(125,211,252,.3);
      box-shadow: 0 14px 28px rgba(14,165,233,.18), inset 0 1px 0 rgba(255,255,255,.08);
    }
    .top-profile-avatar {
      width: 46px;
      height: 46px;
      border-radius: 18px;
      overflow: hidden;
      border: 1px solid rgba(255,255,255,.1);
      background: rgba(255,255,255,.05);
      display:grid;
      place-items:center;
    }
    .topbar-copy {
      display:grid;
      gap:4px;
      min-width: 0;
    }
    .topbar-title-row {
      display:flex;
      align-items:center;
      gap:10px;
      min-width:0;
      flex-wrap:wrap;
    }
    .topbar-name {
      font-size: 24px;
      font-weight: 900;
      line-height: 1.1;
      min-width: 0;
    }
    .topbar-shift {
      display:inline-flex;
      align-items:center;
      padding: 6px 12px;
      border-radius: 999px;
      background: rgba(255,255,255,.08);
      font-size: 12px;
      font-weight: 800;
    }
    .topbar-meta {
      display:flex;
      align-items:center;
      gap:10px;
      flex-wrap:wrap;
      color: rgba(255,255,255,.62);
      font-size: 13px;
    }
    .top-settings-link {
      display: none;
      min-width: 76px;
      height: 44px;
      border-radius: 18px;
      padding: 0 16px;
      font-size: 13px;
      font-weight: 900;
    }
    .utility-hidden { display:none !important; }
    .tab-panel { min-width: 0; }
    .header { padding: 20px; }
    .header-row, .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
    .badges { display: flex; gap: 10px; flex-wrap: wrap; }
    .badge { background: rgba(255,255,255,.1); padding: 10px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
    .grid-2 { display: grid; grid-template-columns: 1fr; gap: 24px; }
    .dashboard-main { display:grid; gap:20px; min-width:0; }
    .metrics.single-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); align-items: stretch; gap:16px; min-width:0; }
    .metric.compact .value { font-size: 26px; word-break: break-word; }
    .metric.compact { min-height: 138px; min-width: 0; }
    @media (max-width: 1280px) {
      .metrics.single-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    }
    .section { padding: 20px; }
        .metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .metric, .flow, .panel, .record, .calendar-cell { background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08); border-radius: 32px; }
    .metric { padding: 20px; }
    .metric .label { color: rgba(255,255,255,.55); font-size: 14px; }
    .metric .value { margin-top: 8px; font-size: 30px; font-weight: 900; }
    .flow-list, .list, .calendar-actions, .auth-stack { display: grid; gap: 12px; }
    .flow { padding: 16px; }
    .action-btn {
      height: 48px;
      border-radius: 22px;
      border: 1px solid rgba(255,255,255,.14);
      background: linear-gradient(135deg, #ffffff 0%, #f8fafc 42%, #fbcfe8 100%);
      color: #0f172a;
      box-shadow: 0 14px 30px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.75);
      letter-spacing: .01em;
    }
    .action-btn:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(0,0,0,.24); }
    .action-btn:active { transform: scale(.985); }
    
    .action-btn:disabled, .secondary-btn:disabled {
      opacity: .45;
      cursor: not-allowed;
      transform: none !important;
      box-shadow: none;
    }
    .action-btn.green {
      background: #22c55e;
      color: white;
      font-weight: 900;
    }
    
    .secondary-btn {
      height: 48px;
      border-radius: 22px;
      border: 1px solid rgba(255,255,255,.12);
      background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.05));
      color: white;
      box-shadow: 0 10px 24px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.05);
      backdrop-filter: blur(10px);
    }
    .secondary-btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.18); }
    .secondary-btn:active { transform: scale(.985); }
    .record-list { display: grid; gap: 12px; max-height: 520px; overflow: auto; margin-top: 16px; }
    .record-list, .dm-thread-messages, .dm-list, .dm-search-result-list, .dm-request-list {
      -webkit-overflow-scrolling: touch;
    }
    .pet-card {
      margin-top: 18px;
      padding: 16px;
      border-radius: 32px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.08), rgba(255,255,255,0) 48%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 16px 34px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
      display: grid;
      gap: 12px;
    }
    .pet-row { display:flex; align-items:center; gap:14px; }
    .pet-avatar {
      width: 88px;
      height: 88px;
      border-radius: 32px;
      background: rgba(255,255,255,.06);
      display: grid;
      place-items: center;
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
      overflow: hidden;
      flex: 0 0 auto;
      transition: transform .18s ease;
    }
    .pet-avatar.bounce { animation: petBounce .6s ease; }
    .pet-avatar.happy {
      box-shadow: 0 0 0 2px rgba(110,231,183,.7), 0 12px 26px rgba(0,0,0,.2);
    }
    .pet-avatar.lg { width: 140px; height: 140px; border-radius: 32px; }
    .pet-avatar.sm { width: 64px; height: 64px; border-radius: 22px; }
    .pet-img { width: 100%; height: 100%; object-fit: cover; }
    .pet-message {
      font-size: 14px;
      line-height: 1.7;
      color: rgba(255,255,255,.85);
    }
    .pet-name {
      font-weight: 900;
      font-size: 14px;
      letter-spacing: .02em;
      color: rgba(255,255,255,.8);
    }
    .pet-actions { display:flex; gap:10px; flex-wrap:wrap; }
    .pet-chip {
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 800;
      background: rgba(255,255,255,.08);
      color: rgba(255,255,255,.8);
    }
    .pet-cta { min-width: 140px; }
    .pet-picker {
      display:flex;
      gap:10px;
      overflow-x:auto;
      padding: 4px 2px;
      scroll-snap-type: x proximity;
      -webkit-overflow-scrolling: touch;
    }
    .pet-picker::-webkit-scrollbar { display:none; }
    .pet-option {
      width: 54px;
      height: 54px;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,.12);
      background: rgba(255,255,255,.06);
      padding: 0;
      display:grid;
      place-items:center;
      cursor:pointer;
      flex: 0 0 auto;
      transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
      scroll-snap-align: center;
    }
    .pet-option img { width:100%; height:100%; object-fit:cover; border-radius: 14px; }
    .pet-option.active {
      border-color: rgba(196,181,253,.7);
      box-shadow: 0 10px 24px rgba(0,0,0,.2);
      transform: translateY(-1px);
    }
    .pet-option:active { transform: scale(.96); }
    .pet-hint {
      font-size: 12px;
      color: rgba(255,255,255,.6);
      line-height: 1.6;
    }
    .pet-typing {
      display: inline-flex;
      gap: 6px;
      align-items: center;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,.08);
      border: 1px solid rgba(255,255,255,.08);
      width: fit-content;
    }
    .pet-typing span {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: rgba(255,255,255,.7);
      animation: petDot 1s ease infinite;
    }
    .pet-typing span:nth-child(2){ animation-delay: .15s; }
    .pet-typing span:nth-child(3){ animation-delay: .3s; }
    @keyframes petDot {
      0%, 100% { transform: translateY(0); opacity: .55; }
      50% { transform: translateY(-4px); opacity: 1; }
    }
    .pet-mini {
      display: flex;
      gap: 12px;
      align-items: center;
    }
    .pet-mini .pet-message { font-size: 13px; }
    
.dashboard-overview-card {
  overflow: hidden;
}
.dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 20px;
  align-items: stretch;
}
.dashboard-summary-panel,
.dashboard-avatar-panel,
.dashboard-insight-card {
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at top, rgba(255,255,255,.09), rgba(255,255,255,0) 52%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.024));
  box-shadow: 0 16px 38px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.04);
}
.dashboard-summary-panel,
.dashboard-avatar-panel {
  border-radius: 30px;
  padding: 22px;
}
.dashboard-summary-head {
  display: grid;
  gap: 8px;
}
.dashboard-summary-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.salary-donut-shell {
  display: grid;
  place-items: center;
  margin-top: 18px;
}
.salary-donut {
  --salary-mix: conic-gradient(#60a5fa 0deg 360deg);
  width: min(100%, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 18px;
  background:
    radial-gradient(circle at center, rgba(15,23,42,.18) 0 52%, transparent 53%),
    var(--salary-mix);
  box-shadow: 0 28px 60px rgba(0,0,0,.28), inset 0 0 30px rgba(255,255,255,.05);
  position: relative;
}
.salary-donut::after {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: rgba(10,15,28,.92);
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: inset 0 0 28px rgba(148,163,184,.08);
}
.salary-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  z-index: 1;
  padding: 54px;
}
.salary-donut-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
}
.salary-donut-value {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  line-height: 1;
}
.salary-donut-sub {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,.62);
}
.salary-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 18px;
}
.salary-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}
.salary-legend-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.salary-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.salary-legend-label {
  font-size: 13px;
  font-weight: 800;
}
.salary-legend-value {
  font-size: 12px;
  color: rgba(255,255,255,.68);
  white-space: nowrap;
}
.dashboard-side-stack {
  display: grid;
  gap: 18px;
}
.dashboard-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.dashboard-insight-card {
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 8px;
}
.dashboard-insight-card.accent {
  background:
    radial-gradient(circle at top, rgba(253,224,71,.14), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
}
.dashboard-insight-label {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,.62);
}
.dashboard-insight-value {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}
.dashboard-insight-sub {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,.62);
}
.dashboard-avatar-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dashboard-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  flex: 0 0 auto;
}
.dashboard-avatar-name {
  font-size: 24px;
  font-weight: 900;
}
.dashboard-avatar-sub {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.65);
}
.dashboard-template-grid {
  margin-top: 18px;
  grid-template-columns: repeat(5, minmax(0,1fr));
}
.dashboard-template-grid .pet-option {
  border-radius: 22px;
  min-height: 66px;
}
@media (max-width: 1100px) {
  .dashboard-overview-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .dashboard-summary-title {
    font-size: 26px;
  }
  .salary-legend,
  .dashboard-insight-grid,
  .dashboard-template-grid {
    grid-template-columns: 1fr 1fr;
  }
  .salary-donut {
    width: min(100%, 280px);
  }
  .dashboard-summary-panel,
  .dashboard-avatar-panel,
  .dashboard-leave-panel,
  .dashboard-home-summary-card {
    padding: 16px;
    border-radius: 24px;
  }
  .salary-donut-shell {
    margin-top: 12px;
  }
  .salary-legend {
    gap: 10px;
    margin-top: 14px;
  }
  .salary-legend-item {
    padding: 10px 12px;
    border-radius: 16px;
    align-items: flex-start;
  }
  .salary-legend-label {
    font-size: 12px;
  }
  .salary-legend-value {
    font-size: 11px;
  }
  .dashboard-insight-grid {
    gap: 10px;
  }
  .dashboard-insight-card {
    padding: 14px;
    border-radius: 20px;
  }
  .dashboard-insight-card.accent {
    grid-column: 1 / -1;
  }
  .dashboard-insight-value {
    font-size: 22px;
  }
  .dashboard-insight-sub,
  .dashboard-home-summary-sub {
    font-size: 12px;
    line-height: 1.55;
  }
  .dashboard-avatar-sub,
  .pet-hint {
    display: none;
  }
  .dashboard-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 20px;
  }
  .dashboard-avatar-name {
    font-size: 20px;
  }
  .dashboard-home-swipe-card {
    min-height: 136px;
    padding: 16px;
    border-radius: 20px;
  }
  .dashboard-home-swipe-value {
    font-size: 24px;
  }
  .dashboard-home-swipe-hint {
    font-size: 11px;
  }
  .dashboard-leave-panel {
    display: none !important;
  }
}
@media (max-width: 430px) {
  .salary-legend,
  .dashboard-insight-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-template-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-avatar-top {
    align-items: flex-start;
  }
  .salary-donut {
    width: min(100%, 250px);
  }
  .salary-donut-center {
    padding: 44px;
  }
  .salary-donut-value {
    font-size: 26px;
  }
  .dashboard-home-summary-card.is-breakdown,
  .dashboard-home-summary-card.is-leave,
  .dashboard-leave-panel,
  #dashboardSalaryMount .dashboard-breakdown-list {
    display: none !important;
  }
  .dashboard-home-summary-grid,
  .dashboard-home-summary-grid.is-tracker-only {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dashboard-home-summary-card.is-tracker {
    padding: 14px;
  }
  .dashboard-main {
    gap: 14px;
  }
  .dashboard-overview-card {
    padding-bottom: 14px;
  }
}

.pet-home-card {
      position: relative;
      overflow: hidden;
      min-height: 640px;
      padding: 26px;
      background:
        radial-gradient(circle at top left, rgba(251,191,36,.18), rgba(251,191,36,0) 28%),
        radial-gradient(circle at top right, rgba(168,85,247,.16), rgba(168,85,247,0) 24%),
        linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
    }
    .pet-home-card::before {
      content: "";
      position: absolute;
      inset: 18px;
      border-radius: 34px;
      border: 1px solid rgba(255,255,255,.05);
      background:
        linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)),
        radial-gradient(circle at 50% 0%, rgba(255,255,255,.06), transparent 56%);
      pointer-events: none;
    }
    .pet-home {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: minmax(320px, 1.05fr) minmax(300px, .95fr);
      gap: 30px;
      align-items: center;
      min-height: 560px;
    }
    .pet-home-scene {
      position: relative;
      min-height: 540px;
      border-radius: 34px;
      overflow: hidden;
      display: grid;
      place-items: center;
      background:
        radial-gradient(circle at 50% 16%, rgba(196,181,253,.2), rgba(196,181,253,0) 32%),
        radial-gradient(circle at 50% 100%, rgba(59,130,246,.18), rgba(59,130,246,0) 48%),
        linear-gradient(180deg, rgba(6,11,28,.88), rgba(16,23,42,.72));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 24px 60px rgba(0,0,0,.26);
      isolation: isolate;
    }
    .pet-home-scene::after {
      content: "";
      position: absolute;
      inset: auto 18px 18px;
      height: 110px;
      border-radius: 999px;
      background: radial-gradient(circle, rgba(59,130,246,.2), rgba(59,130,246,0) 72%);
      filter: blur(22px);
      opacity: .9;
      pointer-events: none;
    }
    .pet-scene-aurora,
    .pet-scene-grid,
    .pet-scene-orb,
    .pet-scene-floor,
    .pet-scene-runes {
      position: absolute;
      pointer-events: none;
    }
    .pet-scene-aurora {
      inset: -6% -12% auto;
      height: 62%;
      background:
        radial-gradient(circle at 30% 40%, rgba(45,212,191,.2), transparent 44%),
        radial-gradient(circle at 70% 35%, rgba(168,85,247,.24), transparent 38%),
        radial-gradient(circle at 52% 22%, rgba(251,191,36,.16), transparent 30%);
      mix-blend-mode: screen;
      filter: blur(16px);
      opacity: .92;
      animation: petAuroraFlow 12s ease-in-out infinite alternate;
    }
    .pet-scene-grid {
      inset: auto 0 0;
      height: 48%;
      background:
        linear-gradient(180deg, rgba(15,23,42,0) 0%, rgba(15,23,42,.25) 26%, rgba(15,23,42,.88) 100%),
        repeating-linear-gradient(90deg, rgba(96,165,250,.16) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(0deg, rgba(96,165,250,.12) 0 1px, transparent 1px 42px);
      transform: perspective(560px) rotateX(72deg) translateY(34%);
      transform-origin: center bottom;
      opacity: .48;
      mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.8) 35%, #000 100%);
    }
    .pet-scene-orb {
      width: 170px;
      height: 170px;
      border-radius: 999px;
      background: radial-gradient(circle, rgba(255,255,255,.22), rgba(255,255,255,0) 68%);
      filter: blur(6px);
      opacity: .72;
      mix-blend-mode: screen;
      animation: petOrbDrift 10s ease-in-out infinite;
    }
    .pet-scene-orb.orb-a { top: 18%; left: 10%; }
    .pet-scene-orb.orb-b {
      width: 120px;
      height: 120px;
      right: 12%;
      bottom: 26%;
      animation-duration: 13s;
      animation-delay: -3s;
    }
    .pet-scene-floor {
      left: 50%;
      bottom: 42px;
      width: min(78%, 420px);
      height: 110px;
      transform: translateX(-50%);
      border-radius: 50%;
      background:
        radial-gradient(circle, rgba(251,191,36,.2), rgba(251,191,36,.04) 46%, rgba(255,255,255,0) 70%),
        radial-gradient(circle, rgba(56,189,248,.18), rgba(56,189,248,0) 72%);
      filter: blur(2px);
      opacity: .9;
    }
    .pet-scene-runes {
      left: 50%;
      bottom: 78px;
      width: 340px;
      height: 340px;
      transform: translateX(-50%);
      border-radius: 50%;
      border: 1px solid rgba(125,211,252,.22);
      box-shadow: 0 0 0 20px rgba(125,211,252,.04), inset 0 0 30px rgba(168,85,247,.08);
      opacity: .55;
      animation: petRuneSpin 18s linear infinite;
    }
    .pet-scene-runes::before,
    .pet-scene-runes::after {
      content: "";
      position: absolute;
      inset: 22px;
      border-radius: 50%;
      border: 1px dashed rgba(255,255,255,.12);
    }
    .pet-scene-runes::after {
      inset: 54px;
      border-style: solid;
      border-color: rgba(251,191,36,.14);
      animation: petRuneSpinReverse 10s linear infinite;
    }
    .pet-scene-hud {
      position: absolute;
      top: 18px;
      left: 18px;
      right: 18px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      z-index: 2;
      pointer-events: none;
    }
    .pet-scene-chip-stack {
      display: grid;
      gap: 8px;
      max-width: 54%;
    }
    .pet-scene-chip {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      min-height: 34px;
      padding: 0 14px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
      box-shadow: 0 12px 24px rgba(0,0,0,.18);
      font-size: 11px;
      font-weight: 900;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: rgba(255,255,255,.88);
      backdrop-filter: blur(10px);
    }
    .pet-scene-chip.is-accent {
      background: linear-gradient(135deg, rgba(251,191,36,.18), rgba(168,85,247,.14));
      border-color: rgba(251,191,36,.22);
      color: #fef3c7;
    }
    #petHomeAvatarWrap {
      width: min(100%, 440px);
      aspect-ratio: 1 / 1;
      border-radius: 38px;
      animation: petFloat 6s ease-in-out infinite;
      position: relative;
      overflow: hidden;
      cursor: pointer;
      z-index: 1;
      background:
        radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), rgba(255,255,255,0) 46%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 24px 60px rgba(0,0,0,.24);
    }
    #petHomeAvatarWrap::before {
      content: "";
      position: absolute;
      inset: 16px;
      border-radius: 28px;
      border: 1px solid rgba(255,255,255,.05);
      background:
        radial-gradient(circle at 50% 18%, rgba(255,255,255,.08), transparent 40%),
        linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
      pointer-events: none;
      z-index: 0;
    }
    #petHomeAvatarWrap canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 1;
    }
    #petHomeAvatarWrap.pet-three-ready .pet-img { opacity: 0; }
    .pet-home-content {
      display: grid;
      gap: 14px;
      min-width: 0;
      align-content: center;
      justify-items: start;
      text-align: left;
    }
    .pet-home-kicker {
      font-size: 12px;
      letter-spacing: .18em;
      text-transform: uppercase;
      color: rgba(255,255,255,.58);
      font-weight: 900;
    }
    .pet-evolution {
      font-size: 12px;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: rgba(255,255,255,.6);
    }
    .pet-home-bubble {
      position: relative;
      padding: 16px 18px;
      border-radius: 24px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.1), rgba(255,255,255,0) 46%),
        linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 18px 34px rgba(0,0,0,.22);
      min-width: 260px;
    }
    .pet-home-bubble::before {
      content: "";
      position: absolute;
      left: -8px;
      top: 30px;
      width: 18px;
      height: 18px;
      background: rgba(255,255,255,.07);
      border-left: 1px solid rgba(255,255,255,.08);
      border-bottom: 1px solid rgba(255,255,255,.08);
      transform: rotate(45deg);
    }
    .pet-home-quote {
      margin: 0;
      font-size: 16px;
      line-height: 1.7;
      color: rgba(255,255,255,.9);
    }
    .pet-home-selector {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
      gap: 10px;
      width: 100%;
      max-width: 520px;
      padding: 4px 0 2px;
    }
    .pet-home-selector::-webkit-scrollbar { display:none; }
    .pet-home-selector .pet-option {
      width: 100%;
      aspect-ratio: 1 / 1;
      min-width: 0;
      height: auto;
      border-radius: 20px;
      scroll-snap-align: center;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.12), rgba(255,255,255,0) 48%),
        linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
    }
    .pet-home-selector .pet-option img { border-radius: 18px; }
    .pet-avatar.stage-baby { box-shadow: 0 0 0 2px rgba(148,163,184,.45), 0 12px 28px rgba(0,0,0,.2); }
    .pet-avatar.stage-youth { box-shadow: 0 0 0 2px rgba(56,189,248,.55), 0 16px 34px rgba(0,0,0,.22); }
    .pet-avatar.stage-adult { box-shadow: 0 0 0 2px rgba(59,130,246,.6), 0 18px 38px rgba(0,0,0,.24); }
    .pet-avatar.stage-final { box-shadow: 0 0 0 2px rgba(168,85,247,.7), 0 20px 44px rgba(0,0,0,.28); }
    .pet-avatar.cute-3 { filter: saturate(1.15); }
    .pet-avatar.cute-4 { filter: saturate(1.25) brightness(1.05); }
    .pet-avatar.cute-5 { filter: saturate(1.35) brightness(1.1); }
    .pet-avatar.blink .pet-img { animation: petBlink .6s ease; }
    .pet-avatar.cuddle .pet-img { animation: petCuddle .8s ease; }
    .pet-avatar.dance .pet-img { animation: petDance 1.1s ease; }
    .pet-avatar.greet .pet-img { animation: petWave 1.1s ease; }
    @keyframes petBlink {
      0%, 100% { transform: scale(1); }
      40% { transform: scale(0.96); }
      60% { transform: scale(1.02); }
    }
    @keyframes petCuddle {
      0%, 100% { transform: scale(1); }
      30% { transform: scale(1.08); }
      60% { transform: scale(0.98); }
    }
    @keyframes petDance {
      0% { transform: translateY(0) rotate(0); }
      25% { transform: translateY(-6px) rotate(-3deg); }
      50% { transform: translateY(0) rotate(3deg); }
      75% { transform: translateY(-4px) rotate(-2deg); }
      100% { transform: translateY(0) rotate(0); }
    }
    @keyframes petWave {
      0%, 100% { transform: translateY(0) rotate(0); }
      20% { transform: translateY(-4px) rotate(-4deg); }
      40% { transform: translateY(-6px) rotate(6deg); }
      60% { transform: translateY(-4px) rotate(-5deg); }
      80% { transform: translateY(-2px) rotate(4deg); }
    }
    @keyframes petFloat {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }
    @keyframes petAuroraFlow {
      0% { transform: translate3d(-2%, 0, 0) scale(1); opacity: .82; }
      50% { transform: translate3d(2%, 2%, 0) scale(1.04); opacity: 1; }
      100% { transform: translate3d(-1%, 3%, 0) scale(1.08); opacity: .9; }
    }
    @keyframes petOrbDrift {
      0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
      50% { transform: translate3d(10px, -14px, 0) scale(1.08); }
    }
    @keyframes petRuneSpin {
      0% { transform: translateX(-50%) rotate(0deg); }
      100% { transform: translateX(-50%) rotate(360deg); }
    }
    @keyframes petRuneSpinReverse {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(-360deg); }
    }
    .pet-avatar.stage-baby { box-shadow: 0 0 0 2px rgba(148,163,184,.45), 0 12px 28px rgba(0,0,0,.2); }
    .pet-avatar.stage-youth { box-shadow: 0 0 0 2px rgba(56,189,248,.55), 0 16px 34px rgba(0,0,0,.22); }
    .pet-avatar.stage-adult { box-shadow: 0 0 0 2px rgba(59,130,246,.6), 0 18px 38px rgba(0,0,0,.24); }
    .pet-avatar.stage-final { box-shadow: 0 0 0 2px rgba(168,85,247,.7), 0 20px 44px rgba(0,0,0,.28); }
    .pet-avatar.cute-3 { filter: saturate(1.15); }
    .pet-avatar.cute-4 { filter: saturate(1.25) brightness(1.05); }
    .pet-avatar.cute-5 { filter: saturate(1.35) brightness(1.1); }
    .pet-avatar.blink .pet-img { animation: petBlink .6s ease; }
    .pet-avatar.cuddle .pet-img { animation: petCuddle .8s ease; }
    .pet-avatar.dance .pet-img { animation: petDance 1.1s ease; }
    @keyframes petBlink {
      0%, 100% { transform: scale(1); }
      40% { transform: scale(0.96); }
      60% { transform: scale(1.02); }
    }
    @keyframes petCuddle {
      0%, 100% { transform: scale(1); }
      30% { transform: scale(1.08); }
      60% { transform: scale(0.98); }
    }
    @keyframes petDance {
      0% { transform: translateY(0) rotate(0); }
      25% { transform: translateY(-6px) rotate(-3deg); }
      50% { transform: translateY(0) rotate(3deg); }
      75% { transform: translateY(-4px) rotate(-2deg); }
      100% { transform: translateY(0) rotate(0); }
    }
    @keyframes petFloat {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }
    .pet-chat-card { overflow: hidden; display: grid; gap: 10px; }
    .pet-chat-card.pet-chat-collapsed .pet-chat-body,
    .pet-chat-card.pet-chat-collapsed .pet-chat-footer { display: none; }
    .pet-chat-toggle { height: 36px; padding: 0 14px; border-radius: 999px; font-size: 12px; }
    .pet-chat-title { display: grid; gap: 4px; }
    .pet-chat-preview {
      font-size: 12px;
      color: rgba(255,255,255,.62);
      max-width: 320px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .pet-chat-unread {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: #f87171;
      box-shadow: 0 0 0 3px rgba(248,113,113,.2);
    }
    .pet-chat-body {
      margin-top: 6px;
      padding: 10px;
      border-radius: 22px;
      background: rgba(0,0,0,.22);
      border: 1px solid rgba(255,255,255,.08);
      max-height: 280px;
      overflow-y: auto;
      display: grid;
      gap: 8px;
    }
    .pet-chat-bubble {
      max-width: 80%;
      padding: 10px 14px;
      border-radius: 16px;
      font-size: 13px;
      line-height: 1.5;
      border: 1px solid rgba(255,255,255,.08);
      position: relative;
      display: grid;
      gap: 6px;
    }
    .pet-chat-text { word-break: break-word; }
    .pet-chat-meta {
      font-size: 10px;
      color: rgba(255,255,255,.55);
      display: flex;
      gap: 6px;
      align-items: center;
    }
    .pet-chat-meta .read { color: #c4b5fd; font-weight: 700; }
    .pet-chat-bubble.user {
      justify-self: end;
      background: linear-gradient(135deg, rgba(168,85,247,.24), rgba(59,130,246,.2));
    }
    .pet-chat-bubble.pet {
      justify-self: start;
      background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    }
    .pet-chat-actions {
      position: absolute;
      top: -12px;
      right: 8px;
      background: rgba(15,23,42,.92);
      border: 1px solid rgba(255,255,255,.12);
      border-radius: 999px;
      padding: 2px 8px;
      font-size: 11px;
      color: #fff;
      display: none;
      cursor: pointer;
    }
    .pet-chat-bubble.user.show-actions .pet-chat-actions { display: inline-flex; }
    .pet-chat-bubble.typing {
      display: inline-flex;
      gap: 6px;
      align-items: center;
    }
    .pet-chat-bubble.typing span {
      width: 6px;
      height: 6px;
      border-radius: 999px;
      background: rgba(255,255,255,.6);
      animation: petDot 1.1s infinite;
    }
    .pet-chat-footer {
      margin-top: 6px;
      display: grid;
      gap: 8px;
    }
    .pet-chat-input-row {
      display: grid;
      grid-template-columns: 1fr 92px;
      gap: 8px;
      align-items: center;
    }
    .pet-chat-input-row input {
      height: 44px;
      border-radius: 999px;
      padding: 0 16px;
      background: rgba(255,255,255,.05);
      border: 1px solid rgba(255,255,255,.08);
      color: #fff;
    }
    .pet-chat-quick {
      display: grid;
      grid-template-columns: repeat(3, minmax(0,1fr));
      gap: 8px;
    }
    .user-avatar {
      width: 56px;
      height: 56px;
      border-radius: 22px;
      margin-top: 10px;
      border: 1px solid rgba(255,255,255,.1);
      background: rgba(255,255,255,.06);
      overflow: hidden;
      box-shadow: 0 10px 24px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.06);
    }
    .user-avatar img { width:100%; height:100%; object-fit:cover; }
    .pet-select-overlay {
      position: fixed;
      inset: 0;
      z-index: 140;
      background: rgba(2,6,23,.75);
      backdrop-filter: blur(10px);
      display: grid;
      place-items: center;
      padding: 16px;
    }
    .pet-select-card {
      width: min(720px, 100%);
      border-radius: 32px;
      padding: 18px;
      background: rgba(15,23,42,.96);
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 24px 70px rgba(0,0,0,.45);
      display: grid;
      gap: 16px;
    }
    .pet-select-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
    .pet-select-title { font-size: 20px; font-weight: 900; }
    .pet-select-carousel { display:grid; grid-template-columns: 56px 1fr 56px; align-items:center; gap:12px; }
    .pet-select-display { display:grid; justify-items:center; gap:10px; text-align:center; }
    .pet-arrow {
      width: 48px;
      height: 48px;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,.1);
      background: rgba(255,255,255,.06);
      color: white;
      font-size: 18px;
      cursor: pointer;
    }
    .pet-select-actions { display:grid; }
    .pet-select-overlay.hidden { display:none !important; }
    @keyframes petBounce {
      0% { transform: scale(1); }
      40% { transform: scale(1.08); }
      100% { transform: scale(1); }
    }
    .record-list { display: grid; gap: 12px; max-height: 520px; overflow: auto; margin-top: 16px; }
    .dm-shell {
      display:grid;
      grid-template-columns: 280px 1fr;
      gap:16px;
      align-items:start;
      min-height: 0;
      height: auto;
    }
    .dm-shell.has-thread {
      min-height: 560px;
      height: min(72vh, 760px);
    }
    .dm-shell.chat-focus {
      grid-template-columns: 1fr;
    }
    .dm-shell.chat-focus .dm-sidebar-card {
      display:none;
    }
    .dm-sidebar-card, .dm-thread-card {
      border-radius: 26px;
      border: 1px solid rgba(255,255,255,.08);
    }
    .dm-sidebar-card {
      padding: 16px;
      display:grid;
      grid-template-rows: auto auto 1fr;
      gap: 12px;
    }
    .dm-thread-card {
      padding: 18px;
      display:flex;
      flex-direction: column;
      min-width:0;
      overflow:hidden;
      height: auto;
    }
    .dm-thread-card.compact {
      padding: 14px;
      height: auto;
      align-self: start;
    }
    .dm-list, .dm-thread-messages {
      display:grid;
      gap:10px;
      overflow:auto;
      min-height:0;
    }
    .dm-thread-messages {
      align-content:start;
      padding-right:4px;
      padding-bottom:60px;
      scroll-behavior:smooth;
    }
    .dm-search-mini {
      display:grid;
      grid-template-columns: 1fr;
      gap:8px;
      padding: 8px 0 4px;
    }
    .dm-search-actions { display:grid; gap:8px; }
    .dm-search-result-list { display:grid; gap:8px; margin-top:10px; }
    .dm-request-list { display:grid; gap:8px; margin-top:12px; }
    .dm-mini-card {
      padding:12px;
      border-radius:18px;
      background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
      border:1px solid rgba(255,255,255,.06);
      display:grid;
      gap:8px;
    }
    .dm-mini-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    .dm-mini-name { font-weight:900; font-size:14px; }
    .dm-mini-sub { font-size:12px; color: rgba(255,255,255,.62); }
    .dm-mini-actions { display:flex; gap:8px; flex-wrap:wrap; }
    .dm-mini-btn {
      height:36px;
      padding:0 14px;
      border-radius:999px;
      border:1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
      color:#fff;
      cursor:pointer;
      font-weight:800;
    }
    .dm-mini-btn.primary {
      background: linear-gradient(135deg, #ffffff 0%, #f8fafc 42%, #fbcfe8 100%);
      color:#0f172a;
      border-color: rgba(255,255,255,.14);
    }
    .dm-mini-btn:disabled { opacity:.45; cursor:not-allowed; }
    .dm-search-mini input {
      height: 40px;
      border-radius: 999px;
      padding: 0 14px;
      background: rgba(255,255,255,.05);
      border: 1px solid rgba(255,255,255,.06);
      box-shadow: none;
    }
    .dm-search-mini input:focus {
      outline:none;
      border-color: rgba(255,255,255,.12);
      background: rgba(255,255,255,.065);
    }
    .dm-item {
      display:flex;
      align-items:center;
      gap:12px;
      padding:12px;
      border-radius:22px;
      cursor:pointer;
      background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02));
      border:1px solid rgba(255,255,255,.05);
      transition: .18s ease;
      min-width:0;
    }
    .dm-item:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.1); }
    .dm-item.active {
      background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
      border-color: rgba(255,255,255,.12);
      box-shadow: 0 10px 24px rgba(0,0,0,.12);
    }
    .dm-avatar-wrap { position:relative; flex:0 0 auto; }
    .dm-avatar {
      width:44px; height:44px; border-radius:50%;
      display:grid; place-items:center;
      background: linear-gradient(135deg, rgba(244,114,182,.35), rgba(96,165,250,.35));
      font-weight:900;
    }
    .dm-meta { min-width:0; flex:1 1 auto; }
    .dm-name-row {
      display:flex; align-items:center; justify-content:space-between; gap:8px;
    }
    .dm-name { font-weight:900; font-size:14px; }
    .dm-time { font-size:11px; color: rgba(255,255,255,.42); }
    .dm-snippet {
      margin-top:4px; font-size:12px; color: rgba(255,255,255,.62);
      overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    }
    .dm-empty {
      min-height: 240px; display:grid; place-items:center; text-align:center; padding:24px; border-radius:24px;
      background: rgba(255,255,255,.03); border:1px dashed rgba(255,255,255,.12); color:rgba(255,255,255,.7);
    }
    .dm-thread-card.compact {
      min-height: 180px;
      padding: 20px 16px;
    }
    .dm-thread-panel {
      display:grid;
      grid-template-rows: auto auto minmax(0, 1fr) auto;
      min-height: 0;
      height: 100%;
      gap: 12px;
      min-width:0;
    }
    .dm-thread-top {
      display:flex; align-items:center; gap:12px; padding-bottom:12px; border-bottom:1px solid rgba(255,255,255,.06);
    }
    .dm-back-btn {
      width:42px; height:42px; border-radius:14px; border:1px solid rgba(255,255,255,.08);
      background: rgba(255,255,255,.05); color:#fff; cursor:pointer; display:grid; place-items:center; flex:0 0 auto;
    }
    .dm-back-btn:hover { background: rgba(255,255,255,.08); }
    .dm-thread-user { display:flex; align-items:center; gap:12px; min-width:0; }
    .dm-badge {
      display:inline-flex; align-items:center; gap:8px; width:fit-content;
      padding:8px 12px; border-radius:999px; background: rgba(255,255,255,.06); font-size:12px; color: rgba(255,255,255,.72);
    }
    .dm-bubble-wrap { display:grid; width:100%; }
    .dm-bubble-wrap.me { justify-items:end; }
    .dm-bubble-wrap.them { justify-items:start; }
    .dm-message-stack { display:grid; gap:4px; max-width:min(70%, 360px); }
    .dm-bubble {
      width:100%; padding:10px 14px; border-radius:24px; line-height:1.42; font-size:13px;
      border:1px solid rgba(255,255,255,.05); box-shadow:0 8px 18px rgba(0,0,0,.08); word-break:break-word;
      position: relative;
    }
    .dm-bubble.them {
      background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.028));
      border-top-left-radius:12px; border-bottom-left-radius:22px;
    }
    .dm-bubble.me {
      background: linear-gradient(135deg, rgba(168,85,247,.24), rgba(59,130,246,.2));
      border-top-right-radius:12px; border-bottom-right-radius:22px;
    }
    .dm-message-meta {
      display:flex; align-items:center; gap:6px; padding:0 4px; font-size:9px; line-height:1; color:rgba(255,255,255,.34);
    }
    .dm-message-meta .reply-time { opacity:.82; }
    .dm-message-meta .status-pill {
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-height:18px;
      padding:0 8px;
      border-radius:999px;
      border:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.04);
      letter-spacing:.02em;
    }
    .dm-bubble-tools {
      position: absolute;
      top: -14px;
      display: none;
      align-items: center;
      gap: 6px;
      padding: 4px 6px;
      border-radius: 999px;
      background: rgba(15,23,42,.92);
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 12px 28px rgba(0,0,0,.24);
      z-index: 3;
    }
    .dm-bubble-tools.them { left: 8px; }
    .dm-bubble-tools.me { right: 8px; }
    .dm-bubble:hover .dm-bubble-tools,
    .dm-bubble:focus-within .dm-bubble-tools,
    .dm-bubble.menu-target .dm-bubble-tools {
      display: inline-flex;
    }
    .dm-tool-btn {
      width: 28px;
      height: 28px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
      transition: transform .14s ease, border-color .14s ease, background .14s ease;
    }
    .dm-tool-btn:hover {
      transform: translateY(-1px);
      border-color: rgba(255,255,255,.16);
    }
    .dm-tool-btn.danger {
      background: linear-gradient(180deg, rgba(239,68,68,.22), rgba(239,68,68,.1));
      border-color: rgba(248,113,113,.18);
    }
    .dm-bubble-wrap.me .dm-message-meta { justify-content:flex-end; }
    .dm-bubble-wrap.them .dm-message-meta { justify-content:flex-start; }
    .dm-message-meta .is-read { color:#ddd6fe; font-weight:800; background:rgba(196,181,253,.12); border-color:rgba(196,181,253,.2); }
    .dm-message-meta .is-unread { color:#7dd3fc; font-weight:900; background:rgba(56,189,248,.12); border-color:rgba(56,189,248,.22); box-shadow:0 0 18px rgba(56,189,248,.16); text-shadow:0 0 14px rgba(56,189,248,.45); }
    .dm-reply-preview {
      margin-bottom:6px; padding:7px 9px; border-radius:14px; background: rgba(255,255,255,.06);
      border:1px solid rgba(255,255,255,.06); font-size:11px; line-height:1.42; color: rgba(255,255,255,.82);
    }
    .dm-reply-line { display:block; font-weight:800; color:#c4b5fd; margin-bottom:2px; }
    .dm-reply-snippet, .dm-reply-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .dm-compose {
      display:grid; gap:8px; position:sticky; bottom:0; z-index:3; padding-top:10px;
      background: linear-gradient(180deg, rgba(15,23,42,0) 0%, rgba(15,23,42,.86) 30%, rgba(15,23,42,.98) 100%);
      backdrop-filter: blur(14px);
    }
    .dm-reply-bar {
      display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 12px;
      border-radius:18px; background: rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.05);
    }
    .dm-reply-bar.hidden { display:none !important; }
    .dm-reply-text { min-width:0; font-size:12px; line-height:1.55; color: rgba(255,255,255,.82); }
    .dm-reply-close {
      width:34px; height:34px; border-radius:12px; border:1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04)); color:#fff; cursor:pointer; flex:0 0 auto;
    }
    .dm-compose-row {
      display:grid; grid-template-columns: 1fr 88px; gap:8px; align-items:center; padding:6px;
      border-radius:999px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
      border:1px solid rgba(255,255,255,.05);
    }
    .dm-compose-row input {
      height:42px;
      border-radius:999px;
      padding:0 16px;
      line-height:normal;
      font-size:14px;
      letter-spacing:.01em;
      background:transparent;
      border:0;
      box-shadow:none;
      outline:none;
      color:#fff;
      display:block;
    }
    .dm-compose-row input::placeholder {
      color: rgba(255,255,255,.38);
      line-height: normal;
    }
    .dm-compose-row:focus-within {
      border-color: rgba(255,255,255,.1); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.024));
      box-shadow: 0 8px 24px rgba(0,0,0,.12);
    }
    #sendFriendChatBtn { min-width:88px; height:42px; border-radius:999px; border:0; box-shadow:0 10px 24px rgba(0,0,0,.14); }
    .dm-compose {
      margin-top: auto;
      display:grid;
      gap:8px;
      position: sticky;
      bottom: 0;
      z-index: 3;
      padding: 14px 4px 10px;
      background: linear-gradient(180deg, rgba(15,23,42,0) 0%, rgba(15,23,42,.72) 18%, rgba(15,23,42,.92) 52%, rgba(15,23,42,.98) 100%);
      backdrop-filter: blur(14px);
    }
    .dm-compose-row {
      display:grid;
      grid-template-columns: 1fr 96px;
      gap:8px;
      align-items:center;
      padding: 6px;
      border-radius: 999px;
      background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
      border: 1px solid rgba(255,255,255,.05);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
    }
    .dm-compose-row input {
      margin: 0;
      height: 42px;
      min-height: 42px;
      border-radius: 999px;
      padding: 0 16px;
      line-height: 1.22;
      font-size: 14px;
      letter-spacing: .01em;
      background: transparent;
      border: 0;
      box-shadow: none;
      outline: none;
    }
    .dm-compose-row input::placeholder {
      color: rgba(255,255,255,.38);
      line-height: 1.22;
    }
    .dm-compose-row input:focus {
      border: 0;
      box-shadow: none;
      outline: none;
    }
    .dm-compose-row:focus-within {
      border-color: rgba(255,255,255,.1);
      background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.024));
      box-shadow: 0 8px 24px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.04);
    }
    #sendFriendChatBtn {
      white-space: nowrap;
      border-radius: 999px;
      min-width: 96px;
      height: 42px;
      border: 0;
      box-shadow: 0 10px 24px rgba(0,0,0,.14);
    }
    .dm-quick-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .dm-quick-btn {
      height: 34px;
      padding: 0 14px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
      color: #fff;
      font-weight: 800;
      font-size: 12px;
      cursor: pointer;
    }
      .pet-home { grid-template-columns: 1fr; gap: 22px; }
      .pet-home-card { min-height: 0; padding: 18px; }
      .pet-home-scene { min-height: 420px; }
      #petHomeAvatarWrap { width: min(100%, 320px); }
      .pet-home-content { justify-items: center; text-align: center; }
      .pet-home-selector { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 100%; }
      .pet-home-bubble::before { left: calc(50% - 8px); top: -8px; transform: rotate(135deg); }
      .pet-scene-hud { flex-direction: column; align-items: stretch; }
      .pet-scene-chip-stack { max-width: none; }
      .metric .value { font-size: 24px; }
      .metric.compact { min-height: 0; }
      .header-row { flex-direction: column; align-items: flex-start; }
      .badges { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .badge { text-align: center; }
      .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
      .weekday, .calendar-cell { min-height: 84px; padding: 10px; border-radius: 16px; }
      .calendar-risk-head,
      .calendar-ratio-head { flex-direction: column; align-items:flex-start; }
      .calendar-risk-banner,
      .calendar-analytics-card { padding: 14px; border-radius: 20px; }
      .calendar-risk-detail-grid { grid-template-columns: 1fr; }
      .calendar-trend-focus { grid-template-columns: 1fr; }
      .calendar-trend-delta { justify-self: flex-start; }
      .attendance-reward-strip { grid-template-columns: 1fr; }
      .calendar-head { align-items: stretch; }
      .calendar-head .inline { width: 100%; justify-content: space-between; }
      .record-list { max-height: none; }
      .auth-overlay { padding: 12px; align-items: flex-start; overflow: auto; }
      .auth-shell { gap: 14px; }
      .auth-card { padding: 18px; border-radius: 26px; }
      .auth-title { font-size: 28px; }
      .auth-grid.tight { grid-template-columns: 1fr; }
      .pets { grid-template-columns: 1fr 1fr; }
      .calendar-modal {
        width: 100%;
        padding: 18px;
        border-radius: 26px;
        margin-bottom: calc(var(--phone-nav-h) + var(--safe-bottom) + 8px);
      }
      .calendar-modal-section { padding: 14px; border-radius: 22px; }
      input, select, textarea, .action-btn, .secondary-btn { height: 50px; font-size: 16px; }
      .action-btn, .secondary-btn { min-height: 50px; }
    }
    @media (max-width: 430px) and (pointer: coarse) {
      .app { padding-left: 10px; padding-right: 10px; }
      .nav { grid-template-columns: repeat(6, minmax(72px, 1fr)); }
      .badge { width: 100%; text-align: center; }
      .calendar-grid { grid-template-columns: 1fr; }
      #userName { font-size: 20px !important; }
      #screenTitle { font-size: 24px !important; }
      #dashboardMetricsGrid { grid-template-columns: 1fr; }
      .metric.compact .value { font-size: 22px; }
      .section { padding: 16px; }
      .pet-home { justify-content: center; }
      .pet-home-bubble { width: 100%; min-width: 0; }
      .pet-home-scene { min-height: 360px; }
      #petHomeAvatarWrap { width: min(100%, 250px); border-radius: 28px; }
      .pet-home-selector { max-width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .pet-home-selector .pet-option { border-radius: 16px; }
      .pet-home-selector .pet-option img { border-radius: 14px; }
      .pet-home-bubble::before {
        left: calc(50% - 8px);
        top: -8px;
        transform: rotate(135deg);
      }
      .pet-chat-input-row { grid-template-columns: 1fr; }
      .pet-chat-quick { grid-template-columns: 1fr; }
    }
      
        .hidden { display:none !important; }

    /* Layout & rounding overrides */
    :root {
      --radius-card: 32px;
      --radius-panel: 28px;
      --radius-item: 22px;
      --radius-bubble: 24px;
    }
    .card { border-radius: var(--radius-card); }
    .panel, .record, .metric, .calendar-cell, .dm-sidebar-card, .dm-thread-card { border-radius: var(--radius-panel); }
    .dm-item, .dm-mini-card { border-radius: var(--radius-item); }
    .dm-bubble { border-radius: var(--radius-bubble); }

    /* Form polish */
    .field,
    .memo-field {
      display: grid;
      gap: 10px;
      margin-top: 16px;
    }
    .field.compact { margin-top: 12px; }
    .field label,
    .memo-field label,
    .calendar-modal-section label {
      font-size: 13px;
      font-weight: 900;
      color: rgba(255,255,255,.8);
      letter-spacing: .015em;
      padding-left: 4px;
    }
    input:not([type='hidden']):not([type='file']):not(#friendInput):not(#friendChatInput):not(#petChatInput),
    select,
    textarea {
      width: 100%;
      min-height: 56px;
      border-radius: 24px;
      border: 1px solid rgba(255,255,255,.10);
      background:
        radial-gradient(circle at top, rgba(255,255,255,.12), rgba(255,255,255,0) 46%),
        linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
      color: #f8fafc;
      padding: 0 18px;
      outline: none;
      box-shadow: 0 18px 36px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.08);
      transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
      appearance: none;
      -webkit-appearance: none;
      backdrop-filter: blur(14px) saturate(120%);
    }
    input:not([type='hidden']):not([type='file']):not(#friendInput):not(#friendChatInput):not(#petChatInput)::placeholder,
    textarea::placeholder {
      color: rgba(255,255,255,.46);
    }
    input:not([type='hidden']):not([type='file']):not(#friendInput):not(#friendChatInput):not(#petChatInput):hover,
    select:hover,
    textarea:hover {
      border-color: rgba(255,255,255,.18);
      transform: translateY(-1px);
      background:
        radial-gradient(circle at top, rgba(255,255,255,.15), rgba(255,255,255,0) 46%),
        linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
    }
    input:not([type='hidden']):not([type='file']):not(#friendInput):not(#friendChatInput):not(#petChatInput):focus,
    select:focus,
    textarea:focus {
      border-color: rgba(251,191,36,.38);
      box-shadow: 0 0 0 4px rgba(251,191,36,.10), 0 20px 40px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.12);
      transform: translateY(-1px);
    }
    select {
      padding-right: 52px;
      background-image:
        radial-gradient(circle at top, rgba(255,255,255,.12), rgba(255,255,255,0) 46%),
        linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.045)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.78)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
      background-repeat: no-repeat, no-repeat, no-repeat;
      background-position: 0 0, 0 0, right 18px center;
      background-size: auto, auto, 18px;
      cursor: pointer;
      font-weight: 800;
    }
    select option {
      color: #e5e7eb;
      background: #111827;
    }
    textarea {
      min-height: 126px;
      padding: 16px 18px;
      resize: vertical;
      line-height: 1.68;
    }
    input[type='number']::-webkit-outer-spin-button,
    input[type='number']::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    input[type='number'] {
      -moz-appearance: textfield;
    }
    .calendar-modal input[type='hidden'] {
      display: none;
    }
    body.modal-open {
      overflow: hidden;
    }
    .calendar-modal-backdrop {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(2,6,23,.72);
      backdrop-filter: blur(8px);
      z-index: 140;
    }
    .calendar-modal {
      width: min(760px, calc(100vw - 32px));
      max-height: min(88vh, 960px);
      overflow: auto;
      padding: 24px;
      border-radius: 30px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.09), rgba(255,255,255,0) 42%),
        linear-gradient(180deg, rgba(15,23,42,.98), rgba(15,23,42,.95));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 28px 70px rgba(0,0,0,.46);
      transform: translateY(10px) scale(.985);
      opacity: 0;
      animation: modalIn .18s ease forwards;
    }
    @keyframes modalIn {
      to {
        transform: translateY(0) scale(1);
        opacity: 1;
      }
    }
    .calendar-modal-body {
      display: grid;
      gap: 16px;
      margin-top: 16px;
    }
    .calendar-modal-section {
      padding: 18px;
      border-radius: 24px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.07), rgba(255,255,255,0) 48%),
        linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.024));
      border: 1px solid rgba(255,255,255,.08);
    }
    .calendar-modal-section-title {
      margin-bottom: 12px;
      font-size: 14px;
      font-weight: 900;
      color: rgba(255,255,255,.92);
      letter-spacing: .01em;
    }
    .calendar-modal-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }
    .calendar-modal-grid.single {
      grid-template-columns: 1fr;
    }
    .calendar-modal-note {
      margin-top: 12px;
      color: rgba(255,255,255,.72);
      font-size: 13px;
      line-height: 1.75;
    }
    .calendar-modal-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 18px;
    }
    .calendar-modal-actions .action-btn,
    .calendar-modal-actions .secondary-btn {
      width: 100%;
    }
    .calendar-modal-legal {
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 18px;
      background: rgba(127,29,29,.18);
      border: 1px solid rgba(252,165,165,.22);
      color: #fee2e2;
      font-size: 12px;
      line-height: 1.7;
    }

    /* Calendar modal custom controls */
    .calendar-inline-editor {
      display: grid;
      grid-template-columns: 92px minmax(0, 1fr) 92px;
      gap: 10px;
      align-items: center;
    }
    .calendar-step-btn,
    .calendar-chip-btn {
      border: 1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
      color: #fff;
      border-radius: 999px;
      min-height: 42px;
      padding: 0 14px;
      font-weight: 800;
      cursor: pointer;
      transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
    }
    .calendar-step-btn:hover,
    .calendar-chip-btn:hover {
      transform: translateY(-1px);
      border-color: rgba(255,255,255,.16);
    }
    .calendar-chip-btn.active {
      color: #0f172a;
      background: linear-gradient(135deg, #fff8db, #fef3c7 44%, #fed7aa);
      border-color: rgba(255,255,255,.42);
      box-shadow: 0 10px 24px rgba(0,0,0,.18);
    }
    .calendar-date-card,
    .calendar-time-card {
      border-radius: 24px;
      border: 1px solid rgba(255,255,255,.08);
      background:
        radial-gradient(circle at top, rgba(255,255,255,.08), rgba(255,255,255,0) 52%),
        linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
      box-shadow: 0 18px 34px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
    }
    .calendar-date-card {
      min-height: 74px;
      display: grid;
      align-content: center;
      justify-items: center;
      text-align: center;
      padding: 10px 12px;
    }
    .calendar-date-card.is-holiday {
      border-color: rgba(251,113,133,.22);
      background:
        radial-gradient(circle at top, rgba(251,113,133,.16), rgba(255,255,255,0) 52%),
        linear-gradient(180deg, rgba(127,29,29,.34), rgba(76,5,25,.22));
    }
    .calendar-date-display {
      font-size: 24px;
      font-weight: 900;
      letter-spacing: .03em;
    }
    .calendar-date-meta {
      margin-top: 4px;
      font-size: 12px;
      color: rgba(255,255,255,.66);
    }
    .calendar-time-card {
      padding: 14px;
      display: grid;
      gap: 12px;
    }
    .calendar-time-top {
      display: grid;
      gap: 4px;
    }
    .calendar-time-value {
      font-size: 30px;
      font-weight: 900;
      letter-spacing: .04em;
    }
    .calendar-time-mini {
      font-size: 12px;
      color: rgba(255,255,255,.58);
    }
    .calendar-time-stepper,
    .calendar-time-presets {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .calendar-time-stepper .calendar-chip-btn,
    .calendar-time-presets .calendar-chip-btn {
      flex: 1 1 calc(50% - 4px);
      min-width: 0;
    }
    .calendar-overtime-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
      margin-top: 4px;
    }
    .calendar-overtime-grid .calendar-chip-btn {
      width: 100%;
      justify-content: center;
    }
    .calendar-modal-grid .calendar-time-card,
    .calendar-modal-grid .calendar-date-card {
      width: 100%;
    }
    @media (max-width: 768px) {
      .calendar-inline-editor {
        grid-template-columns: 1fr;
      }
      .calendar-hub-tabs,
      .calendar-leave-summary-grid {
        grid-template-columns: 1fr;
      }
      .calendar-risk-metrics,
      .calendar-analytics-grid,
      .calendar-trend-focus-stats {
        grid-template-columns: 1fr;
      }
      .calendar-leave-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .calendar-overtime-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      }
    }

        /* Calendar base restore */
    .calendar-wrap { display:grid; gap:16px; }
    .calendar-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
    .calendar-shell { display:grid; gap:18px; }
    .calendar-stage {
      padding: 18px;
      border-radius: 30px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.08), rgba(255,255,255,0) 44%),
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.022));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 44px rgba(0,0,0,.16);
    }
    .calendar-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
    .calendar-plus-btn {
      width: 56px;
      min-width: 56px;
      height: 56px;
      border-radius: 20px;
      font-size: 30px;
      line-height: 1;
      padding: 0;
    }
    .calendar-compact-note {
      padding: 0 4px;
      font-size: 13px;
      line-height: 1.7;
      color: rgba(255,255,255,.56);
    }
.calendar-inline-panel {
  padding: 18px;
  border-radius: 26px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.08), rgba(255,255,255,0) 48%),
        linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.024));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 34px rgba(0,0,0,.14);
  display: grid;
  gap: 12px;
}
.calendar-main-section {
  overflow: visible;
}
.simple-calendar-shell {
  gap: 16px;
}
.simple-calendar-shell .calendar-head {
  align-items: flex-end;
}
.calendar-stage.is-main-calendar {
  padding: 24px;
  border-radius: 34px;
  overflow: visible;
}
.simple-calendar-shell .calendar-grid {
  gap: 12px;
}
.simple-calendar-shell .weekday,
.simple-calendar-shell .calendar-cell {
  min-height: 126px;
  padding: 14px;
  border-radius: 22px;
}
.simple-calendar-shell .calendar-day-num {
  font-size: 18px;
}
.simple-calendar-shell .calendar-status,
.simple-calendar-shell .calendar-income {
  font-size: 12px;
  line-height: 1.45;
}
.simple-calendar-shell .calendar-legend {
  margin-top: 4px;
}
.calendar-inline-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.02em;
    }
    .calendar-inline-list,
    .calendar-drawer-stack {
      display: grid;
      gap: 10px;
    }
    .calendar-drawer-copy {
      font-size: 13px;
      line-height: 1.7;
      color: rgba(255,255,255,.62);
      margin-top: -2px;
    }
    .calendar-drawer-backdrop {
      position: fixed;
      inset: 0;
      z-index: 145;
      display: flex;
      justify-content: flex-end;
      padding: 20px;
      background: rgba(2,6,23,.68);
      backdrop-filter: blur(8px);
      animation: calendarDrawerFade .22s ease;
    }
    .calendar-drawer {
      width: min(460px, 100%);
      max-height: calc(100vh - 40px);
      overflow: auto;
      padding: 22px;
      border-radius: 32px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.09), rgba(255,255,255,0) 38%),
        linear-gradient(180deg, rgba(15,23,42,.98), rgba(15,23,42,.94));
      border: 1px solid rgba(255,255,255,.1);
      box-shadow: 0 30px 70px rgba(0,0,0,.48);
      display: grid;
      gap: 16px;
      transform: translateX(22px) scale(.985);
      opacity: 0;
      animation: calendarDrawerIn .22s ease forwards;
    }
    .calendar-drawer-header {
      display:flex;
      justify-content:space-between;
      gap:14px;
      align-items:flex-start;
      position: sticky;
      top: 0;
      z-index: 2;
      padding-bottom: 8px;
      background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(15,23,42,.88));
      backdrop-filter: blur(10px);
    }
    .calendar-hub-tabs {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      padding: 6px;
      border-radius: 999px;
      background: rgba(255,255,255,.05);
      border: 1px solid rgba(255,255,255,.08);
    }
    .calendar-hub-tab {
      min-height: 42px;
      border-radius: 999px;
      border: 0;
      background: transparent;
      color: rgba(255,255,255,.72);
      font-weight: 900;
      cursor: pointer;
      transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
    }
    .calendar-hub-tab:hover { transform: translateY(-1px); }
    .calendar-hub-tab.active {
      background: linear-gradient(135deg, #ffffff 0%, #f8fafc 45%, #bfdbfe 100%);
      color: #0f172a;
      box-shadow: 0 12px 24px rgba(0,0,0,.16);
    }
    .calendar-drawer-body { display:grid; gap:16px; padding-right:2px; }
    .calendar-drawer-section {
      padding: 16px;
      border-radius: 24px;
      background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.024));
      border: 1px solid rgba(255,255,255,.07);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
      display:grid;
      gap:12px;
      animation: calendarPanelIn .18s ease;
      transform-origin: top right;
    }
    .calendar-drawer-title {
      font-size: 14px;
      font-weight: 900;
      color: rgba(255,255,255,.92);
      letter-spacing: .02em;
    }
    .calendar-drawer-stack { display:grid; gap:10px; }
    .calendar-leave-summary-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }
    .calendar-summary-card {
      padding: 14px;
      border-radius: 22px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.1), rgba(255,255,255,0) 55%),
        linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 26px rgba(0,0,0,.14);
      display: grid;
      gap: 6px;
      min-width: 0;
    }
    .calendar-summary-label {
      font-size: 12px;
      color: rgba(255,255,255,.58);
      font-weight: 800;
    }
    .calendar-summary-value {
      font-size: 24px;
      font-weight: 900;
      word-break: break-word;
    }
    .calendar-summary-sub,
    .calendar-summary-note {
      font-size: 12px;
      line-height: 1.65;
      color: rgba(255,255,255,.62);
    }
    .calendar-summary-card.is-annual { border-color: rgba(96,165,250,.24); }
    .calendar-summary-card.is-annual-used { border-color: rgba(250,204,21,.22); }
    .calendar-summary-card.is-annual-remaining { border-color: rgba(110,231,183,.22); }
    .calendar-summary-card.is-sick { border-color: rgba(251,191,36,.24); }
    .calendar-summary-card.is-menstrual { border-color: rgba(244,114,182,.24); }
    .calendar-summary-card.is-vitality { border-color: rgba(45,212,191,.24); }
    .calendar-summary-card.is-personal { border-color: rgba(148,163,184,.24); }
    .calendar-summary-card.is-rest-work { border-color: rgba(251,191,36,.24); }
    .calendar-summary-card.is-holiday-work { border-color: rgba(251,113,133,.24); }
    .calendar-progress-card {
      grid-column: 1 / -1;
      padding: 14px 16px;
      border-radius: 22px;
      background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
      border: 1px solid rgba(255,255,255,.08);
      display: grid;
      gap: 10px;
    }
    .calendar-progress-track {
      height: 12px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(255,255,255,.08);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    }
    .calendar-progress-fill {
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #60a5fa 0%, #38bdf8 45%, #6ee7b7 100%);
      box-shadow: 0 10px 24px rgba(56,189,248,.24);
      transition: width .24s ease;
    }
    .calendar-analytics-grid {
      display:grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap:12px;
      margin-top:12px;
    }
    .calendar-analytics-card {
      padding:16px;
      border-radius:24px;
      background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
      border:1px solid rgba(255,255,255,.08);
      display:grid;
      gap:12px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 32px rgba(0,0,0,.14);
    }
    .calendar-analytics-card.is-risk {
      background: linear-gradient(180deg, rgba(125,211,252,.09), rgba(255,255,255,.025));
      border-color: rgba(125,211,252,.16);
    }
    .calendar-risk-banner {
      margin-top:12px;
      padding:14px 16px;
      border-radius:22px;
      border:1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
      display:grid;
      gap:10px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 30px rgba(0,0,0,.14);
    }
    .calendar-risk-banner.compact { margin-top:0; }
    .calendar-risk-banner.is-ok {
      border-color: rgba(110,231,183,.24);
      background: linear-gradient(180deg, rgba(16,185,129,.12), rgba(255,255,255,.02));
    }
    .calendar-risk-banner.is-warning {
      border-color: rgba(251,191,36,.28);
      background: linear-gradient(180deg, rgba(251,191,36,.14), rgba(255,255,255,.02));
    }
    .calendar-risk-banner.is-critical {
      border-color: rgba(251,113,133,.32);
      background: linear-gradient(180deg, rgba(190,24,93,.18), rgba(255,255,255,.02));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 36px rgba(127,29,29,.18);
    }
    .calendar-risk-head {
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
    }
    .calendar-risk-title {
      font-size:15px;
      font-weight:900;
      color: rgba(255,255,255,.94);
    }
    .calendar-risk-badge {
      display:inline-flex;
      align-items:center;
      gap:8px;
      width:fit-content;
      padding:8px 12px;
      border-radius:999px;
      background: rgba(15,23,42,.36);
      border:1px solid rgba(255,255,255,.08);
      font-size:12px;
      font-weight:900;
    }
    .calendar-risk-dot {
      width:10px;
      height:10px;
      border-radius:999px;
      background:#6ee7b7;
      box-shadow:0 0 0 6px rgba(110,231,183,.08);
      flex:0 0 auto;
      margin-top:4px;
    }
    .calendar-risk-banner.is-warning .calendar-risk-dot {
      background:#fbbf24;
      box-shadow:0 0 0 6px rgba(251,191,36,.08);
    }
    .calendar-risk-banner.is-critical .calendar-risk-dot {
      background:#fb7185;
      box-shadow:0 0 0 6px rgba(251,113,133,.08);
    }
    .calendar-risk-metrics {
      display:grid;
      grid-template-columns: repeat(3, minmax(0,1fr));
      gap:10px;
    }
    .calendar-mini-metric {
      padding:12px;
      border-radius:18px;
      background: rgba(15,23,42,.28);
      border:1px solid rgba(255,255,255,.06);
      display:grid;
      gap:6px;
    }
    .calendar-mini-metric span {
      font-size:12px;
      color: rgba(255,255,255,.58);
      font-weight:800;
    }
    .calendar-mini-metric strong {
      font-size:18px;
      font-weight:900;
    }
    .calendar-risk-list {
      display:grid;
      gap:8px;
    }
    .calendar-risk-item {
      width:100%;
      padding:12px 14px;
      border-radius:18px;
      background: rgba(15,23,42,.3);
      border:1px solid rgba(255,255,255,.06);
      display:grid;
      gap:6px;
      text-align:left;
      cursor:pointer;
      transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
    }
    .calendar-risk-item:hover,
    .calendar-risk-item.is-active {
      transform: translateY(-1px);
      border-color: rgba(125,211,252,.2);
      background: rgba(15,23,42,.44);
      box-shadow: 0 14px 28px rgba(0,0,0,.16);
    }
    .calendar-risk-item-head {
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      font-size:12px;
      font-weight:900;
      color: rgba(255,255,255,.88);
    }
    .calendar-risk-chip {
      display:inline-flex;
      align-items:center;
      padding:6px 10px;
      border-radius:999px;
      font-size:11px;
      font-weight:900;
      background: rgba(255,255,255,.08);
      color:#fff;
    }
    .calendar-risk-chip.streak { background: rgba(251,113,133,.18); color:#fecdd3; }
    .calendar-risk-chip.rest { background: rgba(251,191,36,.18); color:#fde68a; }
    .calendar-risk-chip.holiday { background: rgba(244,114,182,.18); color:#fbcfe8; }
    .calendar-risk-chip.long { background: rgba(96,165,250,.18); color:#bfdbfe; }
    .calendar-risk-chip.severity-info { background: rgba(96,165,250,.16); color:#bfdbfe; }
    .calendar-risk-chip.severity-warning { background: rgba(251,191,36,.18); color:#fde68a; }
    .calendar-risk-chip.severity-critical { background: rgba(251,113,133,.18); color:#fecdd3; }
    .calendar-risk-item-action {
      font-size:12px;
      color: rgba(255,255,255,.64);
      line-height:1.6;
    }
    .calendar-risk-detail {
      margin-top:12px;
      padding:16px;
      border-radius:22px;
      border:1px solid rgba(255,255,255,.08);
      background:
        radial-gradient(circle at top right, rgba(96,165,250,.14), rgba(96,165,250,0) 44%),
        linear-gradient(180deg, rgba(15,23,42,.48), rgba(15,23,42,.24));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 30px rgba(0,0,0,.14);
      display:grid;
      gap:12px;
    }
    .calendar-risk-detail-head {
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
    }
    .calendar-risk-detail-title {
      font-size:15px;
      font-weight:900;
      color:#fff;
    }
    .calendar-risk-detail-close {
      width:36px;
      height:36px;
      border-radius:14px;
      border:1px solid rgba(255,255,255,.08);
      background: rgba(255,255,255,.05);
      color:#fff;
      cursor:pointer;
    }
    .calendar-risk-detail-meta {
      display:flex;
      flex-wrap:wrap;
      gap:8px;
    }
    .calendar-risk-detail-pill {
      display:inline-flex;
      align-items:center;
      gap:8px;
      padding:8px 12px;
      border-radius:999px;
      background: rgba(255,255,255,.05);
      border:1px solid rgba(255,255,255,.08);
      font-size:12px;
      font-weight:800;
      color: rgba(255,255,255,.84);
    }
    .calendar-risk-detail-grid {
      display:grid;
      grid-template-columns: repeat(2, minmax(0,1fr));
      gap:10px;
    }
    .calendar-risk-history {
      border-radius: 18px;
      border:1px solid rgba(255,255,255,.07);
      background: rgba(255,255,255,.03);
      overflow:hidden;
    }
    .calendar-risk-history summary {
      list-style:none;
      cursor:pointer;
      padding: 14px 16px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      font-weight:900;
      color:#fff;
    }
    .calendar-risk-history summary::-webkit-details-marker { display:none; }
    .calendar-risk-history summary::after {
      content:'??;
      font-size:20px;
      color: rgba(255,255,255,.62);
      transition: transform .18s ease;
    }
    .calendar-risk-history[open] summary::after {
      transform: rotate(90deg);
    }
    .calendar-risk-history-body {
      padding: 0 16px 16px;
      display:grid;
      gap:10px;
    }
    .calendar-risk-history-item {
      padding: 12px 14px;
      border-radius: 16px;
      background: rgba(15,23,42,.34);
      border:1px solid rgba(255,255,255,.06);
      display:grid;
      gap:6px;
    }
    .calendar-risk-history-head {
      display:flex;
      justify-content:space-between;
      gap:10px;
      align-items:center;
      flex-wrap:wrap;
    }
    .calendar-risk-status-row {
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      align-items:center;
    }
    .calendar-risk-status-btn {
      border:1px solid rgba(255,255,255,.08);
      background: rgba(255,255,255,.04);
      color:#fff;
      border-radius:999px;
      padding:8px 12px;
      font-size:12px;
      font-weight:900;
      cursor:pointer;
      transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
    }
    .calendar-risk-status-btn:hover {
      transform: translateY(-1px);
      border-color: rgba(125,211,252,.22);
    }
    .calendar-risk-status-btn.is-active {
      background: linear-gradient(180deg, rgba(125,211,252,.18), rgba(56,189,248,.08));
      border-color: rgba(125,211,252,.28);
      box-shadow: 0 12px 22px rgba(14,165,233,.12);
    }
    .calendar-risk-status-note {
      font-size:12px;
      line-height:1.65;
      color: rgba(255,255,255,.66);
    }
    .calendar-risk-detail-box {
      padding:12px;
      border-radius:18px;
      background: rgba(15,23,42,.26);
      border:1px solid rgba(255,255,255,.06);
      display:grid;
      gap:6px;
    }
    .calendar-risk-detail-box span {
      font-size:11px;
      font-weight:800;
      color: rgba(255,255,255,.56);
    }
    .calendar-risk-detail-box strong {
      font-size:14px;
      font-weight:900;
      color:#fff;
    }
    .calendar-trend-focus {
      padding:12px 14px;
      border-radius:20px;
      background: rgba(15,23,42,.26);
      border:1px solid rgba(255,255,255,.06);
      display:grid;
      grid-template-columns: 1fr auto;
      gap:10px;
      align-items:start;
    }
    .calendar-trend-delta {
      align-self:start;
      display:inline-flex;
      align-items:center;
      padding:8px 12px;
      border-radius:999px;
      font-size:12px;
      font-weight:900;
      border:1px solid rgba(255,255,255,.08);
      background: rgba(255,255,255,.05);
      color: rgba(255,255,255,.82);
      white-space:nowrap;
    }
    .calendar-trend-delta.is-up {
      border-color: rgba(110,231,183,.2);
      background: rgba(16,185,129,.14);
      color:#bbf7d0;
    }
    .calendar-trend-delta.is-down {
      border-color: rgba(251,113,133,.2);
      background: rgba(190,24,93,.16);
      color:#fecdd3;
    }
    .calendar-trend-delta.is-flat {
      border-color: rgba(148,163,184,.18);
      background: rgba(71,85,105,.18);
      color:#cbd5e1;
    }
    .calendar-trend-focus-stats {
      display:grid;
      grid-template-columns: repeat(4, minmax(0,1fr));
      gap:10px;
      margin-top:10px;
    }
    .calendar-trend-stat {
      padding:12px;
      border-radius:18px;
      background: rgba(15,23,42,.24);
      border:1px solid rgba(255,255,255,.06);
      display:grid;
      gap:6px;
    }
    .calendar-trend-stat span {
      font-size:11px;
      font-weight:800;
      color: rgba(255,255,255,.56);
    }
    .calendar-trend-stat strong {
      font-size:15px;
      font-weight:900;
      color:#fff;
    }
    .calendar-trend-stage-wrap {
      display:grid;
      gap:12px;
    }
    .calendar-trend-stage {
      position:relative;
      min-height: 230px;
      border-radius:24px;
      overflow:hidden;
      border:1px solid rgba(255,255,255,.08);
      background:
        radial-gradient(circle at 50% 0%, rgba(96,165,250,.18), rgba(96,165,250,0) 52%),
        linear-gradient(180deg, rgba(15,23,42,.82), rgba(15,23,42,.54));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 36px rgba(0,0,0,.16);
    }
    .calendar-trend-svg {
      position:absolute;
      inset:0;
      width:100%;
      height:100%;
      pointer-events:none;
    }
    .calendar-trend-grid-line {
      stroke: rgba(255,255,255,.12);
      stroke-width: .7;
      stroke-dasharray: 2 4;
    }
    .calendar-trend-area {
      fill: url(#calendarTrendAreaGradient);
      opacity: .6;
    }
    .calendar-trend-line {
      fill: none;
      stroke: url(#calendarTrendLineGradient);
      stroke-width: 2.6;
      stroke-linecap: round;
      stroke-linejoin: round;
      filter: drop-shadow(0 10px 18px rgba(56,189,248,.24));
    }
    .calendar-trend-stage::after {
      content:'';
      position:absolute;
      left:16px;
      right:16px;
      bottom:34px;
      height:1px;
      background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.18), rgba(255,255,255,.06));
    }
    .calendar-trend-node {
      position:absolute;
      transform: translate(-50%, -50%);
      border:0;
      background:none;
      color:inherit;
      cursor:pointer;
      display:grid;
      justify-items:center;
      gap:8px;
      padding:0;
      min-width:0;
      z-index:2;
    }
    .calendar-trend-node-dot {
      width:16px;
      height:16px;
      border-radius:999px;
      background: linear-gradient(180deg, rgba(59,130,246,1), rgba(34,211,238,.92));
      border:2px solid rgba(255,255,255,.72);
      box-shadow: 0 0 0 8px rgba(56,189,248,.08), 0 12px 22px rgba(14,165,233,.24);
      transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    }
    .calendar-trend-node-pill {
      opacity:0;
      transform: translateY(6px) scale(.96);
      transition: opacity .18s ease, transform .18s ease;
      white-space:nowrap;
      padding:8px 12px;
      border-radius:999px;
      background: rgba(15,23,42,.84);
      border:1px solid rgba(255,255,255,.08);
      box-shadow: 0 10px 24px rgba(0,0,0,.24);
      font-size:11px;
      font-weight:900;
      color:#fff;
      backdrop-filter: blur(14px);
    }
    .calendar-trend-node:hover .calendar-trend-node-pill,
    .calendar-trend-node.is-active .calendar-trend-node-pill {
      opacity:1;
      transform: translateY(0) scale(1);
    }
    .calendar-trend-node:hover .calendar-trend-node-dot,
    .calendar-trend-node.is-active .calendar-trend-node-dot {
      transform: scale(1.2);
      box-shadow: 0 0 0 10px rgba(56,189,248,.1), 0 14px 26px rgba(14,165,233,.3);
      background: linear-gradient(180deg, rgba(125,211,252,1), rgba(110,231,183,.92));
    }
    .calendar-trend-axis {
      display:grid;
      grid-template-columns: repeat(12, minmax(0,1fr));
      gap:8px;
      padding:0 6px;
    }
    .calendar-trend-axis-label {
      text-align:center;
      font-size:11px;
      font-weight:900;
      color: rgba(255,255,255,.52);
      padding-top:4px;
    }
    .calendar-trend-axis-label.is-active {
      color:#dbeafe;
    }
    .calendar-trend-list,
    .calendar-ratio-list {
      display:grid;
      gap:10px;
    }
    .calendar-trend-row,
    .calendar-ratio-row {
      display:grid;
      gap:8px;
    }
    .calendar-trend-head,
    .calendar-ratio-head {
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      font-size:12px;
      color: rgba(255,255,255,.72);
      font-weight:800;
    }
    .calendar-trend-track,
    .calendar-ratio-track {
      height:10px;
      border-radius:999px;
      overflow:hidden;
      background: rgba(255,255,255,.08);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    }
    .calendar-trend-fill,
    .calendar-ratio-fill {
      height:100%;
      border-radius:inherit;
      transition: width .24s ease;
    }
    .calendar-trend-fill {
      background: linear-gradient(90deg, #60a5fa 0%, #38bdf8 55%, #6ee7b7 100%);
      box-shadow: 0 10px 20px rgba(56,189,248,.18);
    }
    .calendar-ratio-fill.annual_leave { background: linear-gradient(90deg, #60a5fa, #93c5fd); }
    .calendar-ratio-fill.sick_leave { background: linear-gradient(90deg, #f59e0b, #fdba74); }
    .calendar-ratio-fill.menstrual_leave { background: linear-gradient(90deg, #ec4899, #f9a8d4); }
    .calendar-ratio-fill.vitality_leave { background: linear-gradient(90deg, #14b8a6, #5eead4); }
    .calendar-ratio-fill.personal_leave { background: linear-gradient(90deg, #64748b, #cbd5e1); }
    .calendar-ratio-fill.family_care_leave { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }
    .calendar-legend {
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      align-items:center;
    }
    .calendar-legend-chip {
      display:inline-flex;
      align-items:center;
      gap:8px;
      padding:8px 12px;
      border-radius:999px;
      background: rgba(255,255,255,.05);
      border:1px solid rgba(255,255,255,.08);
      color: rgba(255,255,255,.82);
      font-size:12px;
      font-weight:800;
    }
    .calendar-legend-dot {
      width:10px;
      height:10px;
      border-radius:50%;
      box-shadow: 0 0 0 4px rgba(255,255,255,.03);
      flex:0 0 auto;
    }
    .calendar-legend-dot.normal { background:#6ee7b7; }
    .calendar-legend-dot.rest_day { background:#fbbf24; }
    .calendar-legend-dot.national_holiday { background:#fb7185; }
    .calendar-legend-dot.sick_leave { background:#f59e0b; }
    .calendar-legend-dot.menstrual_leave { background:#f472b6; }
    .calendar-legend-dot.annual_leave { background:#60a5fa; }
    .calendar-legend-dot.vitality_leave { background:#2dd4bf; }
    .calendar-legend-dot.personal_leave { background:#94a3b8; }
    .calendar-legend-dot.family_care_leave { background:#a78bfa; }
    .calendar-cell.type-national_holiday {
      outline: 2px solid rgba(251,113,133,.78);
      background: linear-gradient(180deg, rgba(127,29,29,.34), rgba(69,10,10,.22));
    }
    .calendar-cell.type-national_holiday .calendar-income { color:#fecaca; }
    .calendar-cell.type-rest_day {
      outline: 2px solid rgba(251,191,36,.72);
      background: linear-gradient(180deg, rgba(120,53,15,.26), rgba(30,41,59,.18));
    }
    .calendar-cell.type-rest_day .calendar-income { color:#fde68a; }
    .calendar-cell.type-sick_leave {
      outline: 2px solid rgba(245,158,11,.72);
      background: linear-gradient(180deg, rgba(120,53,15,.22), rgba(30,41,59,.18));
    }
    .calendar-cell.type-sick_leave .calendar-income { color:#fdba74; }
    .calendar-cell.type-menstrual_leave {
      outline: 2px solid rgba(244,114,182,.72);
      background: linear-gradient(180deg, rgba(131,24,67,.22), rgba(30,41,59,.18));
    }
    .calendar-cell.type-menstrual_leave .calendar-income { color:#f9a8d4; }
    .calendar-cell.type-annual_leave {
      outline: 2px solid rgba(96,165,250,.72);
      background: linear-gradient(180deg, rgba(30,64,175,.22), rgba(30,41,59,.18));
    }
    .calendar-cell.type-annual_leave .calendar-income { color:#93c5fd; }
    .calendar-cell.type-vitality_leave {
      outline: 2px solid rgba(45,212,191,.72);
      background: linear-gradient(180deg, rgba(13,148,136,.22), rgba(30,41,59,.18));
    }
    .calendar-cell.type-vitality_leave .calendar-income { color:#99f6e4; }
    .calendar-cell.type-personal_leave {
      outline: 2px solid rgba(148,163,184,.64);
      background: linear-gradient(180deg, rgba(71,85,105,.22), rgba(30,41,59,.18));
    }
    .calendar-cell.type-personal_leave .calendar-income { color:#cbd5e1; }
    .calendar-cell.type-family_care_leave {
      outline: 2px solid rgba(167,139,250,.72);
      background: linear-gradient(180deg, rgba(91,33,182,.22), rgba(30,41,59,.18));
    }
    .calendar-cell.type-family_care_leave .calendar-income { color:#ddd6fe; }
    .calendar-cell.type-rest_day .calendar-status,
    .calendar-cell.type-sick_leave .calendar-status,
    .calendar-cell.type-menstrual_leave .calendar-status,
    .calendar-cell.type-annual_leave .calendar-status,
    .calendar-cell.type-vitality_leave .calendar-status,
    .calendar-cell.type-family_care_leave .calendar-status,
    .calendar-cell.type-personal_leave .calendar-status,
    .calendar-cell.type-national_holiday .calendar-status { color: rgba(255,255,255,.86); }
    .calendar-cell.type-normal.has-attendance {
      background: linear-gradient(180deg, rgba(15,118,110,.18), rgba(15,23,42,.18));
      border-color: rgba(45,212,191,.16);
    }
    .calendar-cell.has-streak-risk {
      box-shadow: 0 0 0 2px rgba(251,113,133,.58) inset, 0 18px 28px rgba(127,29,29,.12);
    }
    .calendar-cell.has-streak-risk .calendar-status {
      color: #fecdd3;
    }
    @keyframes calendarDrawerFade {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    @keyframes calendarDrawerIn {
      to { transform: translateX(0) scale(1); opacity: 1; }
    }
    @keyframes calendarPanelIn {
      from { transform: translateY(8px) scale(.985); opacity: 0; }
      to { transform: translateY(0) scale(1); opacity: 1; }
    }
    .calendar-modal-section.is-disabled {
      opacity: .56;
      border-color: rgba(148,163,184,.14);
      background: linear-gradient(180deg, rgba(51,65,85,.36), rgba(15,23,42,.24));
    }
    .calendar-modal-section.is-disabled .calendar-chip-btn,
    .calendar-modal-section.is-disabled .calendar-step-btn {
      pointer-events: none;
      opacity: .52;
    }
    .calendar-modal-section.is-disabled .calendar-time-card {
      box-shadow: none;
    }
    .calendar-leave-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }
    .calendar-grid { --calendar-col-gap: 12px; --calendar-row-gap: 12px; display:grid; grid-template-columns: 1fr; row-gap: 10px; }
    .calendar-weekdays-row,
    .calendar-days-grid { display:grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: var(--calendar-col-gap); }
    .calendar-days-grid { row-gap: var(--calendar-row-gap); }
    .calendar-weekday.is-weekend { color: #fca5a5; }
    .calendar-weekday.is-sunday { color: #fca5a5; }
    .calendar-weekday.is-saturday { color: #93c5fd; }
    .calendar-day-num.is-saturday { color: #93c5fd; }
    .calendar-day-num.is-sunday { color: #fca5a5; }
    .calendar-day-num.is-holiday-text { color: #f9a8d4; }
    .calendar-cell-content { display:grid; gap:6px; }
    .calendar-topline { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
    .calendar-day-num { font-weight:900; }
    .calendar-cell.is-holiday .calendar-day-num { color:#fee2e2; }
    .calendar-empty-note { opacity:.45; }
    .weekday, .calendar-cell { min-height:90px; padding:12px; border-radius:18px; }
    .weekday { text-align:center; font-weight:900; color: rgba(255,255,255,.72); background: rgba(255,255,255,.04); }
    .calendar-cell.empty { opacity:.25; }
    .calendar-cell.has-attendance { outline:2px solid rgba(110,231,183,.65); }
    .calendar-cell.future-lock {
      outline: 2px solid rgba(148,163,184,.45);
      background: linear-gradient(180deg, rgba(71,85,105,.22), rgba(30,41,59,.18));
    }
    .calendar-cell.today-active {
      outline: 2px solid rgba(127,29,29,.9);
      background: linear-gradient(180deg, rgba(127,29,29,.28), rgba(69,10,10,.18));
    }
    .calendar-cell.done-green { outline: 2px solid rgba(110,231,183,.7); }
    .calendar-cell.preset-blue {
      outline: 2px solid rgba(96,165,250,.82);
      background: linear-gradient(180deg, rgba(30,64,175,.24), rgba(30,41,59,.18));
    }
    .calendar-income.preset-blue { color:#93c5fd; }
    .calendar-cell.today { box-shadow: 0 0 0 2px rgba(253,230,138,.8) inset; }
    .calendar-cell.clickable { cursor:pointer; transition: transform .12s ease, border-color .12s ease; }
    .calendar-cell.clickable:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.24); }
    .calendar-cell.has-overtime { box-shadow: 0 0 0 2px rgba(252,211,77,.8) inset; }
    .calendar-cell.is-holiday {
      background: linear-gradient(180deg, rgba(190,24,93,.28), rgba(112,26,117,.18));
      border: 1px solid rgba(249,168,212,.34);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    }
    .calendar-cell.is-holiday .calendar-status,
    .calendar-cell.is-holiday .calendar-income { color:#fee2e2; }
    .holiday-chip {
      display:inline-block; margin-top:6px; padding:4px 8px; border-radius:999px;
      background: rgba(249,168,212,.16); color:#fbcfe8; font-size:11px; font-weight:900;
      letter-spacing:.01em;
    }
    .holiday-chip.is-holiday {
      background: rgba(244,114,182,.16);
      color: #fbcfe8;
    }
    .holiday-chip.is-observed {
      background: rgba(96,165,250,.18);
      color: #dbeafe;
    }
    .holiday-chip.is-national {
      background: rgba(251,191,36,.18);
      color: #fde68a;
    }
    .calendar-legal-note { margin-top: 10px; font-size: 12px; color: #fde68a; line-height: 1.7; }
    /* Calendar layout tuning */
    .calendar-grid { grid-template-columns: 1fr; row-gap:12px; }
    .weekday, .calendar-cell { min-height: 96px; padding: 12px; }
    .calendar-head .inline { gap:10px; }
    @media (max-width: 980px) {
      .calendar-grid { grid-template-columns: 1fr; row-gap:10px; }
      .calendar-drawer-backdrop {
        justify-content: center;
        align-items: flex-end;
        padding: 12px;
      }
      .calendar-drawer {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 28px 28px 20px 20px;
      }
    }
    @media (max-width: 768px) {
      .calendar-grid { grid-template-columns: 1fr; row-gap:8px; }
      .weekday, .calendar-cell { min-height: 84px; padding: 10px; }
      .calendar-stage { padding: 14px; border-radius: 24px; }
      .calendar-plus-btn { width: 50px; min-width: 50px; height: 50px; border-radius: 18px; }
      .calendar-leave-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 430px) {
      .calendar-grid { grid-template-columns: 1fr; }
    }
/* Chat layout tighten */
    #friends .dm-shell { align-items: stretch; }
    #friends .dm-shell.has-thread { height: min(68vh, 640px); }
    #friends .dm-thread-card { padding: 14px; }
    #friends .dm-sidebar-card { padding: 14px; }
    #friends .dm-thread-panel { flex: 1; min-height: 0; }
    #friends .dm-thread-messages { flex: 1; min-height: 0; padding-bottom: 16px; }
    #friends .dm-empty { min-height: 220px; }
    #friends .dm-compose { padding: 8px 4px 6px; }
    /* Chat system refresh */
    #friends .dm-shell {
      grid-template-columns: 292px minmax(0, 1fr);
      gap: 16px;
      align-items: stretch;
      min-height: 680px;
    }
    #friends .dm-shell.chat-focus {
      grid-template-columns: 292px minmax(0, 1fr);
    }
    #friends .dm-sidebar-card,
    #friends .dm-thread-card {
      background:
        radial-gradient(circle at top, rgba(255,255,255,.08), rgba(255,255,255,0) 46%),
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
      box-shadow: 0 24px 50px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.04);
    }
    #friends .dm-sidebar-card {
      grid-template-rows: auto auto auto 1fr;
      gap: 12px;
      padding: 12px;
      overflow: hidden;
    }
    #friends .dm-sidebar-summary {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    #friends .dm-sidebar-chip {
      display: inline-flex;
      align-items: center;
      min-height: 30px;
      padding: 0 12px;
      border-radius: 999px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.08);
      color: rgba(255,255,255,.82);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .02em;
    }
    #friends .dm-sidebar-chip.soft {
      color: rgba(255,255,255,.56);
      background: rgba(255,255,255,.03);
    }
    #friends .dm-thread-card {
      min-height: 680px;
      width: 100%;
      min-width: 0;
      padding: 16px;
    }
    #friends .dm-list {
      align-content: start;
      gap: 8px;
    }
    #friends .dm-search-actions {
      align-content: start;
    }
    #friends #friendSearchResultWrap,
    #friends #incomingFriendRequestWrap {
      padding: 12px;
      border-radius: 22px;
      background: rgba(255,255,255,.035);
      border: 1px solid rgba(255,255,255,.07);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
    }
    #friends .dm-search-mini {
      padding-top: 0;
    }
    #friends .dm-search-mini input {
      min-height: 46px;
      background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
      border-color: rgba(255,255,255,.08);
    }
    #friends .dm-list,
    #friends .dm-thread-messages,
    #friends .dm-search-result-list,
    #friends .dm-request-list {
      padding-right: 4px;
    }
    #friends .dm-item {
      padding: 10px 12px;
      border-radius: 20px;
      background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
      position: relative;
      overflow: hidden;
      isolation: isolate;
    }
    #friends .dm-avatar {
      width: 40px;
      height: 40px;
      font-size: 14px;
    }
    #friends .dm-name {
      font-size: 13px;
    }
    #friends .dm-snippet {
      font-size: 11px;
      padding-right: 34px;
    }
    #friends .dm-item.active {
      border-color: rgba(255,255,255,.18);
      box-shadow: 0 14px 28px rgba(0,0,0,.18);
    }
    #friends .dm-item.has-unread {
      border-color: rgba(125,211,252,.22);
      background:
        radial-gradient(circle at 12% 22%, rgba(125,211,252,.18), rgba(125,211,252,0) 34%),
        linear-gradient(180deg, rgba(59,130,246,.09), rgba(255,255,255,.028));
      box-shadow: 0 14px 30px rgba(2,8,23,.28), 0 0 0 1px rgba(96,165,250,.08), inset 0 1px 0 rgba(255,255,255,.06);
    }
    #friends .dm-item.has-unread .dm-avatar {
      background: linear-gradient(135deg, rgba(125,211,252,.42), rgba(244,114,182,.34));
      box-shadow: 0 0 0 2px rgba(125,211,252,.14), 0 0 24px rgba(96,165,250,.26);
    }
    #friends .dm-item.has-unread .dm-name,
    #friends .dm-item.has-unread .dm-snippet {
      color: rgba(255,255,255,.94);
    }
    #friends .dm-snippet.unread {
      font-weight: 800;
      color: rgba(255,255,255,.96);
    }
    #friends .dm-time.unread {
      color: #93c5fd;
      text-shadow: 0 0 16px rgba(96,165,250,.45);
    }
    #friends .dm-unread-spark {
      position: absolute;
      top: -2px;
      right: -1px;
      width: 12px;
      height: 12px;
      border-radius: 999px;
      background: radial-gradient(circle, #ffffff 0%, #bae6fd 34%, #38bdf8 62%, rgba(56,189,248,.18) 100%);
      box-shadow: 0 0 0 3px rgba(14,165,233,.12), 0 0 18px rgba(56,189,248,.65);
      animation: dmUnreadPulse 1.8s ease-in-out infinite;
    }
    #friends .dm-unread-badge {
      position: absolute;
      right: 12px;
      bottom: 11px;
      min-width: 18px;
      height: 18px;
      padding: 0 6px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #38bdf8, #8b5cf6);
      color: white;
      font-size: 10px;
      font-weight: 900;
      box-shadow: 0 8px 18px rgba(56,189,248,.32);
      animation: dmUnreadPulse 1.8s ease-in-out infinite;
    }
    @keyframes dmUnreadPulse {
      0%, 100% { transform: scale(1); box-shadow: 0 8px 18px rgba(56,189,248,.22); }
      50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(56,189,248,0), 0 12px 24px rgba(56,189,248,.34); }
    }
    #friends .dm-list-filler {
      margin-top: 6px;
      padding: 14px 12px;
      border-radius: 18px;
      border: 1px dashed rgba(255,255,255,.08);
      background: rgba(255,255,255,.02);
      color: rgba(255,255,255,.42);
      font-size: 12px;
      line-height: 1.7;
    }
    #friends .dm-thread-top {
      padding: 4px 4px 14px;
      margin-bottom: 2px;
      border-radius: 22px;
      background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
      border: 1px solid rgba(255,255,255,.06);
      padding-left: 10px;
      padding-right: 10px;
    }
    #friends .dm-thread-user > div:last-child { min-width: 0; }
    #friends #friendThreadName { letter-spacing: -.01em; }
    #friends #friendThreadStatus {
      color: rgba(255,255,255,.56) !important;
    }
    #friends .dm-badge {
      margin-top: 2px;
      background: rgba(255,255,255,.05);
      border: 1px solid rgba(255,255,255,.06);
    }
    #friends .dm-thread-messages {
      gap: 12px;
      padding: 8px 4px 18px;
    }
    #friends .dm-message-stack {
      max-width: min(78%, 420px);
    }
    #friends .dm-bubble {
      font-size: 13px;
      line-height: 1.5;
    }
    #friends .dm-message-meta {
      font-size: 10px;
      color: rgba(255,255,255,.38);
    }
    #friends .dm-empty {
      min-height: 320px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.05), rgba(255,255,255,0) 48%),
        linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
      border-style: solid;
    }
    #friends .dm-compose {
      margin-top: auto;
      padding: 12px 2px 2px;
      gap: 8px;
    }
    #friends .dm-reply-bar {
      border-radius: 16px;
      background: rgba(255,255,255,.05);
    }
    #friends .dm-compose-row {
      grid-template-columns: minmax(0, 1fr) 88px;
      min-height: 54px;
      padding: 6px;
      border-radius: 24px;
      background:
        linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)),
        rgba(15,23,42,.55);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 24px rgba(0,0,0,.14);
    }
    #friends .dm-compose-row input {
      min-width: 0;
      padding-right: 8px;
      font-size: 14px;
    }
    #friends #sendFriendChatBtn {
      width: 88px;
      min-width: 88px;
      height: 42px;
    }
    #friends .dm-quick-actions {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 2px;
      scrollbar-width: none;
    }
    #friends .dm-quick-actions::-webkit-scrollbar { display: none; }
    #friends .dm-quick-btn {
      flex: 0 0 auto;
      min-height: 38px;
      height: 38px;
      padding: 0 14px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,.08);
      background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
      color: rgba(255,255,255,.88);
      font-size: 12px;
      font-weight: 800;
      line-height: 1;
      text-align: center;
      box-shadow: 0 10px 20px rgba(0,0,0,.14);
      white-space: nowrap;
    }
    #friends .dm-quick-btn:hover {
      transform: translateY(-1px);
      border-color: rgba(255,255,255,.16);
    }
    .dm-empty-shell {
      display: grid;
      gap: 10px;
      justify-items: center;
      max-width: 360px;
    }
    .dm-empty-title {
      font-size: 22px;
      font-weight: 900;
      color: rgba(255,255,255,.92);
    }
    .dm-empty-sub {
      font-size: 14px;
      line-height: 1.7;
      color: rgba(255,255,255,.62);
    }
    @media (max-width: 1100px) {
      #friends .dm-shell {
        grid-template-columns: 1fr;
        min-height: auto;
      }
      #friends .dm-shell.chat-focus {
        grid-template-columns: 1fr;
      }
      #friends .dm-shell.chat-focus .dm-sidebar-card {
        display: none;
      }
      #friends .dm-thread-card {
        min-height: 540px;
      }
    }
    @media (max-width: 768px) {
      #friends .dm-thread-card {
        min-height: calc(100vh - 280px);
      }
      #friends .dm-sidebar-summary {
        justify-content: flex-start;
      }
      #friends .dm-quick-actions {
        display: grid;
        grid-template-columns: 1fr;
        overflow: visible;
      }
      #friends .dm-message-stack {
        max-width: 88%;
      }
      #friends .dm-empty {
        min-height: 240px;
      }
    }
    .auth-redesign-card {
      padding: 28px;
      background:
        radial-gradient(circle at top, rgba(125,211,252,.08), rgba(255,255,255,0) 40%),
        linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.038));
      border-radius: 34px;
      box-shadow: 0 28px 70px rgba(0,0,0,.34);
    }
    .auth-topbar { display:grid; gap:14px; }
    .auth-topline {
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:18px;
      flex-wrap:wrap;
    }
    .auth-switch {
      display:flex;
      gap:8px;
      padding:6px;
      border-radius:999px;
      background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
      border:1px solid rgba(255,255,255,.08);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 24px rgba(0,0,0,.12);
    }
    .auth-switch button {
      min-width: 92px;
      min-height: 46px;
      border: 0;
      border-radius: 999px;
      padding: 0 18px;
      font-weight: 900;
    }
    .auth-switch .active {
      background: linear-gradient(135deg, #ffffff, #f8fafc 44%, #dbeafe 100%);
      color: #0f172a;
      box-shadow: 0 8px 18px rgba(15,23,42,.14);
    }
    .auth-switch .inactive {
      background: transparent;
      color: rgba(255,255,255,.84);
    }
    .auth-error {
      padding: 12px 14px;
      border-radius: 18px;
      border: 1px solid rgba(248,113,113,.24);
      background: linear-gradient(180deg, rgba(127,29,29,.22), rgba(127,29,29,.12));
      color: #fecaca;
      font-size: 13px;
      line-height: 1.6;
    }
    .auth-form-shell {
      display:grid;
      gap:18px;
      margin-top: 18px;
    }
    .auth-form-shell-register { margin-top: 8px; }
    .auth-primary-surface,
    .auth-provider-surface {
      padding: 22px;
      border-radius: 28px;
      border: 1px solid rgba(255,255,255,.08);
      background:
        radial-gradient(circle at top, rgba(255,255,255,.09), rgba(255,255,255,0) 42%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 38px rgba(0,0,0,.18);
    }
    .auth-surface-login {
      background:
        radial-gradient(circle at top left, rgba(125,211,252,.12), rgba(255,255,255,0) 40%),
        linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
    }
    .auth-surface-oauth,
    .auth-surface-register {
      background:
        radial-gradient(circle at top right, rgba(251,191,36,.08), rgba(255,255,255,0) 34%),
        linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028));
    }
    .auth-section-kicker {
      font-size: 12px;
      font-weight: 900;
      letter-spacing: .16em;
      text-transform: uppercase;
      color: rgba(255,255,255,.62);
    }
    .auth-soft-copy {
      margin-top: 10px;
      font-size: 14px;
      line-height: 1.75;
      color: rgba(255,255,255,.72);
    }
    .auth-simple-grid {
      display:grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap:14px;
      margin-top: 18px;
    }
    .auth-simple-grid-single { grid-template-columns: 1fr; }
    .auth-register-grid .auth-span-2 { grid-column: 1 / -1; }
    .auth-provider-grid {
      display:grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap:12px;
      margin-top: 16px;
    }
    .auth-submit-wrap {
      margin-top: 18px;
      position: static;
      background: none;
      padding-top: 0;
    }
    .oauth-btn {
      min-height: 52px;
      border-radius: 20px;
      border: 1px solid rgba(255,255,255,.1);
      background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
      color: #fff;
      font-weight: 900;
      letter-spacing: .01em;
      box-shadow: 0 14px 28px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.06);
    }
    .oauth-btn.google {
      background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(219,234,254,.12));
    }
    .oauth-btn.facebook {
      background: linear-gradient(135deg, rgba(59,130,246,.24), rgba(30,64,175,.18));
    }
    .oauth-btn.slim {
      min-height: 44px;
      padding: 0 18px;
      white-space: nowrap;
    }
    .oauth-btn.is-missing-config {
      opacity: .82;
      border-style: dashed;
    }
    .auth-link-stack {
      display:grid;
      gap:12px;
      margin-top: 18px;
    }
    .auth-link-card {
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:14px;
      padding:16px 18px;
      border-radius: 22px;
      background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
      border: 1px solid rgba(255,255,255,.07);
    }
    .auth-link-copy { min-width: 0; }
    .auth-link-title {
      font-size: 15px;
      font-weight: 900;
      color: #fff;
    }
    .auth-link-desc {
      margin-top: 6px;
      font-size: 13px;
      line-height: 1.65;
      color: rgba(255,255,255,.62);
    }
    .auth-link-actions {
      display:grid;
      gap:10px;
      justify-items:end;
      flex: 0 0 auto;
    }
    .auth-link-status {
      max-width: 240px;
      padding: 8px 12px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
      color: rgba(255,255,255,.86);
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.08);
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .auth-link-status.linked {
      color: #dbeafe;
      background: rgba(59,130,246,.16);
      border-color: rgba(96,165,250,.24);
      box-shadow: 0 8px 22px rgba(59,130,246,.14);
    }
    .auth-provider-hint {
      margin-top: 14px;
      padding: 12px 14px;
      border-radius: 18px;
      border: 1px dashed rgba(255,255,255,.12);
      background: rgba(255,255,255,.035);
      color: rgba(255,255,255,.68);
      font-size: 12px;
      line-height: 1.7;
    }
    .auth-side-card {
      display: grid;
      gap: 18px;
      background:
        radial-gradient(circle at top left, rgba(251,191,36,.11), rgba(255,255,255,0) 30%),
        radial-gradient(circle at bottom right, rgba(59,130,246,.12), rgba(255,255,255,0) 34%),
        linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
      box-shadow: 0 24px 64px rgba(0,0,0,.28);
      border-radius: 34px;
    }
    .auth-side-hero {
      background: linear-gradient(135deg, rgba(253,186,116,.98), rgba(191,219,254,.96), rgba(253,224,71,.94));
      color: #0f172a;
      border-radius: 28px;
      box-shadow: 0 18px 44px rgba(15,23,42,.18);
    }
    .auth-side-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(15,23,42,.08);
      font-weight: 900;
      letter-spacing: .18em;
    }
    .auth-side-copy {
      margin-top: 10px;
      font-size: 15px;
      line-height: 1.8;
      opacity: .86;
      max-width: 30rem;
    }
    .auth-side-desc {
      font-size: 14px;
      line-height: 1.8;
      color: rgba(255,255,255,.74);
    }
    .auth-side-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .auth-side-mini {
      padding: 16px 18px;
      border-radius: 24px;
      background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.024));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 34px rgba(0,0,0,.12);
    }
    .auth-side-mini-wide { grid-column: 1 / -1; }
    .auth-side-mini-title {
      font-size: 14px;
      font-weight: 900;
      color: #fff;
    }
    .auth-side-mini-copy {
      margin-top: 6px;
      font-size: 13px;
      line-height: 1.7;
      color: rgba(255,255,255,.66);
    }
    .auth-privacy-card,
    .auth-config-card {
      padding: 18px;
      border-radius: 26px;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.08), rgba(255,255,255,0) 42%),
        linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 16px 36px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.04);
    }
    .auth-privacy-title,
    .auth-config-title {
      font-size: 16px;
      font-weight: 900;
      color: #fff;
    }
    .auth-privacy-list {
      display: grid;
      gap: 10px;
      margin-top: 12px;
      font-size: 13px;
      line-height: 1.75;
      color: rgba(255,255,255,.76);
    }
    .auth-privacy-item {
      padding: 10px 12px;
      border-radius: 18px;
      background: rgba(255,255,255,.04);
      border: 1px solid rgba(255,255,255,.05);
    }
    .auth-config-header {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: flex-start;
      flex-wrap: wrap;
    }
    .auth-config-copy {
      margin-top: 8px;
      font-size: 13px;
      line-height: 1.75;
      color: rgba(255,255,255,.68);
      max-width: 30rem;
    }
    .auth-config-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      margin-top: 14px;
    }
    .auth-config-actions {
      display: flex;
      justify-content: flex-end;
      margin-top: 14px;
    }
    .auth-config-status {
      display: inline-flex;
      align-items: center;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.08);
      color: rgba(255,255,255,.78);
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }
    .auth-config-status.ready {
      color: #d1fae5;
      background: rgba(16,185,129,.14);
      border-color: rgba(110,231,183,.22);
      box-shadow: 0 10px 22px rgba(16,185,129,.12);
    }
    body.auth-transitioning {
      overflow: hidden;
    }
    .auth-transition-overlay {
      position: fixed;
      inset: 0;
      z-index: 240;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background:
        radial-gradient(circle at 18% 18%, rgba(244,114,182,.16), transparent 34%),
        radial-gradient(circle at 82% 16%, rgba(125,211,252,.16), transparent 32%),
        linear-gradient(180deg, rgba(2,6,23,.76), rgba(2,6,23,.94));
      backdrop-filter: blur(22px) saturate(120%);
      opacity: 0;
      pointer-events: none;
      transition: opacity .32s ease, background .4s ease;
    }
    .auth-transition-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }
    .auth-transition-overlay.is-leaving {
      opacity: 0;
    }
    .auth-transition-shell {
      position: relative;
      width: min(520px, calc(100vw - 28px));
      padding: 30px 30px 28px;
      border-radius: 34px;
      overflow: hidden;
      background:
        radial-gradient(circle at top, rgba(255,255,255,.12), rgba(255,255,255,0) 52%),
        linear-gradient(180deg, rgba(15,23,42,.9), rgba(15,23,42,.8));
      border: 1px solid rgba(255,255,255,.12);
      box-shadow: 0 32px 100px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.08);
      display: grid;
      grid-template-columns: 140px 1fr;
      gap: 24px;
      align-items: center;
      isolation: isolate;
      transform-origin: center;
      animation: authLoginLift .72s cubic-bezier(.18,.84,.28,1) both;
    }
    .auth-transition-shell::before {
      content: '';
      position: absolute;
      inset: -30% 38% auto -10%;
      height: 180px;
      background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
      opacity: .9;
      transform: rotate(14deg);
      pointer-events: none;
    }
    .auth-transition-shell::after {
      content: '';
      position: absolute;
      inset: auto -12% -34% 46%;
      height: 200px;
      background: radial-gradient(circle, rgba(96,165,250,.22), transparent 70%);
      opacity: .75;
      pointer-events: none;
    }
    .auth-transition-orbit {
      position: relative;
      width: 132px;
      height: 132px;
      display: grid;
      place-items: center;
      justify-self: center;
    }
    .auth-transition-core {
      position: relative;
      width: 58px;
      height: 58px;
      border-radius: 50%;
      background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(216,180,254,.55) 45%, rgba(96,165,250,.28) 80%);
      box-shadow: 0 0 0 10px rgba(255,255,255,.04), 0 0 34px rgba(196,181,253,.3);
      animation: authCorePulse 1.8s ease-in-out infinite;
    }
    .auth-transition-ring {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      border: 1px solid rgba(255,255,255,.16);
      box-shadow: inset 0 0 30px rgba(255,255,255,.04);
      animation: authRingSpin 10s linear infinite;
    }
    .auth-transition-ring.ring-b {
      inset: 16px;
      border-color: rgba(196,181,253,.28);
      animation-direction: reverse;
      animation-duration: 7s;
    }
    .auth-transition-ring.ring-c {
      inset: 34px;
      border-color: rgba(125,211,252,.28);
      animation-duration: 5.6s;
    }
    .auth-transition-spark {
      position: absolute;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(255,255,255,.96), rgba(125,211,252,.12));
      box-shadow: 0 0 18px rgba(255,255,255,.45);
      animation: authSparkFloat 2.6s ease-in-out infinite;
    }
    .auth-transition-spark.spark-a {
      top: 10px;
      right: 20px;
    }
    .auth-transition-spark.spark-b {
      bottom: 18px;
      left: 18px;
      animation-delay: -.8s;
    }
    .auth-transition-copy {
      position: relative;
      z-index: 1;
      display: grid;
      gap: 8px;
    }
    .auth-transition-kicker {
      font-size: 12px;
      font-weight: 900;
      letter-spacing: .24em;
      text-transform: uppercase;
      color: rgba(255,255,255,.54);
    }
    .auth-transition-title {
      font-size: clamp(28px, 3.4vw, 36px);
      line-height: 1.08;
      font-weight: 900;
      letter-spacing: -.03em;
      color: #fff;
    }
    .auth-transition-sub {
      font-size: 14px;
      line-height: 1.8;
      color: rgba(255,255,255,.74);
      max-width: 30ch;
    }
    .auth-transition-progress {
      position: relative;
      margin-top: 8px;
      height: 4px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(255,255,255,.08);
    }
    .auth-transition-progress::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(90deg, rgba(125,211,252,0), rgba(125,211,252,.92), rgba(244,114,182,.92), rgba(125,211,252,0));
      transform: translateX(-100%);
      animation: authProgressSweep 1.35s ease-in-out infinite;
    }
    .auth-transition-overlay[data-mode="login"] {
      background:
        radial-gradient(circle at 16% 18%, rgba(244,114,182,.18), transparent 32%),
        radial-gradient(circle at 84% 14%, rgba(125,211,252,.18), transparent 30%),
        linear-gradient(180deg, rgba(2,6,23,.72), rgba(2,6,23,.92));
    }
    .auth-transition-overlay[data-mode="login"] .auth-transition-shell {
      border-color: rgba(196,181,253,.22);
      box-shadow: 0 32px 100px rgba(0,0,0,.46), 0 0 80px rgba(125,211,252,.12), inset 0 1px 0 rgba(255,255,255,.08);
      animation-name: authLoginLift;
    }
    .auth-transition-overlay[data-mode="login"] .auth-transition-orbit {
      animation: authOrbitBloom 2.3s ease-in-out infinite;
    }
    .auth-transition-overlay[data-mode="logout"] {
      background:
        radial-gradient(circle at 18% 18%, rgba(45,212,191,.18), transparent 34%),
        radial-gradient(circle at 84% 18%, rgba(96,165,250,.16), transparent 30%),
        linear-gradient(180deg, rgba(2,6,23,.84), rgba(2,6,23,.97));
    }
    .auth-transition-overlay[data-mode="logout"] .auth-transition-shell {
      border-color: rgba(94,234,212,.18);
      background:
        radial-gradient(circle at top, rgba(167,243,208,.08), rgba(255,255,255,0) 50%),
        linear-gradient(180deg, rgba(15,23,42,.92), rgba(6,78,59,.32));
      box-shadow: 0 32px 100px rgba(0,0,0,.46), 0 0 84px rgba(45,212,191,.12), inset 0 1px 0 rgba(255,255,255,.08);
      animation-name: authLogoutSettle;
    }
    .auth-transition-overlay[data-mode="logout"] .auth-transition-progress::before {
      background: linear-gradient(90deg, rgba(45,212,191,0), rgba(94,234,212,.9), rgba(96,165,250,.85), rgba(45,212,191,0));
      animation-duration: 1.7s;
    }
    .auth-transition-overlay[data-mode="logout"] .auth-transition-orbit {
      transform: scale(.96);
    }
    .auth-transition-overlay[data-mode="logout"] .auth-transition-ring {
      animation-duration: 14s;
      opacity: .72;
    }
    .auth-transition-overlay[data-mode="logout"] .auth-transition-ring.ring-b {
      animation-duration: 10s;
    }
    .auth-transition-overlay[data-mode="logout"] .auth-transition-ring.ring-c {
      animation-duration: 7.8s;
    }
    .auth-transition-overlay[data-mode="logout"] .auth-transition-spark {
      opacity: .56;
      animation-duration: 3.1s;
    }
    .auth-transition-overlay[data-mode="delete"] {
      background:
        radial-gradient(circle at 18% 18%, rgba(251,146,60,.18), transparent 34%),
        radial-gradient(circle at 82% 16%, rgba(251,113,133,.18), transparent 30%),
        linear-gradient(180deg, rgba(15,23,42,.88), rgba(32,14,22,.98));
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-shell {
      border-color: rgba(251,191,36,.18);
      background:
        radial-gradient(circle at top, rgba(251,191,36,.1), rgba(255,255,255,0) 46%),
        linear-gradient(180deg, rgba(30,27,75,.92), rgba(69,10,10,.34));
      box-shadow: 0 32px 100px rgba(0,0,0,.52), 0 0 90px rgba(251,113,133,.14), inset 0 1px 0 rgba(255,255,255,.08);
      animation-name: authDeleteSurge;
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-progress::before {
      background: linear-gradient(90deg, rgba(251,191,36,0), rgba(251,191,36,.92), rgba(251,113,133,.92), rgba(251,191,36,0));
      animation-duration: 1.05s;
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-spark {
      animation-duration: 1.15s;
      box-shadow: 0 0 18px rgba(251,191,36,.42);
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-orbit {
      animation: authDeleteOrbit .82s cubic-bezier(.21,.9,.24,1) both;
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-ring {
      animation-duration: 5.2s;
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-ring.ring-b {
      animation-duration: 3.2s;
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-ring.ring-c {
      animation-duration: 2.2s;
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-core {
      animation-duration: .92s;
    }
    .auth-transition-overlay[data-mode="logout"] .auth-transition-core {
      background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(125,211,252,.55) 46%, rgba(45,212,191,.24) 80%);
      box-shadow: 0 0 0 10px rgba(255,255,255,.04), 0 0 34px rgba(45,212,191,.22);
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-core {
      background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.96), rgba(251,146,60,.5) 40%, rgba(251,113,133,.4) 74%);
      box-shadow: 0 0 0 10px rgba(255,255,255,.04), 0 0 38px rgba(251,113,133,.22);
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-ring.ring-b {
      border-color: rgba(251,191,36,.22);
    }
    .auth-transition-overlay[data-mode="delete"] .auth-transition-ring.ring-c {
      border-color: rgba(251,113,133,.28);
    }
    @keyframes authRingSpin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }
    @keyframes authCorePulse {
      0%, 100% { transform: scale(.96); }
      50% { transform: scale(1.06); }
    }
    @keyframes authSparkFloat {
      0%, 100% { transform: translate3d(0,0,0) scale(.9); opacity: .45; }
      50% { transform: translate3d(0,-8px,0) scale(1.08); opacity: 1; }
    }
    @keyframes authProgressSweep {
      from { transform: translateX(-100%); }
      to { transform: translateX(100%); }
    }
    @keyframes authLoginLift {
      0% {
        opacity: 0;
        transform: translateY(18px) scale(.96);
        filter: blur(12px);
      }
      60% {
        opacity: 1;
        transform: translateY(-4px) scale(1.015);
        filter: blur(0);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
      }
    }
    @keyframes authOrbitBloom {
      0%, 100% { transform: translateY(0) scale(1); }
      50% { transform: translateY(-4px) scale(1.04); }
    }
    @keyframes authLogoutSettle {
      0% {
        opacity: 0;
        transform: translateY(-18px) scale(1.02);
        filter: blur(8px);
      }
      55% {
        opacity: 1;
        transform: translateY(3px) scale(.992);
        filter: blur(0);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
      }
    }
    @keyframes authDeleteSurge {
      0% {
        opacity: 0;
        transform: scale(.92);
        filter: blur(14px);
      }
      36% {
        opacity: 1;
        transform: scale(1.03);
        filter: blur(0);
      }
      62% {
        transform: scale(.985);
      }
      100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
      }
    }
    @keyframes authDeleteOrbit {
      0% { transform: scale(.72) rotate(-14deg); opacity: 0; }
      55% { transform: scale(1.06) rotate(4deg); opacity: 1; }
      100% { transform: scale(1) rotate(0deg); opacity: 1; }
    }
    @media (max-width: 768px) {
      .auth-transition-shell {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 24px 22px;
        text-align: center;
      }
      .auth-transition-sub {
        max-width: none;
      }
      .auth-transition-orbit {
        width: 118px;
        height: 118px;
      }
    }
    #mainApp.app-reveal-ready {
      opacity: 1;
      transform: none;
    }
    #mainApp.app-reveal-ready.is-entering {
      animation: mainAppReveal .58s cubic-bezier(.18,.84,.28,1) both;
    }
    @keyframes mainAppReveal {
      from {
        opacity: 0;
        transform: translateY(18px) scale(.985);
        filter: blur(10px);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
      }
    }
    @media (max-width: 768px) {
      .auth-redesign-card { padding: 20px; }
      .auth-provider-grid,
      .auth-simple-grid { grid-template-columns: 1fr; }
      .auth-link-card { grid-template-columns: 1fr; display:grid; }
      .auth-link-actions { justify-items: stretch; }
      .auth-link-status { max-width: none; }
      .auth-switch { width: 100%; justify-content: stretch; }
      .auth-switch button { flex: 1 1 0; min-width: 0; }
      .auth-side-grid { grid-template-columns: 1fr; }
      .auth-config-header,
      .auth-config-actions { justify-content: stretch; }
      .auth-config-actions .secondary-btn { width: 100%; }
    }

        .auth-offline-strip {
      margin-top: 14px;
      display: grid;
      grid-template-columns: 12px 1fr;
      gap: 12px;
      align-items: start;
      padding: 14px 16px;
      border-radius: 20px;
      background: linear-gradient(180deg, rgba(125,211,252,.08), rgba(255,255,255,.03));
      border: 1px solid rgba(125,211,252,.18);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    }
    .auth-offline-dot {
      width: 12px;
      height: 12px;
      border-radius: 999px;
      margin-top: 5px;
      background: linear-gradient(180deg, rgba(110,231,183,.95), rgba(14,165,233,.72));
      box-shadow: 0 0 0 6px rgba(14,165,233,.08);
      animation: authOfflinePulse 1.5s ease-in-out infinite;
    }
    .auth-offline-copy {
      display: grid;
      gap: 4px;
    }
    .auth-offline-title {
      font-size: 13px;
      font-weight: 900;
      color: rgba(255,255,255,.92);
      letter-spacing: .01em;
    }
    .auth-offline-text {
      font-size: 12px;
      line-height: 1.7;
      color: rgba(255,255,255,.66);
    }
    @keyframes authOfflinePulse {
      0%, 100% { transform: scale(1); opacity: .9; }
      50% { transform: scale(1.08); opacity: 1; }
    }
    @media (max-width: 640px) {
      .auth-offline-strip {
        padding: 12px 14px;
      }
    }
    .iphone-nav-shell {
      padding: 10px 14px calc(10px + var(--safe-bottom));
      background: linear-gradient(180deg, rgba(2,6,23,0), rgba(2,6,23,.52) 18%, rgba(2,6,23,.92) 70%, rgba(2,6,23,.98) 100%);
      backdrop-filter: blur(24px);
      border-top: 0;
      box-shadow: none;
    }
    .nav.nav-dock {
      max-width: 430px;
      gap: 8px;
      padding: 8px;
      border-radius: 28px;
      background: rgba(15,23,42,.86);
      border: 1px solid rgba(255,255,255,.06);
      box-shadow: 0 16px 40px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.05);
    }
    .nav.nav-dock button {
      min-height: 60px;
      padding: 6px;
      color: rgba(255,255,255,.48);
      border-radius: 20px;
      transform: none !important;
    }
    .nav.nav-dock button::before {
      inset: 4px;
      border-radius: 18px;
      background: transparent;
      border: 0;
      opacity: 1;
      box-shadow: none;
    }
    .nav.nav-dock button::after {
      display: none;
    }
    .nav.nav-dock button:hover {
      color: rgba(255,255,255,.68);
    }
    .nav.nav-dock button.active {
      color: #0f172a;
      border-color: transparent;
      box-shadow: none;
    }
    .nav.nav-dock button.active::before {
      background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.92));
      border: 1px solid rgba(255,255,255,.7);
      box-shadow: 0 10px 24px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.82);
    }
    .tab-icon {
      width: 40px;
      height: 40px;
      border-radius: 14px;
    }
    .tab-icon::before {
      background: transparent;
      opacity: 1;
    }
    .nav.nav-dock button.active .tab-icon {
      transform: translateY(-1px) scale(1.02);
    }
    .nav.nav-dock button.active .tab-icon::before {
      background: transparent;
      box-shadow: none;
    }
    .nav.nav-dock button.active .tab-icon svg {
      stroke: #0f172a;
      filter: none;
      fill: none;
    }
    .nav.nav-dock button:not(.active) .tab-icon svg {
      stroke: rgba(255,255,255,.62);
    }
    .top-profile-btn,
    .top-settings-link {
      border-color: rgba(255,255,255,.06);
      background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
      box-shadow: 0 12px 24px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.05);
    }
    .top-profile-btn.is-active,
    .top-settings-link.is-active {
      border-color: rgba(255,255,255,.14);
      box-shadow: 0 12px 28px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.08);
    }
    .dashboard-summary-panel,
    .dashboard-avatar-panel,
    .dashboard-insight-card {
      background: radial-gradient(circle at top, rgba(255,255,255,.085), rgba(255,255,255,0) 56%), linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.026));
      border: 1px solid rgba(255,255,255,.07);
      box-shadow: 0 18px 42px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.04);
    }
    .dashboard-summary-panel,
    .dashboard-avatar-panel {
      border-radius: 32px;
      padding: 24px;
    }
    .dashboard-summary-title {
      font-size: clamp(28px, 4vw, 40px);
      letter-spacing: -.04em;
    }
    .salary-donut {
      width: min(100%, 320px);
      padding: 16px;
      background: radial-gradient(circle at center, rgba(15,23,42,.14) 0 58%, transparent 58.5%), var(--salary-mix);
      box-shadow: 0 22px 48px rgba(0,0,0,.24), inset 0 0 36px rgba(255,255,255,.05);
    }
    .salary-donut::after {
      inset: 16px;
      background: linear-gradient(180deg, rgba(7,10,18,.98), rgba(13,18,32,.94));
      border: 1px solid rgba(255,255,255,.04);
    }
    .salary-donut-center {
      padding: 50px;
    }
    .salary-donut-value {
      font-size: clamp(30px, 4vw, 44px);
      letter-spacing: -.04em;
    }
    .salary-legend {
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .salary-legend-item {
      border-radius: 20px;
      padding: 14px 16px;
      background: rgba(255,255,255,.035);
    }
    .dashboard-insight-card {
      border-radius: 26px;
      padding: 18px;
    }
    .dashboard-insight-card.accent {
      background: radial-gradient(circle at top, rgba(253,224,71,.16), rgba(255,255,255,0) 56%), linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028));
    }
    .dashboard-avatar-panel {
      display: grid;
      gap: 18px;
    }
    .dashboard-avatar-open {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 16px 18px;
      border-radius: 24px;
      border: 1px solid rgba(255,255,255,.07);
      background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
      color: #fff;
      box-shadow: 0 14px 28px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.05);
    }
    .dashboard-avatar-open-copy {
      display: grid;
      justify-items: start;
      gap: 4px;
    }
    .dashboard-avatar-open-title {
      font-weight: 900;
      font-size: 15px;
    }
    .dashboard-avatar-open-sub {
      font-size: 12px;
      color: rgba(255,255,255,.58);
    }
    .dashboard-avatar-open-arrow {
      font-size: 20px;
      color: rgba(255,255,255,.55);
    }
    .avatar-picker-backdrop {
      position: fixed;
      inset: 0;
      z-index: 170;
      background: rgba(2,6,23,.76);
      backdrop-filter: blur(12px);
      display: grid;
      place-items: center;
      padding: 18px;
    }
    .avatar-picker-backdrop.hidden {
      display: none !important;
    }
    .avatar-picker-sheet {
      width: min(760px, 100%);
      max-height: min(86vh, 860px);
      overflow: auto;
      overscroll-behavior: contain;
      border-radius: 34px;
      padding: 20px;
      background: linear-gradient(180deg, rgba(8,12,22,.98), rgba(12,18,32,.96));
      border: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 28px 80px rgba(0,0,0,.4);
      display: grid;
      gap: 18px;
    }
    .avatar-picker-head {
      position: sticky;
      top: 0;
      z-index: 2;
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: flex-start;
      padding-bottom: 12px;
      background: linear-gradient(180deg, rgba(8,12,22,.98), rgba(8,12,22,.92) 72%, rgba(8,12,22,0));
    }
    .avatar-picker-title {
      font-size: 24px;
      font-weight: 900;
      letter-spacing: -.03em;
    }
    .avatar-picker-hint,
    .avatar-picker-current-sub {
      margin-top: 6px;
      font-size: 13px;
      line-height: 1.7;
      color: rgba(255,255,255,.62);
    }
    .avatar-picker-current {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px;
      border-radius: 24px;
      border: 1px solid rgba(255,255,255,.06);
      background: rgba(255,255,255,.035);
    }
    .top-profile-avatar.is-large {
      width: 68px;
      height: 68px;
      border-radius: 22px;
    }
    .avatar-picker-current-name {
      font-size: 22px;
      font-weight: 900;
    }
    .avatar-picker-grid {
      grid-template-columns: repeat(5, minmax(0,1fr));
      gap: 12px;
    }
    .avatar-picker-grid .pet-option {
      min-height: 72px;
      border-radius: 22px;
    }
    .avatar-picker-grid .pet-option.active {
      border-color: rgba(125,211,252,.34);
      box-shadow: 0 18px 30px rgba(56,189,248,.18), inset 0 1px 0 rgba(255,255,255,.08);
      transform: translateY(-1px);
    }
    .avatar-picker-grid .pet-option img {
      border-radius: 16px;
    }
    @media (max-width: 768px) {
      .nav.nav-dock {
        max-width: 100%;
      }
      .avatar-picker-head,
      .avatar-picker-current {
        display: grid;
        grid-template-columns: 1fr;
      }
    }
    @media (max-width: 430px) {
      .avatar-picker-grid,
      .salary-legend,
      .dashboard-insight-grid {
        grid-template-columns: 1fr;
      }
    }


body.avatar-picker-open {
  overflow: hidden;
}
.dashboard-avatar-open[aria-expanded="true"] {
  border-color: rgba(125,211,252,.34);
  box-shadow: 0 18px 34px rgba(56,189,248,.18), inset 0 1px 0 rgba(255,255,255,.08);
}
.dashboard-leave-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.028));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 34px rgba(0,0,0,.14);
  display: grid;
  gap: 14px;
}
.dashboard-leave-head {
  display: grid;
  gap: 6px;
}
.dashboard-leave-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.dashboard-leave-sub {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.62);
}
.dashboard-leave-analysis {
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,.8);
}
.dashboard-leave-usage-list {
  display: grid;
  gap: 12px;
}
.dashboard-leave-row {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.028);
}
.dashboard-leave-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.dashboard-leave-row-label {
  font-weight: 900;
  font-size: 14px;
}
.dashboard-leave-row-meta,
.dashboard-leave-row-sub {
  font-size: 12px;
  color: rgba(255,255,255,.58);
  line-height: 1.6;
}
.dashboard-leave-row-chip {
  min-width: 48px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 900;
}
.dashboard-leave-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.dashboard-leave-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #93c5fd, #c4b5fd);
}
.dashboard-leave-row.is-annual .dashboard-leave-progress-bar { background: linear-gradient(90deg, #60a5fa, #93c5fd); }
.dashboard-leave-row.is-vitality .dashboard-leave-progress-bar { background: linear-gradient(90deg, #34d399, #6ee7b7); }
.dashboard-leave-row.is-sick .dashboard-leave-progress-bar { background: linear-gradient(90deg, #fb7185, #fda4af); }
.dashboard-leave-row.is-personal .dashboard-leave-progress-bar { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.dashboard-leave-row.is-family .dashboard-leave-progress-bar { background: linear-gradient(90deg, #a78bfa, #c4b5fd); }
.calendar-summary-card.is-family-care {
  background: linear-gradient(180deg, rgba(167,139,250,.16), rgba(167,139,250,.06));
  border-color: rgba(167,139,250,.22);
}
@media (max-width: 768px) {
  .dashboard-leave-panel {
    padding: 16px;
    border-radius: 22px;
  }
}


/* 2026-04 polish: payroll drilldown, compact auth, theme */
.auth-side-compact-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.auth-side-hero-compact {
  flex: 1 1 auto;
}
.auth-config-card-compact {
  margin-top: 4px;
}
.auth-privacy-popover {
  position: relative;
  flex: 0 0 auto;
}
.auth-privacy-popover[open] {
  z-index: 4;
}
.auth-privacy-trigger {
  list-style: none;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0,0,0,.18);
  font-weight: 900;
}
.auth-privacy-trigger::-webkit-details-marker { display:none; }
.auth-privacy-flyout {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 60px));
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(10,14,24,.98), rgba(16,22,36,.95));
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 28px 60px rgba(0,0,0,.35);
}
.auth-privacy-list.compact {
  margin-top: 10px;
  gap: 8px;
}
.auth-privacy-list.compact .auth-privacy-item {
  padding: 8px 10px;
  border-radius: 14px;
  font-size: 12px;
}
.salary-legend-item {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.salary-legend-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.12);
}
.salary-legend-item.is-active {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
.salary-donut-detail-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.026));
  border: 1px solid rgba(255,255,255,.06);
  display: grid;
  gap: 8px;
}
.salary-donut-detail-kicker {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  font-weight: 800;
}
.salary-donut-detail-title {
  font-size: 18px;
  font-weight: 900;
}
.salary-donut-detail-sub {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.64);
}
.salary-donut-detail-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.salary-donut-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.05);
}
.salary-donut-detail-main {
  min-width: 0;
}
.salary-donut-detail-row-title {
  font-size: 13px;
  font-weight: 800;
}
.salary-donut-detail-row-sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,.58);
  line-height: 1.6;
}
.salary-donut-detail-row-value {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.avatar-picker-head {
  position: static;
  background: transparent;
}
.top-profile-btn {
  align-self: start;
}
html[data-theme="light"] body {
  background: radial-gradient(circle at top, #f7f7f8, #ececf0 48%, #dfdfe6);
  color: #111827;
}
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .record,
html[data-theme="light"] .metric,
html[data-theme="light"] .calendar-modal,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .dm-thread-card,
html[data-theme="light"] .dm-sidebar-card,
html[data-theme="light"] .storage-status,
html[data-theme="light"] .salary-donut-detail-card {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.82));
  color: #111827;
  border-color: rgba(15,23,42,.08);
  box-shadow: 0 18px 40px rgba(15,23,42,.08);
}
html[data-theme="light"] .muted,
html[data-theme="light"] .small,
html[data-theme="light"] .dashboard-insight-sub,
html[data-theme="light"] .salary-donut-sub,
html[data-theme="light"] .salary-donut-kicker,
html[data-theme="light"] .salary-donut-detail-sub,
html[data-theme="light"] .salary-donut-detail-kicker,
html[data-theme="light"] .dashboard-leave-row-sub,
html[data-theme="light"] .dashboard-avatar-sub {
  color: rgba(17,24,39,.62) !important;
}
html[data-theme="light"] .nav.nav-dock {
  background: rgba(255,255,255,.94);
  border-color: rgba(15,23,42,.08);
}
html[data-theme="light"] .nav.nav-dock button {
  color: rgba(17,24,39,.78);
}
html[data-theme="light"] .nav.nav-dock button.active {
  color: #111827;
}
html[data-theme="light"] .top-profile-avatar,
html[data-theme="light"] .dashboard-avatar-preview,
html[data-theme="light"] .dm-avatar {
  background: rgba(15,23,42,.08);
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #111827;
  border-color: rgba(15,23,42,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(249,250,251,.88));
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: rgba(17,24,39,.38);
}
html[data-theme="light"] .badge,
html[data-theme="light"] .pill-user,
html[data-theme="light"] .dm-badge,
html[data-theme="light"] .calendar-chip-btn,
html[data-theme="light"] .status-pill {
  color: #111827;
  background: rgba(15,23,42,.05);
  border-color: rgba(15,23,42,.08);
}
html[data-theme="light"] .salary-donut::after {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,247,250,.95));
  border-color: rgba(15,23,42,.08);
}
html[data-theme="light"] .salary-legend-item,
html[data-theme="light"] .salary-donut-detail-row {
  background: rgba(15,23,42,.03);
  border-color: rgba(15,23,42,.06);
}
@media (max-width: 768px) {
  .auth-side-compact-row {
    align-items: stretch;
  }
  .salary-donut-detail-card {
    border-radius: 20px;
  }
}

/* 2026-04-09: simplified IG / iPhone style refinements */
.iphone-nav-shell {
  background: linear-gradient(180deg, rgba(8,10,14,0.08), rgba(8,10,14,0.82) 26%, rgba(8,10,14,0.96) 100%);
  border-top: 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.16);
}
.nav.nav-dock {
  max-width: 420px;
  padding: 7px;
  gap: 6px;
  border-radius: 28px;
  background: rgba(15,15,18,.84);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
  backdrop-filter: blur(22px) saturate(120%);
}
.nav.nav-dock button {
  min-height: 58px;
  border-radius: 20px;
  color: rgba(255,255,255,.56);
  transform: none;
}
.nav.nav-dock button::before,
.nav.nav-dock button::after,
.tab-icon::before {
  box-shadow: none;
}
.nav.nav-dock button::before {
  inset: 4px;
  border-radius: 18px;
  background: transparent;
  border-color: transparent;
  opacity: 1;
}
.nav.nav-dock button::after {
  display: none;
}
.nav.nav-dock button:hover,
.nav.nav-dock button.active {
  transform: none;
}
.nav.nav-dock button.active {
  color: #fff;
  box-shadow: none;
  border-color: transparent;
}
.nav.nav-dock button.active::before {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.06);
}
.tab-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
}
.tab-icon svg {
  width: 23px;
  height: 23px;
  stroke-width: 2;
  filter: none;
}
.nav.nav-dock button.active .tab-icon {
  transform: none;
}
.nav.nav-dock button.active .tab-icon::before {
  opacity: 1;
  background: transparent;
}
.nav.nav-dock button.active .tab-icon svg {
  stroke: #ffffff;
  filter: none;
  transform: none;
}
.nav.nav-dock button:not(.active) .tab-icon svg {
  stroke: rgba(255,255,255,.6);
}
.top-profile-btn,
.top-settings-link {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.top-profile-avatar,
.dashboard-avatar-preview {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
}
.salary-donut-shell {
  padding: 10px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.06);
}
.salary-donut {
  box-shadow: inset 0 0 0 10px rgba(255,255,255,.03), 0 18px 36px rgba(0,0,0,.14);
}
.salary-donut-detail-card {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-color: rgba(255,255,255,.07);
}
html[data-theme="light"] .iphone-nav-shell {
  background: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.88) 34%, rgba(255,255,255,0.96) 100%);
  box-shadow: 0 -8px 28px rgba(15,23,42,.08);
}
html[data-theme="light"] .nav.nav-dock {
  background: rgba(255,255,255,.92);
  border-color: rgba(15,23,42,.08);
  box-shadow: 0 14px 36px rgba(15,23,42,.08);
}
html[data-theme="light"] .nav.nav-dock button {
  color: rgba(15,23,42,.48);
}
html[data-theme="light"] .nav.nav-dock button.active {
  color: #111827;
}
html[data-theme="light"] .nav.nav-dock button.active::before {
  background: rgba(17,24,39,.08);
  border-color: rgba(17,24,39,.06);
}
html[data-theme="light"] .nav.nav-dock button:not(.active) .tab-icon svg {
  stroke: rgba(17,24,39,.5);
}
html[data-theme="light"] .nav.nav-dock button.active .tab-icon svg {
  stroke: #111827;
}
html[data-theme="light"] .top-profile-btn,
html[data-theme="light"] .top-settings-link {
  background: rgba(255,255,255,.88);
  border-color: rgba(15,23,42,.08);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}


/* 2026-04 HR + iPhone polish */
.nav.nav-dock {
  background: linear-gradient(180deg, rgba(17,24,39,.92), rgba(17,24,39,.84));
  border-color: rgba(255,255,255,.06);
  box-shadow: 0 18px 40px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
}
.nav.nav-dock button.active {
  transform: translateY(-2px);
  box-shadow: none;
}
.nav.nav-dock button.active::before {
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.nav.nav-dock button.active::after {
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.92), rgba(255,255,255,0));
}
.nav.nav-dock button.active .tab-icon::before {
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.nav.nav-dock button.active .tab-icon svg {
  filter: none;
}
.salary-legend-item {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.salary-legend-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.12);
}
.salary-donut {
  cursor: pointer;
}
.top-profile-btn,
.dashboard-avatar-open {
  transform: none !important;
}
.avatar-picker-sheet {
  scrollbar-width: thin;
}
.calendar-chip-btn.active {
  border-color: rgba(255,255,255,.2);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
}
.dm-message-meta .status-pill.is-read {
  color: #ddd6fe;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(196,181,253,.12);
  border: 1px solid rgba(196,181,253,.2);
}
html[data-theme="light"] .nav.nav-dock {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.92));
  border-color: rgba(15,23,42,.08);
  box-shadow: 0 16px 36px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.75);
}
html[data-theme="light"] .nav.nav-dock button {
  color: rgba(17,24,39,.62);
}
html[data-theme="light"] .nav.nav-dock button.active {
  color: #111827;
}
html[data-theme="light"] .nav.nav-dock button.active::before {
  background: linear-gradient(180deg, rgba(15,23,42,.08), rgba(15,23,42,.03));
  border-color: rgba(15,23,42,.08);
}

.dashboard-summary-panel {
  position: relative;
  overflow: hidden;
}

.salary-donut {
  cursor: pointer;
}

.salary-donut-detail-card {
  position: absolute;
  top: 22px;
  right: 22px;
  width: min(360px, calc(100% - 44px));
  max-height: calc(100% - 44px);
  overflow: auto;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 20px));
  transition: transform .28s ease, opacity .22s ease;
  z-index: 5;
}

.salary-donut-detail-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.salary-donut-detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.salary-donut-detail-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  flex: 0 0 auto;
}

.salary-donut-detail-close:hover {
  background: rgba(255,255,255,.08);
}

.dashboard-summary-panel.salary-detail-open .salary-donut-shell,
.dashboard-summary-panel.salary-detail-open .salary-legend,
.dashboard-summary-panel.salary-detail-open .dashboard-summary-head {
  filter: blur(.5px);
}

html[data-theme="light"] .salary-donut-detail-close {
  color: #111827;
  background: rgba(17,24,39,.05);
  border-color: rgba(17,24,39,.12);
}

@media (max-width: 1100px) {
  .salary-donut-detail-card {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 16px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .salary-donut-detail-card:not(.is-open) {
    display: none;
  }

  .dashboard-summary-panel.salary-detail-open .salary-donut-shell,
  .dashboard-summary-panel.salary-detail-open .salary-legend,
  .dashboard-summary-panel.salary-detail-open .dashboard-summary-head {
    filter: none;
  }
}

.salary-donut-detail-card {
  background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(20,29,48,.96));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 22px 60px rgba(2,6,23,.38);
}

.salary-donut-detail-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.salary-donut-detail-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,.82);
}

.salary-donut-detail-row {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.06);
  padding: 14px 16px;
}

.salary-donut-detail-row + .salary-donut-detail-row {
  margin-top: 10px;
}

.salary-donut-detail-row-title {
  font-size: 14px;
  font-weight: 900;
  color: rgba(255,255,255,.96);
}

.salary-donut-detail-row-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,.6);
}

.salary-donut-detail-row-value {
  font-size: 14px;
  font-weight: 900;
  color: #f8fafc;
}

.calendar-chip-btn.active {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 42%, #fbcfe8 100%);
  color: #0f172a;
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 10px 26px rgba(2,6,23,.18);
}

.calendar-risk-detail {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  border: 1px solid rgba(255,255,255,.08);
}


/* 2026-04-10 stability + home salary */
.nav.nav-dock {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 380px;
}
.dashboard-home-salary-mount {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}
.dashboard-home-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.dashboard-home-summary-grid.is-tracker-only {
  grid-template-columns: 1fr;
}
.dashboard-home-summary-card {
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  box-shadow: 0 18px 38px rgba(2,6,23,.16);
  display: grid;
  gap: 14px;
  min-width: 0;
}
.dashboard-home-summary-card.is-wide {
  grid-column: 1 / -1;
}
.dashboard-home-summary-title {
  font-size: 18px;
  font-weight: 900;
}
.dashboard-home-summary-sub {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.62);
}
.dashboard-breakdown-list {
  display: grid;
  gap: 10px;
}
.dashboard-breakdown-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color: inherit;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.dashboard-breakdown-row:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 12px 24px rgba(2,6,23,.12);
}
.dashboard-breakdown-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.dashboard-breakdown-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255,255,255,.06);
}
.dashboard-breakdown-label {
  font-size: 14px;
  font-weight: 900;
}
.dashboard-breakdown-sub {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255,255,255,.52);
}
.dashboard-breakdown-value {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}
.dashboard-home-swipe {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.dashboard-home-swipe::-webkit-scrollbar {
  display: none;
}
.dashboard-home-swipe-card {
  min-height: 150px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  scroll-snap-align: start;
  display: grid;
  align-content: start;
  gap: 10px;
}
.dashboard-home-swipe-label {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.56);
}
.dashboard-home-swipe-value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}
.dashboard-home-swipe-sub {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.66);
}
.dashboard-home-swipe-hint {
  font-size: 12px;
  color: rgba(255,255,255,.5);
}
.dashboard-home-leave-list {
  display: grid;
  gap: 12px;
}
.dashboard-home-leave-row {
  display: grid;
  gap: 8px;
  padding: 14px 15px;
  border-radius: 22px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.06);
}
.dashboard-home-leave-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.dashboard-home-leave-label {
  font-size: 14px;
  font-weight: 900;
}
.dashboard-home-leave-sub,
.dashboard-home-leave-meta {
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255,255,255,.6);
}
.dashboard-home-leave-chip {
  flex: 0 0 auto;
  min-width: 48px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 900;
}
.dashboard-home-leave-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.dashboard-home-leave-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #93c5fd, #c4b5fd);
}
.dashboard-home-leave-row.is-annual .dashboard-home-leave-progress-bar { background: linear-gradient(90deg, #60a5fa, #93c5fd); }
.dashboard-home-leave-row.is-vitality .dashboard-home-leave-progress-bar { background: linear-gradient(90deg, #34d399, #6ee7b7); }
.dashboard-home-leave-row.is-sick .dashboard-home-leave-progress-bar { background: linear-gradient(90deg, #fb7185, #fda4af); }
.dashboard-home-leave-row.is-personal .dashboard-home-leave-progress-bar { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.dashboard-home-leave-row.is-family .dashboard-home-leave-progress-bar { background: linear-gradient(90deg, #a78bfa, #c4b5fd); }
.dashboard-home-salary {
  display: block !important;
}
.dashboard-home-salary > .list {
  display: grid;
  gap: 18px;
}
.dashboard-home-salary .two-col-half {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dashboard-home-salary .card.section {
  margin-top: 0;
}
@media (max-width: 1180px) {
  .dashboard-home-summary-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-home-salary .two-col-half {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .dashboard-home-swipe {
    grid-auto-columns: minmax(84%, 1fr);
  }
  .dashboard-home-salary .two-col-half {
    grid-template-columns: 1fr;
  }
}

html[data-theme="light"] body {
  background: radial-gradient(circle at top, #ffffff 0%, #f7f7f8 48%, #eef2f7 100%);
  color: #111827;
}
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .record,
html[data-theme="light"] .metric,
html[data-theme="light"] .flow,
html[data-theme="light"] .calendar-cell,
html[data-theme="light"] .calendar-stage,
html[data-theme="light"] .calendar-drawer,
html[data-theme="light"] .calendar-drawer-section,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .auth-primary-surface,
html[data-theme="light"] .auth-provider-surface,
html[data-theme="light"] .login-panel-surface,
html[data-theme="light"] .dm-sidebar-card,
html[data-theme="light"] .dm-thread-card {
  color: #111827;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,247,248,.92));
  border-color: rgba(15,23,42,.08);
  box-shadow: 0 14px 34px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.72);
}
html[data-theme="light"] .muted,
html[data-theme="light"] .small.muted,
html[data-theme="light"] .dashboard-insight-sub,
html[data-theme="light"] .calendar-summary-sub,
html[data-theme="light"] .calendar-risk-detail,
html[data-theme="light"] .calendar-modal-note,
html[data-theme="light"] .dm-mini-sub,
html[data-theme="light"] .dm-snippet,
html[data-theme="light"] .auth-soft-copy,
html[data-theme="light"] #headerDesc,
html[data-theme="light"] #homeSubHint {
  color: rgba(17,24,39,.58) !important;
}
html[data-theme="light"] .auth-overlay {
  background: rgba(243,244,246,.92);
}
html[data-theme="light"] .header,
html[data-theme="light"] .app-topbar,
html[data-theme="light"] .calendar-modal,
html[data-theme="light"] .salary-donut-detail-card,
html[data-theme="light"] .avatar-picker-sheet {
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(245,247,250,.94));
  border-color: rgba(15,23,42,.08);
  color: #111827;
}
html[data-theme="light"] .salary-donut-detail-row,
html[data-theme="light"] .salary-legend-item,
html[data-theme="light"] .calendar-summary-card,
html[data-theme="light"] .calendar-progress-card,
html[data-theme="light"] .calendar-analytics-card,
html[data-theme="light"] .calendar-risk-banner,
html[data-theme="light"] .dashboard-insight-card,
html[data-theme="light"] .dashboard-avatar-panel,
html[data-theme="light"] .dashboard-leave-panel,
html[data-theme="light"] .dashboard-home-summary-card,
html[data-theme="light"] .attendance-reward-card,
html[data-theme="light"] .pet-card,
html[data-theme="light"] .dm-item,
html[data-theme="light"] .dm-mini-card {
  background: linear-gradient(180deg, rgba(248,250,252,.98), rgba(243,244,246,.94));
  border-color: rgba(15,23,42,.08);
  color: #111827;
}
html[data-theme="light"] .salary-donut::after {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,247,249,.96));
}
html[data-theme="light"] .topbar-name,
html[data-theme="light"] .dashboard-summary-title,
html[data-theme="light"] .calendar-drawer-title,
html[data-theme="light"] .auth-title,
html[data-theme="light"] .pet-name,
html[data-theme="light"] .dm-name,
html[data-theme="light"] .dm-empty-title,
html[data-theme="light"] .salary-donut-value,
html[data-theme="light"] .metric .value {
  color: #111827;
}
html[data-theme="light"] .badge,
html[data-theme="light"] .pill-user,
html[data-theme="light"] .dm-badge,
html[data-theme="light"] .status-pill,
html[data-theme="light"] .calendar-chip-btn,
html[data-theme="light"] .holiday-chip {
  background: rgba(15,23,42,.05);
  border-color: rgba(15,23,42,.08);
  color: #111827;
}
html[data-theme="light"] .calendar-plus-btn,
html[data-theme="light"] .secondary-btn,
html[data-theme="light"] .ghost,
html[data-theme="light"] .top-settings-link,
html[data-theme="light"] .top-profile-btn {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(244,244,245,.92));
  border-color: rgba(15,23,42,.1);
  color: #111827;
}
html[data-theme="light"] .action-btn {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #ffffff;
  border-color: rgba(17,24,39,.12);
  box-shadow: 0 14px 24px rgba(15,23,42,.14);
}
html[data-theme="light"] .danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}
html[data-theme="light"] .calendar-modal-legal {
  background: rgba(127,29,29,.08);
  border-color: rgba(239,68,68,.16);
  color: #7f1d1d;
}

/* 2026-04-10 repair1 theme polish */
.nav.nav-dock {
  padding: 10px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(15,23,42,.86));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 42px rgba(2,6,23,.24), inset 0 1px 0 rgba(255,255,255,.04);
}
.nav.nav-dock .tab-btn {
  min-height: 62px;
}
.nav.nav-dock .tab-btn.active {
  box-shadow: 0 10px 26px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.82);
}
html[data-theme="light"] .nav.nav-dock {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(245,247,250,.94));
  border-color: rgba(15,23,42,.08);
  box-shadow: 0 16px 34px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.78);
}
html[data-theme="light"] .nav.nav-dock .tab-btn {
  color: rgba(17,24,39,.66);
  background: transparent;
  box-shadow: none;
}
html[data-theme="light"] .nav.nav-dock .tab-btn.active {
  background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(31,41,55,.94));
  color: #fff;
}
html[data-theme="light"] body,
html[data-theme="light"] .app,
html[data-theme="light"] .main,
html[data-theme="light"] .layout,
html[data-theme="light"] .section,
html[data-theme="light"] .dashboard-main,
html[data-theme="light"] .dashboard-side-stack,
html[data-theme="light"] .dashboard-summary-panel,
html[data-theme="light"] .dashboard-avatar-panel,
html[data-theme="light"] .dashboard-home-summary-card,
html[data-theme="light"] .calendar-shell,
html[data-theme="light"] .calendar-stage,
html[data-theme="light"] .calendar-modal,
html[data-theme="light"] .calendar-drawer,
html[data-theme="light"] .salary-donut-detail-card,
html[data-theme="light"] .avatar-picker-sheet,
html[data-theme="light"] .message-menu {
  color: #111827 !important;
}
html[data-theme="light"] .hero,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .header,
html[data-theme="light"] .dashboard-overview-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,246,248,.95)) !important;
  border-color: rgba(15,23,42,.08) !important;
  color: #111827 !important;
  box-shadow: 0 18px 38px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.86) !important;
}
html[data-theme="light"] .badge,
html[data-theme="light"] .pill-user,
html[data-theme="light"] .dashboard-insight-card,
html[data-theme="light"] .dashboard-leave-panel,
html[data-theme="light"] .dashboard-avatar-panel,
html[data-theme="light"] .dashboard-home-summary-card,
html[data-theme="light"] .attendance-record-toolbar-inner,
html[data-theme="light"] .record,
html[data-theme="light"] .dm-item,
html[data-theme="light"] .dm-mini-card,
html[data-theme="light"] .calendar-risk-detail,
html[data-theme="light"] .calendar-hr-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(243,244,246,.94)) !important;
  color: #111827 !important;
  border-color: rgba(15,23,42,.08) !important;
}
html[data-theme="light"] .salary-donut-detail-row,
html[data-theme="light"] .salary-donut-detail-pill,
html[data-theme="light"] .salary-legend-item,
html[data-theme="light"] .calendar-chip-btn,
html[data-theme="light"] .calendar-step-btn,
html[data-theme="light"] .calendar-time-card,
html[data-theme="light"] .calendar-date-card,
html[data-theme="light"] .calendar-risk-item,
html[data-theme="light"] .calendar-risk-history-item {
  background: linear-gradient(180deg, rgba(250,250,251,.98), rgba(242,244,246,.94)) !important;
  color: #111827 !important;
  border-color: rgba(15,23,42,.08) !important;
}
html[data-theme="light"] .salary-donut-detail-row-sub,
html[data-theme="light"] .calendar-risk-history .calendar-summary-sub,
html[data-theme="light"] .calendar-hr-sub,
html[data-theme="light"] .salary-donut-sub,
html[data-theme="light"] .dashboard-avatar-sub,
html[data-theme="light"] .dashboard-home-summary-sub,
html[data-theme="light"] .dashboard-insight-sub {
  color: rgba(17,24,39,.58) !important;
}
html[data-theme="light"] .salary-donut-detail-close,
html[data-theme="light"] .avatar-picker-close,
html[data-theme="light"] .calendar-drawer-close {
  background: rgba(17,24,39,.05) !important;
  color: #111827 !important;
  border-color: rgba(17,24,39,.12) !important;
}
html[data-theme="light"] .calendar-drawer-backdrop,
html[data-theme="light"] .calendar-modal-backdrop,
html[data-theme="light"] .avatar-picker-backdrop {
  background: rgba(15,23,42,.16) !important;
}
html[data-theme="light"] .salary-donut::after {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,247,249,.96)) !important;
}
html[data-theme="light"] .holiday-chip {
  background: rgba(15,23,42,.06) !important;
  color: #111827 !important;
}
html[data-theme="light"] .calendar-cell.is-holiday {
  background: linear-gradient(180deg, rgba(255,238,242,.96), rgba(255,245,247,.94)) !important;
  border-color: rgba(244,114,182,.22) !important;
}
html[data-theme="light"] .calendar-cell.type-rest_day,
html[data-theme="light"] .calendar-cell.type-national_holiday {
  box-shadow: 0 0 0 2px rgba(245,158,11,.22) inset !important;
}
html[data-theme="light"] .calendar-cell.type-sick_leave,
html[data-theme="light"] .calendar-cell.type-menstrual_leave,
html[data-theme="light"] .calendar-cell.type-personal_leave,
html[data-theme="light"] .calendar-cell.type-family_care_leave,
html[data-theme="light"] .calendar-cell.type-annual_leave,
html[data-theme="light"] .calendar-cell.type-vitality_leave {
  box-shadow: 0 0 0 2px rgba(59,130,246,.12) inset !important;
}
.avatar-template-item {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 12px 10px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.avatar-template-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 12px 24px rgba(2,6,23,.14);
}
.avatar-template-item.is-active {
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 14px 28px rgba(2,6,23,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.04));
}
.avatar-template-thumb {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}
.avatar-template-thumb img,
.avatar-template-thumb .pet-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-template-name {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}
html[data-theme="light"] .avatar-template-item {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(243,244,246,.94));
  border-color: rgba(15,23,42,.08);
  color: #111827;
}
html[data-theme="light"] .dashboard-home-summary-row,
html[data-theme="light"] .dashboard-breakdown-row,
html[data-theme="light"] .dashboard-home-metric-card {
  background: linear-gradient(180deg, rgba(250,250,251,.98), rgba(242,244,246,.94));
  border-color: rgba(15,23,42,.08);
  color: #111827;
}
html[data-theme="light"] .dashboard-breakdown-sub,
html[data-theme="light"] .dashboard-home-metric-label,
html[data-theme="light"] .dashboard-home-summary-sub {
  color: rgba(17,24,39,.58);
}
html[data-theme="light"] .avatar-template-item.is-active {
  background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(31,41,55,.94));
  color: #ffffff;
}
html[data-theme="light"] .avatar-template-thumb {
  background: rgba(15,23,42,.06);
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #111827;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,247,249,.96));
  border-color: rgba(15,23,42,.10);
  box-shadow: 0 12px 28px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.75);
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: rgba(17,24,39,.38);
}
html[data-theme="light"] .calendar-cell,
html[data-theme="light"] .weekday {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(243,244,246,.92));
}
html[data-theme="light"] .calendar-cell.today {
  box-shadow: 0 0 0 2px rgba(251,191,36,.72) inset;
}

/* 2026-04-10 repair1 stronger light inputs */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #111827 !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,247,249,.96)) !important;
  border-color: rgba(15,23,42,.10) !important;
  box-shadow: 0 12px 28px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.75) !important;
}

/* 2026-04-10 repair3 core UX cleanup */
#petArea {
  display: none !important;
}

.dashboard-summary-panel {
  overflow: visible;
}

body.salary-sheet-open {
  overflow: hidden;
}

#todayMotivation:empty {
  display: none !important;
}

.salary-donut-detail-card {
  position: fixed;
  left: 50%;
  right: auto;
  top: auto;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(560px, calc(100vw - 24px));
  max-height: min(72vh, 720px);
  overflow: auto;
  margin-top: 0;
  border-radius: 30px 30px 22px 22px;
  padding: 18px 18px 22px;
  transform: translate(-50%, 26px);
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  box-shadow: 0 30px 80px rgba(2,6,23,.46);
}

.salary-donut-detail-card::before {
  content: '';
  display: block;
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  margin: 0 auto 14px;
}

.salary-donut-detail-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.salary-donut-detail-top {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 12px;
  background: inherit;
}

.salary-donut-detail-list {
  padding-bottom: 8px;
}

.calendar-modal {
  width: min(760px, calc(100vw - 24px));
  max-height: min(88vh, 900px);
  overflow: auto;
  border-radius: 34px;
}

.calendar-modal .row {
  align-items: center;
}

.calendar-modal-note,
.calendar-modal-legal {
  border-radius: 18px;
}

.calendar-modal-body {
  gap: 18px;
}

.calendar-modal-section {
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.052), rgba(255,255,255,.024));
}

.calendar-leave-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calendar-chip-btn {
  min-height: 48px;
  border-radius: 18px;
}

.calendar-time-card,
.calendar-date-card {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
}

.calendar-modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 14px;
  background: linear-gradient(180deg, rgba(15,23,42,0), rgba(15,23,42,.9) 26%, rgba(15,23,42,.98) 100%);
}

html[data-theme="light"] .salary-donut-detail-card {
  box-shadow: 0 24px 50px rgba(15,23,42,.14);
}

html[data-theme="light"] .salary-donut-detail-card::before {
  background: rgba(15,23,42,.14);
}

html[data-theme="light"] .calendar-modal-actions {
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.92) 28%, rgba(245,247,250,.98) 100%);
}

@media (max-width: 1100px) {
  .salary-donut-detail-card {
    width: min(640px, calc(100vw - 16px));
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 768px) {
  .calendar-leave-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .salary-donut-detail-card {
    width: calc(100vw - 12px);
    max-height: 78vh;
    border-radius: 28px 28px 18px 18px;
  }
}

@media (max-width: 480px) {
  .calendar-leave-grid {
    grid-template-columns: 1fr;
  }
}


/* 2026-04-10 repair6 ux consistency */
html[data-theme="light"],
html[data-theme="light"] body {
  background: linear-gradient(180deg, #fbfbfc 0%, #f2f3f5 100%) !important;
  color: #111111 !important;
}
html[data-theme="light"] body,
html[data-theme="light"] .app,
html[data-theme="light"] .main,
html[data-theme="light"] .header,
html[data-theme="light"] .section,
html[data-theme="light"] .metric,
html[data-theme="light"] .record,
html[data-theme="light"] .panel,
html[data-theme="light"] .flow,
html[data-theme="light"] .setting,
html[data-theme="light"] .calendar-cell,
html[data-theme="light"] .dm-thread-card,
html[data-theme="light"] .dm-sidebar-card,
html[data-theme="light"] .message-menu,
html[data-theme="light"] .calendar-drawer,
html[data-theme="light"] .calendar-modal,
html[data-theme="light"] .salary-donut-detail-card,
html[data-theme="light"] .card,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .login-panel-surface,
html[data-theme="light"] .storage-status,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .weekday,
html[data-theme="light"] .calendar-summary-card,
html[data-theme="light"] .calendar-analytics-card,
html[data-theme="light"] .calendar-progress-card,
html[data-theme="light"] .dashboard-insight-card,
html[data-theme="light"] .dashboard-leave-panel,
html[data-theme="light"] .dashboard-avatar-panel,
html[data-theme="light"] .attendance-reward-card,
html[data-theme="light"] .toast { color:#111111 !important; }
html[data-theme="light"] .card,
html[data-theme="light"] .metric,
html[data-theme="light"] .record,
html[data-theme="light"] .panel,
html[data-theme="light"] .flow,
html[data-theme="light"] .setting,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .calendar-drawer,
html[data-theme="light"] .calendar-modal,
html[data-theme="light"] .salary-donut-detail-card,
html[data-theme="light"] .dashboard-insight-card,
html[data-theme="light"] .dashboard-leave-panel,
html[data-theme="light"] .dashboard-avatar-panel,
html[data-theme="light"] .attendance-reward-card,
html[data-theme="light"] .calendar-summary-card,
html[data-theme="light"] .calendar-analytics-card,
html[data-theme="light"] .calendar-progress-card,
html[data-theme="light"] .storage-status,
html[data-theme="light"] .message-menu,
html[data-theme="light"] .dm-thread-card,
html[data-theme="light"] .dm-sidebar-card {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,248,249,.94)) !important;
  border-color: rgba(17,17,17,.08) !important;
  box-shadow: 0 20px 40px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.7) !important;
}
html[data-theme="light"] .muted,
html[data-theme="light"] .small.muted,
html[data-theme="light"] .dashboard-insight-sub,
html[data-theme="light"] .calendar-summary-sub,
html[data-theme="light"] .dm-mini-sub,
html[data-theme="light"] .dm-snippet,
html[data-theme="light"] .calendar-modal-note,
html[data-theme="light"] .calendar-modal-legal,
html[data-theme="light"] #headerDesc,
html[data-theme="light"] #homeSubHint { color: rgba(17,17,17,.58) !important; }
html[data-theme="light"] .hero,
html[data-theme="light"] .auth-side-hero {
  color:#111111 !important;
  background: linear-gradient(135deg, #ffffff 0%, #f7f7f8 58%, #ededee 100%) !important;
  border:1px solid rgba(17,17,17,.08);
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .dm-compose-row,
html[data-theme="light"] .calendar-time-card,
html[data-theme="light"] .calendar-date-card,
html[data-theme="light"] .dm-search-mini input {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,247,248,.96)) !important;
  color:#111111 !important;
  border-color: rgba(17,17,17,.10) !important;
  box-shadow: 0 10px 24px rgba(15,23,42,.05), inset 0 1px 0 rgba(255,255,255,.9) !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: rgba(17,17,17,.38) !important; }
html[data-theme="light"] .secondary-btn,
html[data-theme="light"] .ghost,
html[data-theme="light"] .toggle,
html[data-theme="light"] .nav button,
html[data-theme="light"] .dm-mini-btn,
html[data-theme="light"] .message-menu-btn,
html[data-theme="light"] .dm-back-btn {
  color:#111111 !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,245,247,.94)) !important;
  border-color: rgba(17,17,17,.10) !important;
}
html[data-theme="light"] .badge,
html[data-theme="light"] .pill-user,
html[data-theme="light"] .dm-badge,
html[data-theme="light"] .holiday-chip,
html[data-theme="light"] .salary-donut-detail-pill,
html[data-theme="light"] .attendance-record-chip {
  color:#111111 !important;
  background: rgba(17,17,17,.06) !important;
}
html[data-theme="light"] .dm-item,
html[data-theme="light"] .dm-mini-card,
html[data-theme="light"] .message-forward-item,
html[data-theme="light"] .salary-donut-detail-row,
html[data-theme="light"] .calendar-risk-detail,
html[data-theme="light"] .calendar-hr-card,
html[data-theme="light"] .attendance-record-toolbar-inner {
  background: rgba(255,255,255,.9) !important;
  color:#111111 !important;
  border-color: rgba(17,17,17,.08) !important;
}
html[data-theme="light"] .attendance-punch-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,248,249,.94)) !important;
  border-color: rgba(17,17,17,.08) !important;
  box-shadow: 0 20px 40px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.7) !important;
}
html[data-theme="light"] .attendance-punch-visual {
  background: linear-gradient(180deg, rgba(226,232,240,.95), rgba(203,213,225,.85)) !important;
  border-color: rgba(17,17,17,.08) !important;
}
html[data-theme="light"] .attendance-punch-visual.is-clocked-in {
  background: linear-gradient(180deg, rgba(187,247,208,.98), rgba(134,239,172,.88)) !important;
}
html[data-theme="light"] .attendance-punch-visual.is-clocked-out {
  background: linear-gradient(180deg, rgba(254,202,202,.98), rgba(252,165,165,.88)) !important;
}
html[data-theme="light"] .attendance-punch-icon,
html[data-theme="light"] .attendance-punch-state {
  color:#111111 !important;
}
html[data-theme="light"] .dm-bubble.them { color:#111111 !important; background: linear-gradient(180deg, #ffffff, #f4f5f7) !important; }
html[data-theme="light"] .dm-bubble.me { color:#111111 !important; background: linear-gradient(135deg, #f1f5ff, #edf3ff) !important; }
html[data-theme="light"] .auth-transition-shell { background: rgba(255,255,255,.96) !important; color:#111111 !important; }
.attendance-punch-panel { margin-top:18px; padding:22px; border-radius:28px; border:1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); box-shadow: 0 20px 40px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.05); display:grid; justify-items:center; gap:16px; text-align:center; }
.attendance-punch-visual { width:136px; height:136px; border-radius:50%; display:grid; place-items:center; background: linear-gradient(180deg, rgba(148,163,184,.24), rgba(71,85,105,.18)); border:1px solid rgba(255,255,255,.08); box-shadow: 0 18px 30px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.06); }
.attendance-punch-visual.is-clocked-in { background: linear-gradient(180deg, rgba(34,197,94,.34), rgba(22,163,74,.22)); border-color: rgba(134,239,172,.22); }
.attendance-punch-visual.is-clocked-out { background: linear-gradient(180deg, rgba(239,68,68,.34), rgba(220,38,38,.22)); border-color: rgba(252,165,165,.24); }
.attendance-punch-icon { font-size:54px; line-height:1; font-weight:900; color:#f8fafc; }
.attendance-punch-copy { display:grid; gap:8px; max-width:420px; }
.attendance-punch-label { font-size:13px; font-weight:900; letter-spacing:.06em; text-transform:uppercase; color: rgba(255,255,255,.52); }
.attendance-punch-state { font-size:30px; font-weight:900; line-height:1.1; }
.attendance-punch-hint { font-size:14px; line-height:1.8; }
.attendance-punch-actions { grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; }
.attendance-record-toolbar { margin-bottom: 14px; }
.attendance-record-toolbar-inner { display:grid; gap:14px; padding:16px; border-radius:24px; border:1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); }
.attendance-record-headline { font-size:13px; line-height:1.6; color: rgba(255,255,255,.64); }
.attendance-record-summary { display:flex; gap:10px; flex-wrap:wrap; }
.attendance-record-chip { display:inline-flex; align-items:center; gap:8px; padding:10px 14px; border-radius:999px; background:rgba(255,255,255,.06); font-size:12px; }
.attendance-record-chip span { opacity:.6; }
.attendance-record-chip strong { font-size:13px; }
.attendance-record-controls { display:flex; gap:10px; align-items:center; }
.attendance-record-select { min-height:46px !important; border-radius:16px !important; }
.attendance-record-nav { width:42px; height:42px; border-radius:14px; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.06); color:inherit; cursor:pointer; }
.settings-advanced-details { margin-top:18px; border-radius:28px; border:1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); overflow:hidden; }
.settings-advanced-summary { list-style:none; cursor:pointer; padding:18px 20px; display:grid; gap:6px; font-weight:900; }
.settings-advanced-summary::-webkit-details-marker { display:none; }
.settings-advanced-summary-sub { font-size:13px; font-weight:600; opacity:.65; }
.settings-advanced-grid { display:grid; gap:12px; padding:0 18px 18px; }
.calendar-hr-card { padding:16px; border-radius:22px; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); border:1px solid rgba(255,255,255,.08); }
.calendar-hr-card.secondary { background: linear-gradient(180deg, rgba(251,191,36,.10), rgba(255,255,255,.02)); }
.calendar-hr-title { font-size:12px; font-weight:900; letter-spacing:.04em; text-transform:uppercase; opacity:.68; }
.calendar-hr-value { margin-top:8px; font-size:18px; font-weight:900; }
.calendar-hr-sub { margin-top:8px; font-size:13px; line-height:1.7; opacity:.72; }
@media (max-width: 768px) {
  .attendance-record-toolbar-inner { padding:14px; border-radius:20px; }
  .attendance-record-controls { display:grid; grid-template-columns:42px 1fr 42px; }
  .attendance-punch-panel { padding:18px; border-radius:22px; }
  .attendance-punch-visual { width:112px; height:112px; }
  .attendance-punch-icon { font-size:42px; }
  .attendance-punch-state { font-size:24px; }
  .attendance-punch-actions { grid-template-columns: 1fr; }
}



html[data-theme="light"] .dashboard-home-swipe-card,
html[data-theme="light"] .dashboard-home-leave-row,
html[data-theme="light"] .calendar-inline-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,246,248,.94)) !important;
  border-color: rgba(15,23,42,.08) !important;
  color: #111827 !important;
}
html[data-theme="light"] .dashboard-home-swipe-label,
html[data-theme="light"] .dashboard-home-swipe-sub,
html[data-theme="light"] .dashboard-home-swipe-hint,
html[data-theme="light"] .dashboard-home-leave-sub,
html[data-theme="light"] .dashboard-home-leave-meta,
html[data-theme="light"] .calendar-drawer-copy,
html[data-theme="light"] .calendar-compact-note {
  color: rgba(17,24,39,.62) !important;
}
html[data-theme="light"] .dashboard-home-leave-chip {
  background: rgba(15,23,42,.06) !important;
}

/* 2026-04-12: HR supplement + PWA sheet polish */
.salary-donut-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 198;
  background: rgba(2,6,23,.42);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.salary-donut-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.salary-donut-detail-card {
  z-index: 199;
}
.calendar-modal-status-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.calendar-modal-status-card {
  padding: 15px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.calendar-modal-status-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.58);
}
.calendar-modal-status-value {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 900;
}
.calendar-modal-status-sub {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.72);
}
.calendar-modal-note,
.calendar-modal-legal {
  max-width: 72ch;
}
.calendar-simple-select,
.calendar-simple-time-input {
  width: 100%;
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  color: #fff;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.calendar-simple-select option {
  color: #111827;
}
.calendar-simple-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.calendar-modal-section.compact {
  padding-top: 12px;
  padding-bottom: 12px;
}
.calendar-time-mini {
  font-size: 12px;
  opacity: .62;
}
.calendar-modal-actions {
  position: sticky;
  bottom: 0;
  padding-top: 14px;
  background: linear-gradient(180deg, rgba(10,15,30,0) 0%, rgba(10,15,30,.82) 38%, rgba(10,15,30,.96) 100%);
  backdrop-filter: blur(12px);
}
html[data-theme="light"] .calendar-modal-actions {
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.88) 38%, rgba(255,255,255,.98) 100%);
}
html[data-theme="light"] .calendar-simple-select,
html[data-theme="light"] .calendar-simple-time-input {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(243,244,246,.94));
  border-color: rgba(15,23,42,.08);
  color: #111827;
}
@media (max-width: 768px) {
  .calendar-modal-status-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .calendar-simple-time-grid {
    grid-template-columns: 1fr;
  }
  .calendar-modal-status-card {
    padding: 13px 14px;
    border-radius: 18px;
  }
  .calendar-modal-status-value {
    font-size: 18px;
  }
  .calendar-modal {
    width: min(100vw - 16px, 560px);
    border-radius: 24px;
  }
  .calendar-modal-body {
    gap: 12px;
  }
  .calendar-modal-section {
    padding: 12px;
    border-radius: 18px;
  }
  .calendar-time-card,
  .calendar-date-card,
  .calendar-hr-card {
    border-radius: 18px;
  }
}
.pwa-status-grid {
  display: grid;
  gap: 12px;
}
html[data-theme="light"] .salary-donut-sheet-backdrop,
html[data-theme="light"] .calendar-modal-backdrop {
  background: rgba(15,23,42,.16) !important;
}
html[data-theme="light"] .calendar-modal-status-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(243,244,246,.94));
  border-color: rgba(15,23,42,.08);
  color: #111827;
}
html[data-theme="light"] .calendar-modal-status-label {
  color: rgba(17,24,39,.52);
}

/* 2026-04-18 iPhone native-like salary bottom sheet */
.salary-donut-sheet-backdrop {
  background:
    linear-gradient(180deg, rgba(2,6,23,.08), rgba(2,6,23,.44) 28%, rgba(2,6,23,.62) 100%);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  transition: opacity .26s ease;
}
.salary-donut-detail-card {
  left: 50%;
  right: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  width: min(560px, calc(100vw - 16px));
  max-height: min(78vh, 760px);
  border-radius: 30px 30px 24px 24px;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(18,24,38,.98), rgba(11,16,27,.98) 42%, rgba(8,12,22,.99) 100%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow:
    0 32px 80px rgba(2,6,23,.52),
    inset 0 1px 0 rgba(255,255,255,.06);
  transform: translate(-50%, 34px) scale(.985);
  transition: transform .32s cubic-bezier(.22,1,.36,1), opacity .22s ease;
  overscroll-behavior: contain;
}
.salary-donut-detail-card::before {
  width: 46px;
  height: 5px;
  margin: 0 auto 12px;
  background: rgba(255,255,255,.24);
}
.salary-donut-detail-handle-area {
  height: 20px;
  margin: -6px auto 4px;
  touch-action: none;
}
.salary-donut-detail-card.is-open {
  transform: translate(-50%, 0) scale(1);
}
.salary-donut-detail-top {
  position: sticky;
  top: -2px;
  z-index: 2;
  margin: -4px -2px 4px;
  padding: 2px 2px 14px;
  background: linear-gradient(180deg, rgba(10,14,24,.98), rgba(10,14,24,.92) 72%, rgba(10,14,24,0));
}
.salary-donut-detail-kicker {
  letter-spacing: .12em;
  font-size: 11px;
}
.salary-donut-detail-title {
  font-size: 22px;
  line-height: 1.15;
}
.salary-donut-detail-sub {
  font-size: 13px;
  line-height: 1.65;
}
.salary-donut-detail-close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  font-size: 15px;
  line-height: 1;
}
.salary-donut-detail-close:hover {
  background: rgba(255,255,255,.12);
}
.salary-donut-detail-summary {
  position: sticky;
  top: 68px;
  z-index: 1;
  padding: 2px 0 10px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(9,13,23,.96), rgba(9,13,23,.84) 78%, rgba(9,13,23,0));
}
.salary-donut-detail-pill {
  padding: 8px 12px;
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.08);
}
.salary-donut-detail-list {
  display: grid;
  gap: 12px;
  padding-bottom: 4px;
}
.salary-donut-accordion {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  overflow: hidden;
}
.salary-donut-accordion[open] {
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  border-color: rgba(255,255,255,.08);
}
.salary-donut-detail-row {
  align-items: center;
  padding: 13px 14px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.salary-donut-detail-row::-webkit-details-marker { display:none; }
.salary-donut-detail-row-title {
  font-size: 14px;
}
.salary-donut-detail-row-sub {
  font-size: 12px;
  line-height: 1.55;
}
.salary-donut-detail-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.salary-donut-detail-row-value {
  font-size: 14px;
  font-weight: 900;
}
.salary-donut-detail-chevron {
  font-size: 14px;
  color: rgba(255,255,255,.56);
  transition: transform .2s ease;
}
.salary-donut-accordion[open] .salary-donut-detail-chevron {
  transform: rotate(180deg);
}
.salary-donut-accordion-body {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}
.salary-donut-accordion-note,
.salary-donut-accordion-meta {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,.7);
}
.salary-donut-accordion-meta {
  color: rgba(255,255,255,.54);
}
html[data-theme="light"] .salary-donut-detail-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(245,247,250,.98) 54%, rgba(239,242,247,.98) 100%);
  border-color: rgba(15,23,42,.08);
  box-shadow:
    0 28px 64px rgba(15,23,42,.18),
    inset 0 1px 0 rgba(255,255,255,.9);
}
html[data-theme="light"] .salary-donut-detail-top,
html[data-theme="light"] .salary-donut-detail-summary {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.86) 72%, rgba(255,255,255,0));
}
html[data-theme="light"] .salary-donut-detail-close {
  background: rgba(17,24,39,.05);
  border-color: rgba(17,24,39,.08);
  color: #111827;
}
html[data-theme="light"] .salary-donut-detail-pill,
html[data-theme="light"] .salary-donut-detail-row,
html[data-theme="light"] .salary-donut-accordion {
  background: rgba(17,24,39,.035);
  border-color: rgba(17,24,39,.06);
}
html[data-theme="light"] .salary-donut-accordion-meta,
html[data-theme="light"] .salary-donut-accordion-note,
html[data-theme="light"] .salary-donut-detail-chevron {
  color: rgba(17,24,39,.58);
}
@media (max-width: 768px) {
  .salary-donut-detail-card {
    width: calc(100vw - 8px);
    bottom: 0;
    max-height: min(82vh, 760px);
    border-radius: 28px 28px 0 0;
    padding: 16px 16px calc(22px + env(safe-area-inset-bottom));
  }
  .salary-donut-detail-card::before {
    margin-bottom: 10px;
  }
  .salary-donut-detail-top {
    margin: -2px 0 2px;
    padding-bottom: 12px;
  }
  .salary-donut-detail-title {
    font-size: 20px;
  }
  .salary-donut-detail-summary {
    top: 62px;
  }
  .salary-donut-detail-row {
    padding: 12px 13px;
  }
  .salary-donut-accordion-body {
    padding: 0 13px 13px;
  }
}
html[data-theme="light"] .calendar-modal-status-sub {
  color: rgba(17,24,39,.68);
}
@media (max-width: 768px) {
  .calendar-modal-status-grid {
    grid-template-columns: 1fr;
  }
  .salary-donut-detail-card {
    width: calc(100vw - 12px);
  }
}
html[data-theme="light"] .dashboard-home-leave-progress {
  background: rgba(15,23,42,.08) !important;
}


/* Calendar events refresh */
.calendar-event-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.calendar-event-summary-card {
  padding: 14px;
  border-radius: 22px;
  min-width: 0;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.10), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 28px rgba(0,0,0,.14);
  display: grid;
  gap: 6px;
}
.calendar-event-list {
  display: grid;
  gap: 14px;
}
.calendar-event-group {
  display: grid;
  gap: 10px;
}
.calendar-event-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.calendar-event-group-list {
  display: grid;
  gap: 10px;
}
.calendar-event-card {
  padding: 16px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.075), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 14px 30px rgba(0,0,0,.12);
  display: grid;
  gap: 12px;
}
.calendar-event-card-head,
.calendar-event-head-actions,
.calendar-event-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.calendar-event-title {
  font-size: 15px;
  font-weight: 900;
  color: rgba(255,255,255,.96);
}
.calendar-event-meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,.58);
}
.calendar-event-note {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255,255,255,.78);
}
.calendar-event-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .01em;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.84);
}
.calendar-event-chip.is-work { background: rgba(96,165,250,.14); color: #bfdbfe; border-color: rgba(96,165,250,.22); }
.calendar-event-chip.is-personal { background: rgba(244,114,182,.14); color: #fbcfe8; border-color: rgba(244,114,182,.22); }
.calendar-event-chip.is-deadline { background: rgba(251,146,60,.14); color: #fed7aa; border-color: rgba(251,146,60,.24); }
.calendar-event-chip.is-memo { background: rgba(45,212,191,.14); color: #99f6e4; border-color: rgba(45,212,191,.22); }
.calendar-event-chip.is-reminder { background: rgba(129,140,248,.14); color: #c7d2fe; border-color: rgba(129,140,248,.22); }
.calendar-event-chip.is-time { background: rgba(148,163,184,.14); color: #cbd5e1; border-color: rgba(148,163,184,.22); }
.calendar-event-chip.is-view { background: rgba(255,255,255,.06); color: rgba(255,255,255,.70); }
.calendar-event-delete {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(248,113,113,.18);
  background: linear-gradient(180deg, rgba(248,113,113,.14), rgba(248,113,113,.08));
  color: #fecaca;
  cursor: pointer;
  font-weight: 900;
}
.calendar-event-delete:hover {
  transform: translateY(-1px);
  border-color: rgba(248,113,113,.28);
}
.calendar-event-empty {
  padding: 18px;
  border-radius: 24px;
  border: 1px dashed rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.68);
  font-size: 13px;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .calendar-event-summary-grid {
    grid-template-columns: 1fr;
  }
}

html[data-theme="light"] .calendar-event-summary-card,
html[data-theme="light"] .calendar-event-card,
html[data-theme="light"] .calendar-event-empty {
  background:
    radial-gradient(circle at top, rgba(15,23,42,.05), rgba(255,255,255,0) 54%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.9));
  border-color: rgba(15,23,42,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 14px 28px rgba(15,23,42,.06);
}
html[data-theme="light"] .calendar-event-title {
  color: rgba(15,23,42,.92);
}
html[data-theme="light"] .calendar-event-meta,
html[data-theme="light"] .calendar-event-note,
html[data-theme="light"] .calendar-event-empty {
  color: rgba(17,24,39,.68);
}
.calendar-memo-basic-grid {
  grid-template-columns: 1fr 1fr;
}
.calendar-advanced-details {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  overflow: hidden;
}
.calendar-advanced-details summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  color: rgba(255,255,255,.84);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.calendar-advanced-details summary::-webkit-details-marker {
  display: none;
}
.calendar-advanced-details summary::after {
  content: '▾';
  color: rgba(255,255,255,.58);
  transition: transform .2s ease;
}
.calendar-advanced-details[open] summary::after {
  transform: rotate(180deg);
}
.calendar-advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}
@media (max-width: 768px) {
  .calendar-memo-basic-grid,
  .calendar-advanced-grid {
    grid-template-columns: 1fr;
  }
  .calendar-advanced-details summary {
    padding: 13px 14px;
  }
  .calendar-advanced-grid {
    padding: 0 14px 14px;
  }
}
html[data-theme="light"] .calendar-advanced-details {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.92));
  border-color: rgba(15,23,42,.08);
}
html[data-theme="light"] .calendar-advanced-details summary {
  color: rgba(17,24,39,.84);
}
html[data-theme="light"] .calendar-advanced-details summary::after {
  color: rgba(17,24,39,.42);
}
html[data-theme="light"] .calendar-event-chip {
  background: rgba(15,23,42,.04);
  border-color: rgba(15,23,42,.08);
  color: rgba(15,23,42,.78);
}
html[data-theme="light"] .calendar-event-delete {
  background: rgba(248,113,113,.10);
  color: rgba(185,28,28,.88);
  border-color: rgba(248,113,113,.22);
}

/* Final mobile calendar override: keep a full 7-column month grid on iPhone */
@media (max-width: 768px) {
  #calendar .calendar-main-section {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 8px 10px 0 !important;
  }
  #calendar .simple-calendar-shell {
    gap: 8px;
  }
  #calendar .calendar-head {
    display: block;
    padding: 0 2px;
  }
  #calendar .calendar-toolbar {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap !important;
  }
  #calendar .calendar-toolbar .badge {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    min-height: 46px;
  }
  #calendar .calendar-stage.is-main-calendar {
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    width: 100%;
    max-width: 100vw;
    overflow: visible !important;
  }
  #calendar #calendarSmallLabel,
  #calendar #calendarTitle,
  #calendar #calendarModeHint,
  #calendar #calendarLegend,
  #calendar #calendarCompactNote {
    display: none !important;
  }
  body.calendar-focus-mode .app {
    max-width: none !important;
    width: 100vw;
    margin: 0;
    padding: 0 !important;
  }
  body.calendar-focus-mode .layout,
  body.calendar-focus-mode .main {
    min-height: 100vh;
    gap: 0 !important;
  }
  body.calendar-focus-mode .main {
    padding-bottom: calc(var(--phone-nav-h) + var(--safe-bottom) + 8px) !important;
  }
  body.calendar-focus-mode .app-topbar {
    display: none !important;
  }
  body.calendar-focus-mode .header {
    display: none !important;
  }
  body.calendar-focus-mode #calendar {
    margin-top: 0;
    padding: 0 !important;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  body.calendar-focus-mode #calendar .calendar-main-section {
    padding: 8px 10px 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100%;
    max-width: 100vw;
    margin: 0;
  }
  body.calendar-focus-mode #calendar .simple-calendar-shell {
    gap: 8px;
  }
  body.calendar-focus-mode #calendar .calendar-head {
    display: block;
    padding: 0 2px;
  }
  body.calendar-focus-mode #calendar .calendar-toolbar {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap !important;
  }
  body.calendar-focus-mode #calendar .calendar-toolbar .badge {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    min-height: 46px;
  }
  body.calendar-focus-mode #calendar .calendar-stage.is-main-calendar {
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    width: 100%;
    max-width: 100vw;
    overflow: visible !important;
  }
  body.calendar-focus-mode #calendar .calendar-legend,
  body.calendar-focus-mode #calendar #calendarCompactNote,
  body.calendar-focus-mode #calendar #calendarSmallLabel,
  body.calendar-focus-mode #calendar #calendarTitle,
  body.calendar-focus-mode #calendar #calendarModeHint {
    display: none !important;
  }
  .calendar-main-section {
    padding: 18px !important;
  }
  .calendar-shell {
    gap: 14px;
  }
  .calendar-stage,
  .calendar-stage.is-main-calendar {
    padding: 12px !important;
    border-radius: 22px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 4px !important;
    min-width: 100%;
  }
  .weekday,
  .calendar-cell,
  .simple-calendar-shell .weekday,
  .simple-calendar-shell .calendar-cell {
    min-height: 78px !important;
    padding: 7px !important;
    border-radius: 14px !important;
  }
  .weekday {
    font-size: 11px;
    letter-spacing: 0;
  }
  .calendar-topline {
    gap: 4px;
  }
  .calendar-day-num {
    font-size: 13px;
  }
  .holiday-chip {
    margin-top: 4px;
    padding: 3px 6px;
    font-size: 9px;
  }
  .calendar-status,
  .calendar-income {
    margin-top: 4px;
    font-size: 9px;
    line-height: 1.28;
    letter-spacing: 0;
  }
}

@media (max-width: 430px) {
  #calendar .calendar-main-section {
    padding: 6px 8px 0 !important;
  }
  body.calendar-focus-mode .app {
    width: 100vw;
  }
  body.calendar-focus-mode #calendar .calendar-main-section {
    padding: 6px 8px 0 !important;
  }
  body.calendar-focus-mode #calendar {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  body.calendar-focus-mode #calendar .calendar-toolbar {
    gap: 6px;
  }
  body.calendar-focus-mode #calendar .calendar-toolbar .badge {
    min-width: 0;
    padding-inline: 10px;
    font-size: 12px;
  }
  .calendar-stage,
  .calendar-stage.is-main-calendar {
    padding: 10px !important;
    border-radius: 20px !important;
  }
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 3px !important;
  }
  .weekday,
  .calendar-cell,
  .simple-calendar-shell .weekday,
  .simple-calendar-shell .calendar-cell {
    min-height: 70px !important;
    padding: 5px !important;
    border-radius: 12px !important;
  }
  .weekday {
    font-size: 10px;
  }
  .calendar-day-num {
    font-size: 11px;
  }
  .calendar-status,
  .calendar-income,
  .holiday-chip {
    font-size: 8px;
  }
}

/* 2026-04-18 mobile calendar final pass */
.calendar-month-strip {
  display: flex;
  align-items: center;
  min-width: 0;
}
.calendar-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.calendar-month-chip {
  min-width: 168px;
  justify-content: center;
}
.calendar-icon-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 18px;
  font-size: 24px;
  line-height: 1;
}
.calendar-inline-shared-btn {
  min-width: 128px;
}
.calendar-compact-line {
  display: none;
}
.calendar-fullscreen-shell {
  width: 100%;
  padding: 20px 22px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

@media (max-width: 768px) {
  #calendar,
  body.calendar-focus-mode #calendar {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding: 0 !important;
  }
  #calendar .calendar-main-section,
  body.calendar-focus-mode #calendar .calendar-main-section {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 8px 0 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  #calendar .simple-calendar-shell,
  body.calendar-focus-mode #calendar .simple-calendar-shell {
    gap: 12px !important;
  }
  #calendar .calendar-head,
  body.calendar-focus-mode #calendar .calendar-head {
    display: block !important;
    padding: 0 14px !important;
  }
  #calendar .calendar-toolbar,
  body.calendar-focus-mode #calendar .calendar-toolbar {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
  }
  #calendar .calendar-month-strip,
  body.calendar-focus-mode #calendar .calendar-month-strip {
    min-width: 0;
  }
  #calendar .calendar-month-chip,
  body.calendar-focus-mode #calendar .calendar-month-chip {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 46px !important;
    padding: 0 !important;
    justify-content: flex-start !important;
    text-align: left !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
    font-size: 28px !important;
    font-weight: 900 !important;
    letter-spacing: -.03em;
  }
  #calendar .calendar-toolbar-actions,
  body.calendar-focus-mode #calendar .calendar-toolbar-actions {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
    justify-content: end;
    gap: 8px;
    margin-left: 0;
  }
  #calendar .calendar-icon-btn,
  body.calendar-focus-mode #calendar .calendar-icon-btn {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    border-radius: 999px !important;
    padding: 0 !important;
    font-size: 20px !important;
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: none !important;
  }
  html[data-theme="light"] #calendar .calendar-icon-btn,
  html[data-theme="light"] body.calendar-focus-mode #calendar .calendar-icon-btn {
    background: rgba(17,24,39,.05) !important;
    border-color: rgba(17,24,39,.08) !important;
  }
  #calendar #closeSharedViewBtn,
  body.calendar-focus-mode #calendar #closeSharedViewBtn {
    display: none !important;
  }
  #calendar #calendarHubOpenBtn,
  body.calendar-focus-mode #calendar #calendarHubOpenBtn {
    position: fixed !important;
    right: 18px !important;
    bottom: calc(var(--phone-nav-h) + var(--safe-bottom) + 18px) !important;
    width: 58px !important;
    min-width: 58px !important;
    height: 58px !important;
    border-radius: 999px !important;
    font-size: 34px !important;
    line-height: 1 !important;
    padding: 0 !important;
    z-index: 40 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,.28) !important;
  }
  #calendar .calendar-stage.is-main-calendar,
  body.calendar-focus-mode #calendar .calendar-stage.is-main-calendar {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 6px 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    min-height: calc(100vh - 220px);
  }
  #calendar .calendar-grid,
  body.calendar-focus-mode #calendar .calendar-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 100% !important;
    align-items: stretch !important;
  }
  #calendar .calendar-weekdays-row,
  #calendar .calendar-days-grid,
  body.calendar-focus-mode #calendar .calendar-weekdays-row,
  body.calendar-focus-mode #calendar .calendar-days-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    column-gap: 2px !important;
    width: 100% !important;
    min-width: 100% !important;
  }
  #calendar .calendar-days-grid,
  body.calendar-focus-mode #calendar .calendar-days-grid {
    row-gap: 4px !important;
  }
  #calendar .calendar-weekdays-row,
  body.calendar-focus-mode #calendar .calendar-weekdays-row {
    margin-bottom: 6px !important;
  }
  #calendar .weekday,
  #calendar .calendar-cell,
  #calendar .simple-calendar-shell .weekday,
  #calendar .simple-calendar-shell .calendar-cell,
  body.calendar-focus-mode #calendar .weekday,
  body.calendar-focus-mode #calendar .calendar-cell,
  body.calendar-focus-mode #calendar .simple-calendar-shell .weekday,
  body.calendar-focus-mode #calendar .simple-calendar-shell .calendar-cell {
    padding: 4px 3px !important;
  }
  #calendar .weekday,
  body.calendar-focus-mode #calendar .weekday {
    display: grid;
    place-items: center;
    width: 100% !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-size: 10px !important;
    font-weight: 700;
    letter-spacing: 0 !important;
    color: rgba(255,255,255,.45) !important;
    margin: 0 !important;
  }
  #calendar .weekday.is-sunday,
  body.calendar-focus-mode #calendar .weekday.is-sunday {
    color: #fca5a5 !important;
  }
  #calendar .weekday.is-saturday,
  body.calendar-focus-mode #calendar .weekday.is-saturday {
    color: #93c5fd !important;
  }
  html[data-theme="light"] #calendar .weekday,
  html[data-theme="light"] body.calendar-focus-mode #calendar .weekday {
    color: rgba(17,24,39,.42) !important;
  }
  #calendar .calendar-cell,
  #calendar .simple-calendar-shell .calendar-cell,
  body.calendar-focus-mode #calendar .calendar-cell,
  body.calendar-focus-mode #calendar .simple-calendar-shell .calendar-cell {
    height: 94px !important;
    min-height: 94px !important;
    max-height: 94px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    border-radius: 0 !important;
    min-width: 0 !important;
  }
  #calendar .calendar-cell.empty,
  body.calendar-focus-mode #calendar .calendar-cell.empty {
    opacity: .24;
    min-height: 94px !important;
  }
  #calendar .calendar-cell-content,
  body.calendar-focus-mode #calendar .calendar-cell-content {
    height: 100%;
    display: grid !important;
    grid-template-rows: 20px 1fr 18px;
    gap: 2px !important;
    overflow: hidden;
    align-items: stretch !important;
  }
  #calendar .calendar-topline,
  body.calendar-focus-mode #calendar .calendar-topline {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    min-height: 20px !important;
    width: 100% !important;
  }
  #calendar .calendar-day-num,
  body.calendar-focus-mode #calendar .calendar-day-num {
    display: block;
    width: 100%;
    text-align: left !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    margin-bottom: 0;
    font-weight: 800;
  }
  #calendar .calendar-day-num.is-sunday,
  body.calendar-focus-mode #calendar .calendar-day-num.is-sunday {
    color: #fca5a5 !important;
  }
  #calendar .calendar-day-num.is-saturday,
  body.calendar-focus-mode #calendar .calendar-day-num.is-saturday {
    color: #93c5fd !important;
  }
  #calendar .calendar-status,
  body.calendar-focus-mode #calendar .calendar-status {
    display: none !important;
  }
  #calendar .calendar-income,
  body.calendar-focus-mode #calendar .calendar-income {
    display: none !important;
  }
  #calendar .holiday-chip,
  body.calendar-focus-mode #calendar .holiday-chip {
    display: none !important;
  }
  #calendar .calendar-compact-line,
  body.calendar-focus-mode #calendar .calendar-compact-line {
    display: block !important;
    align-self: end;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-height: 15px;
    padding: 2px 5px !important;
    border-radius: 6px;
    font-size: 8px !important;
    line-height: 1.15 !important;
    font-weight: 800;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.08);
  }
  html[data-theme="light"] #calendar .calendar-compact-line,
  html[data-theme="light"] body.calendar-focus-mode #calendar .calendar-compact-line {
    color: rgba(17,24,39,.78);
    background: rgba(17,24,39,.08);
  }
  #calendar .calendar-compact-line.is-holiday,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-holiday {
    background: rgba(239,68,68,.24);
    color: #fee2e2;
  }
  #calendar .calendar-compact-line.is-observed,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-observed {
    background: rgba(59,130,246,.24);
    color: #dbeafe;
  }
  #calendar .calendar-compact-line.is-national,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-national {
    background: rgba(245,158,11,.24);
    color: #fde68a;
  }
  #calendar .calendar-compact-line.is-event,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-event {
    background: rgba(59,130,246,.26);
    color: #dbeafe;
  }
  #calendar .calendar-compact-line.is-sick_leave,
  #calendar .calendar-compact-line.is-menstrual_leave,
  #calendar .calendar-compact-line.is-personal_leave,
  #calendar .calendar-compact-line.is-family_care_leave,
  #calendar .calendar-compact-line.is-annual_leave,
  #calendar .calendar-compact-line.is-vitality_leave,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-sick_leave,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-menstrual_leave,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-personal_leave,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-family_care_leave,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-annual_leave,
  body.calendar-focus-mode #calendar .calendar-compact-line.is-vitality_leave {
    background: rgba(16,185,129,.22);
    color: #d1fae5;
  }
  #calendar .calendar-cell.today,
  body.calendar-focus-mode #calendar .calendar-cell.today {
    background: rgba(255,255,255,.04) !important;
    border-radius: 16px !important;
  }
  #calendar .calendar-cell.is-holiday,
  #calendar .calendar-cell.type-rest_day,
  #calendar .calendar-cell.type-national_holiday,
  #calendar .calendar-cell.type-sick_leave,
  #calendar .calendar-cell.type-menstrual_leave,
  #calendar .calendar-cell.type-annual_leave,
  #calendar .calendar-cell.type-vitality_leave,
  #calendar .calendar-cell.type-personal_leave,
  #calendar .calendar-cell.type-family_care_leave,
  body.calendar-focus-mode #calendar .calendar-cell.is-holiday,
  body.calendar-focus-mode #calendar .calendar-cell.type-rest_day,
  body.calendar-focus-mode #calendar .calendar-cell.type-national_holiday,
  body.calendar-focus-mode #calendar .calendar-cell.type-sick_leave,
  body.calendar-focus-mode #calendar .calendar-cell.type-menstrual_leave,
  body.calendar-focus-mode #calendar .calendar-cell.type-annual_leave,
  body.calendar-focus-mode #calendar .calendar-cell.type-vitality_leave,
  body.calendar-focus-mode #calendar .calendar-cell.type-personal_leave,
  body.calendar-focus-mode #calendar .calendar-cell.type-family_care_leave {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
  }
  html[data-theme="light"] #calendar .calendar-cell.today,
  html[data-theme="light"] body.calendar-focus-mode #calendar .calendar-cell.today {
    background: rgba(17,24,39,.05) !important;
  }
}

@media (max-width: 768px) {
  #mainApp .main {
    touch-action: pan-y pinch-zoom;
    overscroll-behavior-x: contain;
  }
  body.calendar-focus-mode .main {
    display: block !important;
    padding-bottom: calc(var(--phone-nav-h) + var(--safe-bottom) + 20px) !important;
  }
  body.calendar-focus-mode #calendar.tab-panel {
    display: block !important;
    visibility: visible !important;
    min-height: calc(100vh - var(--phone-nav-h) - var(--safe-bottom));
  }
}
.attendance-success-overlay{
  position:fixed;
  left:0;
  right:0;
  bottom:calc(var(--phone-nav-h) + var(--safe-bottom) + 10px);
  display:flex;
  justify-content:center;
  padding:0 14px;
  z-index:1800;
  opacity:0;
  pointer-events:none;
  transform:translateY(14px);
  transition:opacity .22s ease, transform .22s ease;
}

.attendance-success-overlay.hidden{
  display:none;
}

.attendance-success-overlay.is-visible{
  opacity:1;
  transform:translateY(0);
}

.attendance-success-card{
  width:min(380px, calc(100vw - 28px));
  border-radius:24px;
  padding:14px 16px 15px;
  display:block;
  background:linear-gradient(180deg, rgba(24,24,27,.94), rgba(17,17,19,.9));
  color:#fff;
  border:1px solid rgba(255,255,255,.11);
  box-shadow:0 18px 40px rgba(15,23,42,.22);
  backdrop-filter:blur(18px);
}

.attendance-success-kicker{
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(255,255,255,.46);
}

.attendance-success-title{
  margin-top:4px;
  font-size:16px;
  font-weight:900;
  line-height:1.2;
}

.attendance-success-sub{
  margin-top:5px;
  font-size:12px;
  color:rgba(255,255,255,.68);
  line-height:1.35;
}

body.theme-light .attendance-success-overlay{
  background:none;
}

body.theme-light .attendance-success-card{
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,247,248,.92));
  color:#0f172a;
  border-color:rgba(15,23,42,.08);
  box-shadow:0 18px 34px rgba(15,23,42,.12);
}

body.theme-light .attendance-success-sub{
  color:rgba(15,23,42,.62);
}

body.theme-light .attendance-success-kicker{
  color:rgba(15,23,42,.44);
}

/* iPhone / Instagram-style auth screen */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.auth-overlay.auth-iphone-login {
  position: fixed;
  inset: 0;
  z-index: 900;
  min-height: 100svh;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #f2f3f5;
  color: #262626;
}
.auth-overlay.auth-iphone-login.hidden { display: none !important; }
.auth-phone-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100svh;
  background: #fff;
  color: #262626;
  display: flex;
  flex-direction: column;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Inter, sans-serif;
  box-shadow: 0 26px 80px rgba(15, 23, 42, .13);
}
.auth-ios-statusbar {
  height: 32px;
  padding: 10px 24px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  color: #111;
  flex: 0 0 auto;
}
.auth-ios-icons {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #111;
}
.auth-ios-icons svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}
.auth-ios-icons svg:last-child {
  width: 28px;
  fill: currentColor;
}
.auth-privacy-corner {
  position: absolute;
  top: 46px;
  left: 18px;
  z-index: 4;
}
.auth-privacy-ig .auth-privacy-trigger {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f7f7f7;
  border: 1px solid #dbdbdb;
  color: #262626;
  box-shadow: none;
  font-size: 15px;
}
.auth-privacy-ig .auth-privacy-flyout {
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: min(310px, calc(100vw - 32px));
  background: rgba(255,255,255,.98);
  color: #262626;
  border: 1px solid #dbdbdb;
  box-shadow: 0 18px 50px rgba(15,23,42,.15);
}
.auth-privacy-ig .auth-privacy-title { color: #111; }
.auth-privacy-ig .auth-privacy-item {
  background: #fafafa;
  color: #555;
  border: 1px solid #efefef;
}
.auth-language-row {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 28px;
  color: #8e8e8e;
  font-size: 13px;
}
.auth-language-select,
html[data-theme="light"] .auth-language-select {
  width: auto !important;
  min-height: auto !important;
  height: 24px !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #8e8e8e !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
}
.auth-phone-body,
.auth-redesign-card.auth-phone-body,
html[data-theme="light"] .auth-phone-body {
  flex: 1 1 auto;
  width: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
  padding: 64px 40px 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
  color: #262626 !important;
}
.auth-hidden-copy { display: none !important; }
.auth-script-logo {
  margin: 0 0 44px;
  text-align: center;
  font-family: "Segoe Script", "Brush Script MT", "Dancing Script", "Pacifico", cursive;
  font-size: clamp(44px, 12vw, 56px);
  line-height: .95;
  font-weight: 400;
  letter-spacing: .2px;
  color: #050505;
  user-select: none;
}
.auth-phone-body .auth-error {
  margin: -18px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(237,73,86,.24);
  background: rgba(237,73,86,.08);
  color: #c13545;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: none;
}
.auth-offline-compact {
  display: none;
  margin: -20px 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid #efefef;
  color: #737373;
  box-shadow: none;
}
.auth-mode-panel,
.auth-mode-panel .auth-form-shell,
.auth-mode-panel .auth-primary-surface {
  width: 100%;
}
.auth-mode-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.auth-mode-panel.hidden { display: none !important; }
.auth-ig-surface,
html[data-theme="light"] .auth-ig-surface {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.auth-ig-surface .auth-section-kicker,
.auth-ig-surface .auth-soft-copy {
  display: none;
}
.auth-ig-inputs {
  display: grid;
  gap: 7px !important;
  margin-top: 0 !important;
}
.auth-ig-field,
.field.auth-ig-field {
  position: relative;
  margin: 0 !important;
  gap: 0 !important;
}
.auth-ig-field input,
.auth-ig-field input:not([type='hidden']):not([type='file']),
html[data-theme="light"] .auth-ig-field input {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 5px !important;
  border: 1px solid #dbdbdb !important;
  background: #fafafa !important;
  color: #262626 !important;
  padding: 0 12px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  font-size: 12px !important;
  line-height: 44px !important;
  transform: none !important;
}
.auth-ig-field input::placeholder,
html[data-theme="light"] .auth-ig-field input::placeholder {
  color: #8e8e8e !important;
}
.auth-ig-field input:focus,
.auth-ig-field input:hover,
html[data-theme="light"] .auth-ig-field input:focus {
  border-color: #a8a8a8 !important;
  background: #fff !important;
  box-shadow: none !important;
  transform: none !important;
}
.auth-password-field input { padding-right: 62px !important; }
.auth-show-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #262626;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 0;
  cursor: pointer;
}
.auth-submit-wrap {
  margin-top: 12px !important;
  padding: 0 !important;
  background: transparent !important;
}
.auth-ig-primary,
.action-btn.auth-ig-primary,
html[data-theme="light"] .action-btn.auth-ig-primary {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 5px !important;
  border: 0 !important;
  background: #0095f6 !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}
.auth-ig-primary:hover { background: #1877f2 !important; transform: none !important; }
.auth-ig-primary:active { transform: scale(.99) !important; }
.auth-forgot-row {
  margin-top: 23px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}
.auth-muted-text { color: #8e8e8e; }
.auth-text-link,
.auth-bottom-switch button {
  border: 0;
  background: transparent;
  color: #0095f6;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}
.auth-text-link {
  color: #262626;
  margin-left: 4px;
  font-size: 12px;
}
.auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 24px 0 18px;
  color: #8e8e8e;
}
.auth-divider span {
  flex: 1 1 0;
  height: 1px;
  background: #dbdbdb;
}
.auth-divider b {
  font-size: 13px;
  font-weight: 800;
}
.auth-test-account,
html[data-theme="light"] .auth-test-account {
  color: #8e8e8e !important;
  text-align: center;
  font-size: 12px !important;
  margin-top: 0 !important;
}
.auth-bottom-switch {
  width: calc(100% + 80px);
  margin: auto -40px 0;
  min-height: 70px;
  border-top: 1px solid #dbdbdb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #262626;
  font-size: 12px;
}
.auth-bottom-switch button {
  font-size: 12px;
}
.auth-home-indicator {
  width: 134px;
  height: 5px;
  border-radius: 999px;
  background: #000;
  margin: 0 auto max(8px, env(safe-area-inset-bottom));
  flex: 0 0 auto;
}
@media (min-width: 680px) {
  .auth-overlay.auth-iphone-login { padding: 24px; }
  .auth-phone-shell {
    min-height: min(860px, calc(100svh - 48px));
    border-radius: 38px;
    overflow: hidden;
  }
}
@media (max-width: 430px) {
  .auth-phone-shell {
    width: 100%;
    min-height: 100svh;
    box-shadow: none;
  }
  .auth-phone-body,
  .auth-redesign-card.auth-phone-body {
    padding: 64px 38px 0 !important;
  }
  .auth-bottom-switch {
    width: calc(100% + 76px);
    margin-left: -38px;
    margin-right: -38px;
  }
}
@media (max-width: 360px) {
  .auth-phone-body,
  .auth-redesign-card.auth-phone-body { padding-left: 26px !important; padding-right: 26px !important; }
  .auth-bottom-switch { width: calc(100% + 52px); margin-left: -26px; margin-right: -26px; }
  .auth-script-logo { font-size: 42px; }
}

/* IG / iPhone inspired direct messages */
#friends {
  color: #262626;
}
#friends > .card.section {
  background: #fff;
  border-color: rgba(219,219,219,.9);
  box-shadow: 0 18px 54px rgba(15,23,42,.12);
  padding: 0;
  overflow: hidden;
}
#friends .dm-shell {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 0;
  min-height: min(760px, 78vh);
  height: min(760px, 78vh);
  background: #fff;
}
#friends .dm-sidebar-card,
#friends .dm-thread-card {
  border-radius: 0;
  border: 0;
  background: #fff;
  box-shadow: none;
  color: #262626;
}
#friends .dm-sidebar-card {
  border-right: 1px solid #dbdbdb;
  padding: 16px 0 0;
  grid-template-rows: auto auto auto 1fr;
}
#friends .dm-sidebar-card > div:first-child {
  padding: 0 16px 8px;
}
#friends .dm-sidebar-card .muted,
#friends .dm-thread-card .muted {
  color: #8e8e8e !important;
}
#friends .dm-sidebar-summary {
  padding: 0 16px 8px;
  justify-content: flex-start;
}
#friends .dm-sidebar-chip {
  background: #f5f5f5;
  color: #262626;
  border: 0;
  box-shadow: none;
  min-height: 30px;
  font-size: 12px;
}
#friends .dm-sidebar-chip.soft {
  color: #8e8e8e;
}
#friends .dm-search-mini {
  padding: 8px 16px 10px;
}
#friends .dm-search-mini input,
#friends .dm-search-mini input:not([type='hidden']):not([type='file']) {
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 11px !important;
  background: #efefef !important;
  color: #262626 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 14px !important;
  font-size: 14px !important;
}
#friends .dm-search-mini input::placeholder {
  color: #8e8e8e !important;
}
#friends .dm-search-actions {
  padding: 0 16px;
}
#friends #incomingFriendRequestWrap,
#friends #friendSearchResultWrap {
  margin-bottom: 8px;
}
#friends #incomingFriendRequestTitle,
#friends #friendSearchResultTitle {
  color: #8e8e8e !important;
  font-weight: 800;
  padding-left: 2px;
}
#friends .dm-request-list,
#friends .dm-search-result-list {
  gap: 6px;
  margin-top: 8px;
}
#friends .dm-mini-card {
  background: #fafafa;
  border: 1px solid #efefef;
  border-radius: 14px;
  color: #262626;
}
#friends .dm-mini-sub {
  color: #8e8e8e;
}
#friends .dm-mini-btn {
  background: #efefef;
  color: #262626;
  border: 0;
  height: 34px;
  box-shadow: none;
}
#friends .dm-mini-btn.primary {
  background: #0095f6;
  color: #fff;
}
#friends .dm-list {
  gap: 0;
  padding: 4px 0 12px;
}
#friends .dm-item {
  position: relative;
  min-height: 72px;
  padding: 9px 16px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  gap: 12px;
  transform: none !important;
}
#friends .dm-item:hover,
#friends .dm-item.active {
  background: #fafafa;
  border: 0;
  box-shadow: none;
}
#friends .dm-item.has-unread {
  background: linear-gradient(90deg, rgba(0,149,246,.08), rgba(255,255,255,0) 58%);
}
#friends .dm-avatar {
  width: 56px;
  height: 56px;
  color: #fff;
  background: linear-gradient(135deg, #f58529, #dd2a7b 52%, #8134af);
  font-size: 18px;
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px #dbdbdb;
}
#friends .dm-unread-spark {
  position: absolute;
  right: -1px;
  bottom: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #0095f6;
  border: 2px solid #fff;
  box-shadow: 0 0 0 5px rgba(0,149,246,.08);
}
#friends .dm-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0095f6;
  flex: 0 0 auto;
}
#friends .dm-camera-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #262626;
  opacity: .62;
  font-size: 16px;
}
#friends .dm-name {
  font-size: 14px;
  font-weight: 800;
  color: #262626;
}
#friends .dm-time {
  color: #8e8e8e;
  font-size: 11px;
}
#friends .dm-time.unread,
#friends .dm-snippet.unread {
  color: #262626;
  font-weight: 800;
}
#friends .dm-snippet {
  margin-top: 3px;
  color: #8e8e8e;
  font-size: 13px;
}
#friends .dm-list-filler,
#friends .empty-state {
  margin: 10px 16px;
  border: 0;
  background: #fafafa;
  color: #8e8e8e;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.6;
  padding: 14px;
}
#friends .dm-thread-card {
  padding: 0;
  min-width: 0;
}
#friends .dm-thread-card.compact {
  padding: 0;
}
#friends .dm-empty {
  height: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #8e8e8e;
}
#friends .dm-empty-title {
  color: #262626;
  font-weight: 900;
  font-size: 18px;
}
#friends .dm-empty-sub {
  max-width: 360px;
  margin: 8px auto 0;
  color: #8e8e8e;
  font-size: 13px;
  line-height: 1.7;
}
#friends .dm-thread-panel {
  height: 100%;
  gap: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
#friends .dm-thread-top {
  min-height: 62px;
  padding: 8px 14px;
  border-bottom: 1px solid #dbdbdb;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}
#friends .dm-thread-user {
  flex: 1 1 auto;
}
#friends .dm-thread-user .dm-avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px #dbdbdb;
}
#friends .dm-thread-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
#friends .dm-icon-btn,
#friends .dm-back-btn,
#friends .dm-compose-icon {
  border: 0;
  background: transparent;
  color: #262626;
  box-shadow: none;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#friends .dm-icon-btn {
  width: 30px;
  height: 30px;
}
#friends .dm-back-btn {
  width: 32px;
  height: 38px;
  border-radius: 0;
}
#friends .dm-icon-btn svg,
#friends .dm-back-btn svg,
#friends .dm-compose-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#friends #friendThreadName {
  font-size: 15px !important;
  line-height: 1.15;
  color: #262626;
}
#friends #friendThreadStatus {
  margin-top: 2px !important;
  font-size: 11px !important;
}
#friends .dm-badge {
  display: none;
}
#friends .dm-thread-messages {
  gap: 7px;
  padding: 16px 14px 18px;
  background: #fff;
  scroll-behavior: smooth;
}
#friends .dm-message-stack {
  max-width: min(76%, 390px);
}
#friends .dm-bubble {
  border: 1px solid #efefef;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.42;
  padding: 9px 12px;
}
#friends .dm-bubble.them {
  background: #efefef;
  color: #262626;
  border-color: #efefef;
  border-radius: 18px 18px 18px 6px;
}
#friends .dm-bubble.me {
  background: #3797f0;
  color: #fff;
  border-color: #3797f0;
  border-radius: 18px 18px 6px 18px;
}
#friends .dm-message-meta {
  color: #8e8e8e;
  font-size: 10px;
  padding: 0 4px;
}
#friends .dm-message-meta .is-read {
  color: #8e8e8e;
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  font-weight: 600;
}
#friends .dm-reply-preview {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.22);
  color: inherit;
}
#friends .dm-bubble.them .dm-reply-preview {
  background: #fff;
  border-color: #dbdbdb;
}
#friends .dm-reply-line {
  color: inherit;
  opacity: .75;
}
#friends .dm-bubble-tools {
  top: -42px;
  padding: 7px;
  border-radius: 16px;
  background: rgba(38,38,38,.94);
  border: 0;
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}
#friends .dm-tool-btn {
  width: auto;
  height: 30px;
  padding: 0 10px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
#friends .dm-tool-btn.danger {
  background: rgba(237,73,86,.15);
  color: #ffb4bd;
}
#friends .dm-compose {
  position: sticky;
  bottom: 0;
  padding: 10px 12px 12px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid #dbdbdb;
  backdrop-filter: blur(18px);
}
#friends .dm-reply-bar {
  background: #fafafa;
  border: 1px solid #efefef;
  color: #262626;
  border-radius: 14px;
}
#friends .dm-reply-text {
  color: #262626;
}
#friends .dm-reply-close {
  border: 0;
  background: #efefef;
  color: #262626;
  box-shadow: none;
}
#friends .dm-compose-row {
  grid-template-columns: 34px minmax(0, 1fr) 34px 34px auto;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbdbdb;
  box-shadow: none;
}
#friends .dm-compose-row input,
#friends .dm-compose-row input:not([type='hidden']):not([type='file']) {
  height: 38px !important;
  min-height: 38px !important;
  background: transparent !important;
  color: #262626 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 8px !important;
  font-size: 14px !important;
}
#friends .dm-compose-row input::placeholder {
  color: #8e8e8e !important;
}
#friends .dm-compose-icon {
  width: 34px;
  height: 38px;
}
#friends #sendFriendChatBtn {
  min-width: 54px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 13px;
  background: #0095f6;
  color: #fff;
  border: 0;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
}
#friends .dm-quick-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 2px;
  scrollbar-width: none;
}
#friends .dm-quick-actions::-webkit-scrollbar { display: none; }
#friends .dm-quick-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #dbdbdb;
  background: #fafafa;
  color: #262626;
  box-shadow: none;
  white-space: nowrap;
  font-weight: 700;
}
html[data-theme="light"] #friends > .card.section,
html[data-theme="light"] #friends .dm-sidebar-card,
html[data-theme="light"] #friends .dm-thread-card,
html[data-theme="light"] #friends .dm-thread-messages,
html[data-theme="light"] #friends .dm-empty {
  background: #fff !important;
  color: #262626 !important;
}
@media (max-width: 768px) {
  body.friends-focus-mode #mainApp {
    padding: 0 !important;
    max-width: none !important;
  }
  body.friends-focus-mode .main {
    gap: 0 !important;
  }
  body.friends-focus-mode .app-topbar,
  body.friends-focus-mode .header {
    display: none !important;
  }
  body.friends-focus-mode #friends {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    min-height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
    background: #fff !important;
  }
  body.friends-focus-mode #friends > .card.section {
    min-height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  body.friends-focus-mode #friends .dm-shell {
    display: block !important;
    min-height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
    height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
  }
  body.friends-focus-mode #friends .dm-sidebar-card,
  body.friends-focus-mode #friends .dm-thread-card {
    min-height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
    height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
    overflow: hidden;
  }
  body.friends-focus-mode #friends .dm-sidebar-card {
    border-right: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0,1fr);
  }
  body.friends-focus-mode #friends .dm-sidebar-card > div:first-child {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  body.friends-focus-mode #friends .dm-sidebar-summary {
    display: none;
  }
  body.friends-focus-mode #friends .dm-list {
    overflow: auto;
    padding-bottom: 18px;
  }
  body.friends-focus-mode #friends .dm-thread-panel {
    min-height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
    height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
  }
  body.friends-focus-mode #friends .dm-thread-top {
    padding-top: max(8px, env(safe-area-inset-top));
  }
  body.friends-focus-mode #friends .dm-thread-messages {
    min-height: 0;
    overflow: auto;
    padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
  }
  body.friends-focus-mode #friends .dm-compose {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  body.friends-focus-mode #friends .dm-thread-actions {
    gap: 7px;
  }
  body.friends-focus-mode #friends .dm-icon-btn:nth-child(1) {
    display: none;
  }
  body.friends-focus-mode #friends .dm-message-stack {
    max-width: 82%;
  }
}
@media (max-width: 360px) {
  #friends .dm-compose-row {
    grid-template-columns: 32px minmax(0,1fr) 32px 32px auto;
  }
  #friends .dm-compose-icon {
    width: 32px;
  }
  #friends #sendFriendChatBtn {
    min-width: 46px;
    padding: 0 10px;
  }
}
#friends .dm-camera-mini svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#friends #friendThreadBottomSpacer { display: none !important; }

/* iPhone DM compose refinement: keep the text field comfortable and unclipped. */
@media (max-width: 768px) {
  body.friends-focus-mode #friends .dm-compose-row {
    grid-template-columns: 36px minmax(0,1fr) 36px auto !important;
    gap: 7px !important;
  }
  body.friends-focus-mode #friends #dmMicBtn {
    display: none !important;
  }
  body.friends-focus-mode #friends #friendChatInput {
    min-width: 0 !important;
    font-size: 15px !important;
  }
  body.friends-focus-mode #friends #sendFriendChatBtn {
    min-width: 56px !important;
    height: 38px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
  }
}

/* iPhone calendar rewrite */
#calendar.ios-calendar-mode {
  color: #262626;
}
#calendar.ios-calendar-mode .calendar-main-section,
#calendar.ios-calendar-mode .calendar-shell,
#calendar.ios-calendar-mode .calendar-stage.is-main-calendar {
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
}
#calendar.ios-calendar-mode .calendar-main-section {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
}
#calendar.ios-calendar-mode .calendar-shell {
  border-radius: 0;
  padding: 0 !important;
}
#calendar.ios-calendar-mode .calendar-head {
  background: #fff;
  color: #262626;
  border: 0;
  border-bottom: 1px solid #efefef;
  padding: 14px 14px 10px;
}
#calendar.ios-calendar-mode .calendar-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100%;
}
#calendar.ios-calendar-mode .calendar-month-chip {
  background: transparent !important;
  color: #262626 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: clamp(22px, 6vw, 28px) !important;
  font-weight: 900 !important;
  letter-spacing: -.04em;
}
#calendar.ios-calendar-mode .calendar-toolbar-actions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex: 0 0 auto;
}
#calendar.ios-calendar-mode .calendar-icon-btn,
#calendar.ios-calendar-mode .calendar-plus-btn,
#calendar.ios-calendar-mode .ios-today-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: #f2f2f7 !important;
  color: #262626 !important;
  box-shadow: none !important;
}
#calendar.ios-calendar-mode .ios-today-btn {
  width: auto !important;
  min-width: auto !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  color: #0095f6 !important;
  background: #e5f4ff !important;
}
#calendar.ios-calendar-mode #closeSharedViewBtn,
#calendar.ios-calendar-mode .calendar-legend,
#calendar.ios-calendar-mode #calendarCompactNote,
#calendar.ios-calendar-mode #calendarSmallLabel,
#calendar.ios-calendar-mode #calendarTitle,
#calendar.ios-calendar-mode #calendarModeHint {
  display: none !important;
}
#calendar.ios-calendar-mode .calendar-stage.is-main-calendar {
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}
#calendar.ios-calendar-mode .calendar-grid.ios-calendar-grid {
  background: #fff !important;
  border: 0 !important;
  padding: 0 8px 8px !important;
  overflow: visible !important;
}
.ios-cal-weekdays,
.ios-cal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
}
.ios-cal-weekdays {
  padding: 8px 0 12px;
  align-items: center;
}
.ios-cal-weekday {
  text-align: center;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  color: #8e8e93;
}
.ios-cal-weekday.sun { color: #ff3b30; }
.ios-cal-weekday.sat { color: #0095f6; }
.ios-cal-day {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  min-width: 0;
  height: 76px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #262626;
  padding: 5px 3px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ios-cal-day:active { transform: scale(.98); }
.ios-cal-day.muted { opacity: .26; }
.ios-cal-day.sun .ios-day-num { color: #ff3b30; }
.ios-cal-day.sat .ios-day-num { color: #0095f6; }
.ios-cal-day.today .ios-day-num {
  background: #0095f6;
  color: #fff !important;
}
.ios-cal-day.selected {
  background: #f5f8ff;
  box-shadow: inset 0 0 0 1.5px rgba(0,149,246,.55);
}
.ios-day-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
}
.ios-day-lines {
  width: 100%;
  min-height: 30px;
  display: grid;
  gap: 2px;
  align-content: start;
}
.ios-day-pill,
.ios-day-more {
  display: block;
  width: 100%;
  min-height: 12px;
  border-radius: 999px;
  padding: 1px 4px 0;
  font-size: 8px;
  line-height: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.ios-day-pill.holiday,
.ios-day-pill.national { background: #ffe5e8; color: #c1122f; }
.ios-day-pill.observed { background: #fff1d6; color: #9a5a00; }
.ios-day-pill.punch { background: #e5f4ff; color: #0064c8; }
.ios-day-pill.memo { background: #fff4e5; color: #8a4b00; }
.ios-day-pill.personal,
.ios-day-pill.family,
.ios-day-pill.leave { background: #f2f2f7; color: #636366; }
.ios-day-pill.sick { background: #fff4e5; color: #b45f00; }
.ios-day-pill.menstrual { background: #ffe5ec; color: #cc1745; }
.ios-day-pill.vitality { background: #f5e8ff; color: #8b35bd; }
.ios-day-pill.annual { background: #e5f4ff; color: #0064c8; }
.ios-day-more { color: #8e8e93; background: transparent; }
.ios-calendar-detail {
  background: #fafafa;
  padding: 12px 14px 110px;
  border-top: 1px solid #efefef;
}
.ios-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.ios-detail-head strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: #262626;
}
.ios-detail-head span,
.ios-detail-head em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: #8e8e93;
}
.ios-detail-list { display: grid; gap: 8px; }
.ios-detail-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 11px 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,.06);
}
.ios-detail-card > span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f2f2f7;
  color: #262626;
  flex: 0 0 auto;
}
.ios-detail-card svg { width: 18px; height: 18px; }
.ios-detail-card div { min-width: 0; flex: 1; }
.ios-detail-card strong,
.ios-detail-card em {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ios-detail-card strong { font-size: 13px; font-weight: 900; color: #262626; }
.ios-detail-card em { margin-top: 3px; font-size: 11px; font-style: normal; color: #8e8e93; }
.ios-detail-card b { font-size: 12px; font-weight: 900; color: #0095f6; }
.ios-detail-card.is-holiday > span { background: #ffe5e8; color: #ff3b30; }
.ios-detail-card.is-memo > span { background: #fff4e5; color: #ff9500; }
.ios-detail-card.is-punch > span { background: #e5f4ff; color: #0095f6; }
.ios-empty-day {
  border-radius: 20px;
  background: #fff;
  color: #8e8e93;
  text-align: center;
  padding: 22px 14px;
  font-size: 12px;
  font-weight: 800;
}
.ios-calendar-fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--phone-nav-h) + var(--safe-bottom) + 18px);
  z-index: 35;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg,#9b5cff,#ff3d88 60%,#ff9500);
  box-shadow: 0 18px 36px rgba(255,61,136,.26);
}
.ios-calendar-fab svg { width: 27px; height: 27px; }
.ios-calendar-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  background: rgba(0,0,0,.38);
}
.ios-calendar-sheet-backdrop.hidden { display: none !important; }
.ios-calendar-sheet {
  width: 100%;
  max-height: min(82svh, 720px);
  overflow: auto;
  border-radius: 30px 30px 0 0;
  background: #fff;
  color: #262626;
  box-shadow: 0 -22px 50px rgba(0,0,0,.22);
  animation: iosCalSlideUp .24s ease both;
  -webkit-overflow-scrolling: touch;
}
@keyframes iosCalSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.ios-sheet-handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #e5e5ea;
  margin: 9px auto 12px;
}
.ios-sheet-pad { padding: 0 18px 22px; }
.ios-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ios-sheet-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -.03em;
}
.ios-sheet-kicker {
  font-size: 12px;
  font-weight: 800;
  color: #8e8e93;
}
.ios-sheet-close,
.ios-action-row,
.ios-primary-btn,
.ios-leave-chip,
.ios-switch {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ios-sheet-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f2f2f7;
  color: #8e8e93;
}
.ios-sheet-close svg { width: 18px; height: 18px; }
.ios-action-list { display: grid; gap: 9px; }
.ios-action-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: #fafafa;
  text-align: left;
}
.ios-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.ios-action-icon svg,
.ios-action-arrow svg { width: 20px; height: 20px; }
.ios-action-copy { min-width: 0; flex: 1; }
.ios-action-copy strong,
.ios-action-copy em { display: block; }
.ios-action-copy strong { font-size: 14px; font-weight: 900; color: #262626; }
.ios-action-copy em { margin-top: 3px; font-size: 11px; line-height: 1.35; color: #8e8e93; font-style: normal; }
.ios-action-arrow { color: #c7c7cc; }
.ios-form { display: grid; gap: 10px; }
.ios-form label { font-size: 12px; font-weight: 900; color: #8e8e93; }
.ios-form input,
.ios-form textarea {
  width: 100%;
  border: 0 !important;
  border-radius: 14px !important;
  background: #f2f2f7 !important;
  color: #262626 !important;
  min-height: 46px !important;
  padding: 11px 13px !important;
  font-size: 15px !important;
  box-shadow: none !important;
  outline: none !important;
}
.ios-form textarea { min-height: 92px !important; resize: none; }
.ios-primary-btn {
  height: 50px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0095f6;
  color: #fff;
  font-size: 15px;
  font-weight: 950;
}
.ios-primary-btn.is-gradient { background: linear-gradient(135deg,#9b5cff,#ff3d88); }
.ios-primary-btn.is-orange { background: #ff9500; }
.ios-primary-btn svg { width: 18px; height: 18px; }
.ios-leave-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ios-leave-chip {
  min-height: 78px;
  border-radius: 16px;
  background: #fafafa;
  box-shadow: inset 0 0 0 1px #efefef;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  color: #262626;
}
.ios-leave-chip.active {
  background: var(--leave-bg);
  box-shadow: inset 0 0 0 2px var(--leave-color);
}
.ios-leave-chip span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--leave-color);
}
.ios-leave-chip svg { width: 17px; height: 17px; }
.ios-leave-chip strong { font-size: 11px; font-weight: 950; }
.ios-leave-chip em { font-style: normal; font-size: 10px; color: #8e8e93; }
.ios-leave-info {
  min-height: 54px;
  border-radius: 16px;
  padding: 11px 12px;
  background: #fafafa;
  display: grid;
  gap: 4px;
}
.ios-leave-info strong,
.ios-leave-info span,
.ios-leave-info em { display: block; font-style: normal; }
.ios-leave-info strong { font-size: 13px; font-weight: 950; }
.ios-leave-info span,
.ios-leave-info em { font-size: 11px; color: #8e8e93; line-height: 1.35; }
.ios-toggle-line {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fafafa;
  color: #262626 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ios-switch {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #e5e5ea;
  transition: background .18s ease;
}
.ios-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.16);
  transition: transform .18s ease;
}
.ios-switch.active { background: #34c759; }
.ios-switch.active i { transform: translateX(18px); }
.ios-switch:disabled { opacity: .45; }
@media (max-width: 768px) {
  body.calendar-focus-mode #mainApp {
    max-width: none !important;
    padding: 0 !important;
    background: #fafafa !important;
  }
  body.calendar-focus-mode .main { gap: 0 !important; }
  body.calendar-focus-mode .app-topbar,
  body.calendar-focus-mode .header { display: none !important; }
  body.calendar-focus-mode #calendar {
    width: 100vw !important;
    min-height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    background: #fafafa !important;
  }
  body.calendar-focus-mode #calendar .calendar-main-section,
  body.calendar-focus-mode #calendar .simple-calendar-shell {
    min-height: calc(100svh - var(--phone-nav-h) - var(--safe-bottom)) !important;
    border-radius: 0 !important;
  }
  body.calendar-focus-mode #calendar .calendar-head {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  body.calendar-focus-mode #calendar .calendar-grid.ios-calendar-grid {
    padding-left: 7px !important;
    padding-right: 7px !important;
  }
  body.calendar-focus-mode #calendar .ios-cal-day {
    height: clamp(64px, 10.4svh, 78px);
    border-radius: 14px;
  }
  body.calendar-focus-mode #calendar .ios-calendar-detail {
    min-height: 160px;
    padding-bottom: calc(var(--phone-nav-h) + var(--safe-bottom) + 92px);
  }
  body.calendar-focus-mode #calendar #calendarHubOpenBtn {
    display: none !important;
  }
}
@media (max-width: 380px) {
  .ios-cal-day { height: 68px; }
  .ios-day-pill,
  .ios-day-more { font-size: 7.5px; padding-left: 2px; padding-right: 2px; }
  .ios-leave-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}


/* iPhone home rewrite */
.ios-home-topbar,
.ios-home-stories,
.ios-home-today-card,
.ios-home-card-grid,
.ios-home-law-card,
.ios-home-analysis-card {
  display: none;
}

.ios-home-mode .ios-home-action svg,
.ios-home-mode .ios-home-story svg,
.ios-home-mode .ios-home-today-card svg,
.ios-home-mode .ios-home-small-card svg,
.ios-home-mode .ios-home-law-card svg,
.ios-home-mode .ios-home-analysis-card svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 768px) {
  body.dashboard-focus-mode {
    background: #fafafa !important;
    color: #262626 !important;
  }

  body.dashboard-focus-mode #mainApp.app {
    padding: 0 !important;
    max-width: none !important;
    background: #fafafa !important;
  }

  body.dashboard-focus-mode .layout,
  body.dashboard-focus-mode .main {
    min-height: 100svh !important;
    gap: 0 !important;
    background: #fafafa !important;
  }

  body.dashboard-focus-mode .app-topbar,
  body.dashboard-focus-mode .header {
    display: none !important;
  }

  body.dashboard-focus-mode #dashboard {
    display: block !important;
    min-height: calc(100svh - var(--phone-nav-h, 78px)) !important;
    padding: 0 0 calc(var(--phone-nav-h, 78px) + 12px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    background: #fafafa !important;
  }

  body.dashboard-focus-mode #dashboard .dashboard-main {
    display: block !important;
    gap: 0 !important;
  }

  body.dashboard-focus-mode .ios-home-topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(10px, env(safe-area-inset-top)) 16px 9px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid #efefef;
    color: #262626;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.dashboard-focus-mode .ios-home-logo {
    font-size: 25px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.04em;
    color: #111;
  }

  body.dashboard-focus-mode .ios-home-actions {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  body.dashboard-focus-mode .ios-home-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #111;
    background: transparent;
    border: 0;
  }

  body.dashboard-focus-mode .ios-home-action svg {
    width: 24px;
    height: 24px;
  }

  body.dashboard-focus-mode .ios-home-action span {
    position: absolute;
    top: -4px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    border: 2px solid #fff;
  }

  body.dashboard-focus-mode .ios-home-stories {
    display: flex;
    gap: 12px;
    padding: 12px 14px 11px;
    overflow-x: auto;
    background: #fff;
    border-bottom: 1px solid #efefef;
    scrollbar-width: none;
  }

  body.dashboard-focus-mode .ios-home-stories::-webkit-scrollbar { display: none; }

  body.dashboard-focus-mode .ios-home-story {
    width: 58px;
    flex: 0 0 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #262626;
    background: transparent;
    border: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  body.dashboard-focus-mode .ios-home-story-ring,
  body.dashboard-focus-mode .ios-home-story-avatar {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: grid;
    place-items: center;
  }

  body.dashboard-focus-mode .ios-home-story-ring {
    padding: 2px;
    background: linear-gradient(135deg,#f58529,#dd2a7b 52%,#8134af);
  }

  body.dashboard-focus-mode .ios-home-story-ring i {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #fff;
    font-style: normal;
  }

  body.dashboard-focus-mode .ios-home-story-ring svg {
    width: 25px;
    height: 25px;
  }

  body.dashboard-focus-mode .ios-home-story-avatar {
    position: relative;
    padding: 2px;
    border: 2px dashed #dbdbdb;
    background: #fff;
  }

  body.dashboard-focus-mode .ios-home-story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
  }

  body.dashboard-focus-mode .ios-home-story-avatar i {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #0095f6;
    color: #fff;
    border: 2px solid #fff;
    font-size: 14px;
    font-style: normal;
    line-height: 1;
  }

  body.dashboard-focus-mode .ios-home-story em {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    color: #262626;
    font-style: normal;
    font-size: 10px;
  }

  body.dashboard-focus-mode .dashboard-overview-card {
    margin: 8px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  body.dashboard-focus-mode .dashboard-overview-grid {
    display: block !important;
  }

  body.dashboard-focus-mode .dashboard-summary-panel {
    padding: 10px 0 12px !important;
    border: 0 !important;
    border-bottom: 1px solid #efefef !important;
    background: #fff !important;
    border-radius: 0 !important;
  }

  body.dashboard-focus-mode .dashboard-summary-head {
    padding: 0 14px 4px !important;
  }

  body.dashboard-focus-mode #dashboardSummaryKicker {
    color: #8e8e8e !important;
    font-size: 11px !important;
    font-weight: 700 !important;
  }

  body.dashboard-focus-mode .dashboard-summary-title {
    color: #262626 !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    margin-top: 2px !important;
  }

  body.dashboard-focus-mode #dashboardSummaryText {
    color: #8e8e8e !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
    margin-top: 1px !important;
  }

  body.dashboard-focus-mode .salary-donut-shell {
    margin: 6px auto 0 !important;
    min-height: 302px !important;
  }

  body.dashboard-focus-mode .salary-donut {
    width: min(300px, calc(100vw - 38px)) !important;
    height: min(300px, calc(100vw - 38px)) !important;
    margin: 0 auto !important;
    border-radius: 999px !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.02) !important;
  }

  body.dashboard-focus-mode .salary-donut::after {
    inset: 36px !important;
    background: #fff !important;
    box-shadow: inset 0 0 0 1px #f2f2f7 !important;
  }

  body.dashboard-focus-mode .salary-donut-kicker,
  body.dashboard-focus-mode .salary-donut-sub {
    color: #8e8e8e !important;
  }

  body.dashboard-focus-mode .salary-donut-value {
    color: #111 !important;
    font-size: clamp(25px, 8vw, 34px) !important;
    letter-spacing: -.05em !important;
  }

  body.dashboard-focus-mode .salary-legend {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 8px !important;
    padding: 2px 14px 0 !important;
  }

  body.dashboard-focus-mode .salary-legend-item {
    min-height: 54px !important;
    padding: 9px !important;
    border-radius: 11px !important;
    border: 1px solid #efefef !important;
    background: #fff !important;
    color: #262626 !important;
    box-shadow: none !important;
  }

  body.dashboard-focus-mode .salary-legend-item.is-active {
    border-color: #0095f6 !important;
    background: #f0f9ff !important;
  }

  body.dashboard-focus-mode .salary-legend-label,
  body.dashboard-focus-mode .salary-legend-value {
    color: #262626 !important;
  }

  body.dashboard-focus-mode .salary-legend-percent,
  body.dashboard-focus-mode .dashboard-insight-sub {
    color: #8e8e8e !important;
  }

  body.dashboard-focus-mode .dashboard-side-stack {
    padding: 0 12px !important;
  }

  body.dashboard-focus-mode .dashboard-insight-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  body.dashboard-focus-mode .dashboard-insight-card,
  body.dashboard-focus-mode .dashboard-leave-panel,
  body.dashboard-focus-mode .dashboard-avatar-panel {
    border: 0 !important;
    border-radius: 18px !important;
    background: #fff !important;
    color: #262626 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.045) !important;
  }

  body.dashboard-focus-mode .dashboard-insight-card {
    padding: 12px !important;
    min-height: 102px !important;
  }

  body.dashboard-focus-mode .dashboard-insight-label,
  body.dashboard-focus-mode .dashboard-leave-sub,
  body.dashboard-focus-mode .dashboard-leave-analysis,
  body.dashboard-focus-mode .dashboard-avatar-sub,
  body.dashboard-focus-mode .pet-hint {
    color: #8e8e8e !important;
  }

  body.dashboard-focus-mode .dashboard-insight-value,
  body.dashboard-focus-mode .dashboard-leave-title,
  body.dashboard-focus-mode .dashboard-avatar-name {
    color: #111 !important;
  }

  body.dashboard-focus-mode .dashboard-leave-panel {
    grid-column: 1 / -1;
    padding: 14px !important;
  }

  body.dashboard-focus-mode .dashboard-avatar-panel {
    margin-top: 12px !important;
    padding: 14px !important;
  }

  body.dashboard-focus-mode .dashboard-avatar-open {
    border: 0 !important;
    background: #0095f6 !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 9px 14px !important;
  }

  body.dashboard-focus-mode .ios-home-today-card,
  body.dashboard-focus-mode .ios-home-card-grid,
  body.dashboard-focus-mode .ios-home-law-card,
  body.dashboard-focus-mode .ios-home-analysis-card {
    display: block;
  }

  body.dashboard-focus-mode #dashboardSalaryMount {
    padding: 0 12px 14px !important;
  }

  body.dashboard-focus-mode .ios-home-today-card {
    overflow: hidden;
    margin-top: 12px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg,#9b5cff 0%,#ff3d88 100%);
    box-shadow: 0 18px 34px rgba(221,42,123,.18);
  }

  body.dashboard-focus-mode .ios-home-today-main { padding: 16px; }

  body.dashboard-focus-mode .ios-home-today-row,
  body.dashboard-focus-mode .ios-home-today-row span,
  body.dashboard-focus-mode .ios-home-today-footer,
  body.dashboard-focus-mode .ios-home-today-footer span {
    display: flex;
    align-items: center;
  }

  body.dashboard-focus-mode .ios-home-today-row {
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    opacity: .95;
  }

  body.dashboard-focus-mode .ios-home-today-row span,
  body.dashboard-focus-mode .ios-home-today-footer span { gap: 6px; }

  body.dashboard-focus-mode .ios-home-today-row em {
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    padding: 3px 8px;
    font-size: 10px;
    font-style: normal;
  }

  body.dashboard-focus-mode .ios-home-today-pay {
    margin-top: 10px;
    font-size: 36px;
    font-weight: 950;
    letter-spacing: -.055em;
    line-height: 1;
  }

  body.dashboard-focus-mode .ios-home-today-sub {
    margin-top: 5px;
    font-size: 11px;
    opacity: .9;
  }

  body.dashboard-focus-mode .ios-home-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
    margin-top: 12px;
  }

  body.dashboard-focus-mode .ios-home-mini-stats div {
    text-align: center;
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    padding: 8px 5px;
    backdrop-filter: blur(10px);
  }

  body.dashboard-focus-mode .ios-home-mini-stats small {
    display: block;
    font-size: 9px;
    opacity: .8;
  }

  body.dashboard-focus-mode .ios-home-mini-stats strong {
    display: block;
    margin-top: 2px;
    font-size: 13px;
  }

  body.dashboard-focus-mode .ios-home-today-footer {
    width: 100%;
    justify-content: space-between;
    border: 0;
    color: #fff;
    background: rgba(255,255,255,.12);
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
  }

  body.dashboard-focus-mode .ios-home-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
    margin-top: 12px;
  }

  body.dashboard-focus-mode .ios-home-small-card,
  body.dashboard-focus-mode .ios-home-law-card,
  body.dashboard-focus-mode .ios-home-analysis-card {
    border-radius: 18px;
    background: #fff;
    color: #262626;
    box-shadow: 0 2px 10px rgba(0,0,0,.045);
  }

  body.dashboard-focus-mode .ios-home-small-card {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    min-height: 92px;
  }

  body.dashboard-focus-mode .ios-home-small-card > svg {
    width: 18px;
    height: 18px;
    color: #ff9500;
    flex: 0 0 auto;
  }

  body.dashboard-focus-mode .ios-home-small-card span,
  body.dashboard-focus-mode .ios-home-small-card em {
    display: block;
    color: #8e8e8e;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
  }

  body.dashboard-focus-mode .ios-home-small-card b {
    display: block;
    margin-top: 5px;
    color: #111;
    font-size: 18px;
    letter-spacing: -.03em;
  }

  body.dashboard-focus-mode .ios-home-law-card {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #b2dffc;
    background: #e5f4ff;
    box-shadow: none;
  }

  body.dashboard-focus-mode .ios-home-law-card > span {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: #0095f6;
    flex: 0 0 auto;
  }

  body.dashboard-focus-mode .ios-home-law-card strong {
    display: block;
    color: #0064c8;
    font-size: 12px;
  }

  body.dashboard-focus-mode .ios-home-law-card p {
    margin: 3px 0 0;
    color: rgba(0,100,200,.82);
    font-size: 11px;
    line-height: 1.55;
  }

  body.dashboard-focus-mode .ios-home-analysis-card {
    display: block;
    margin-top: 12px;
    padding: 14px;
  }

  body.dashboard-focus-mode .ios-home-section-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    color: #262626;
    font-size: 14px;
  }

  body.dashboard-focus-mode .ios-home-section-head span {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    color: #af52de;
  }

  body.dashboard-focus-mode .ios-home-analysis-list {
    display: grid;
    gap: 8px;
  }

  body.dashboard-focus-mode .ios-home-analysis-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 13px;
    background: #fafafa;
    padding: 10px;
  }

  body.dashboard-focus-mode .ios-home-analysis-row strong,
  body.dashboard-focus-mode .ios-home-analysis-row em {
    display: block;
  }

  body.dashboard-focus-mode .ios-home-analysis-row strong {
    color: #262626;
    font-size: 12px;
  }

  body.dashboard-focus-mode .ios-home-analysis-row em {
    margin-top: 2px;
    color: #8e8e8e;
    font-size: 10px;
    font-style: normal;
    line-height: 1.35;
  }

  body.dashboard-focus-mode .ios-home-analysis-row span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #111;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
  }

  body.dashboard-focus-mode .ios-home-analysis-row span b {
    color: #34c759;
    font-size: 14px;
  }

  body.dashboard-focus-mode .ios-home-analysis-row span.warn b { color: #ff9500; }

  body.dashboard-focus-mode .salary-donut-detail-card {
    color: #262626 !important;
    background: #fff !important;
  }

  html[data-theme="light"] body.dashboard-focus-mode,
  html[data-theme="light"] body.dashboard-focus-mode #mainApp.app,
  html[data-theme="light"] body.dashboard-focus-mode .layout,
  html[data-theme="light"] body.dashboard-focus-mode .main,
  html[data-theme="light"] body.dashboard-focus-mode #dashboard {
    background: #fafafa !important;
  }
}

@media (max-width: 430px) {
  body.dashboard-focus-mode .salary-donut-shell {
    min-height: min(302px, calc(100vw - 30px)) !important;
  }

  body.dashboard-focus-mode .salary-legend {
    gap: 7px !important;
  }

  body.dashboard-focus-mode .salary-legend-item {
    padding: 8px !important;
  }

  body.dashboard-focus-mode .ios-home-today-pay {
    font-size: 34px;
  }
}

@media (max-width: 768px) {
  body.dashboard-focus-mode .dashboard-side-stack > .dashboard-insight-grid > .dashboard-insight-card {
    display: none !important;
  }

  body.dashboard-focus-mode #dashboardSalaryMount {
    display: block !important;
    padding: 0 12px 0 !important;
  }
}

/* iPhone fixed bottom tab bar */
@media (max-width: 768px) {
  :root { --phone-nav-h: 86px; }

  .iphone-nav-shell {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    z-index: 220 !important;
    padding: 0 0 max(5px, env(safe-area-inset-bottom)) !important;
    background: rgba(255,255,255,.95) !important;
    border-top: 1px solid #dbdbdb !important;
    box-shadow: none !important;
    backdrop-filter: blur(18px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
  }

  .nav.nav-dock {
    width: min(100%, 480px) !important;
    max-width: 480px !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0,1fr)) !important;
    gap: 0 !important;
    padding: 7px 8px 2px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .nav.nav-dock::after {
    content: '';
    grid-column: 1 / -1;
    justify-self: center;
    width: 134px;
    height: 5px;
    margin: 6px auto 0;
    border-radius: 999px;
    background: #000;
  }

  .nav.nav-dock .tab-btn {
    min-height: 58px !important;
    padding: 4px 0 2px !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    color: #8e8e8e !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    transition: transform .14s ease, color .18s ease, opacity .18s ease !important;
    -webkit-tap-highlight-color: transparent;
  }

  .nav.nav-dock .tab-btn:active {
    transform: scale(.95) !important;
  }

  .nav.nav-dock .tab-btn::before,
  .nav.nav-dock .tab-btn::after,
  .nav.nav-dock .tab-icon::before {
    content: none !important;
    display: none !important;
  }

  .nav.nav-dock .tab-btn.active {
    color: #000 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .nav.nav-dock .tab-icon {
    width: 31px !important;
    height: 31px !important;
    border-radius: 0 !important;
    display: grid !important;
    place-items: center !important;
    background: transparent !important;
    color: currentColor !important;
    transform: none !important;
  }

  .nav.nav-dock .tab-icon svg {
    width: 27px !important;
    height: 27px !important;
    overflow: visible !important;
    color: currentColor !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 1.85 !important;
    filter: none !important;
    transform: none !important;
  }

  .nav.nav-dock .tab-btn.active .tab-icon svg {
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2.35 !important;
  }

  .nav.nav-dock .tab-label {
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    color: currentColor !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    margin-top: 1px !important;
  }

  .nav.nav-dock .tab-btn.active .tab-label {
    font-weight: 700 !important;
  }

  html[data-theme="light"] .iphone-nav-shell,
  html[data-theme="light"] .nav.nav-dock {
    background: rgba(255,255,255,.95) !important;
    border-color: #dbdbdb !important;
    box-shadow: none !important;
  }

  html[data-theme="light"] .nav.nav-dock .tab-btn {
    color: #8e8e8e !important;
    background: transparent !important;
  }

  html[data-theme="light"] .nav.nav-dock .tab-btn.active {
    color: #000 !important;
    background: transparent !important;
  }

  .main,
  .tab-panel,
  body.dashboard-focus-mode #dashboard,
  body.calendar-focus-mode #calendar,
  body.friends-focus-mode #friends {
    padding-bottom: calc(var(--phone-nav-h) + env(safe-area-inset-bottom) + 12px) !important;
  }
}

/* App Shell mobile layout */
@media (max-width: 768px) {
  #mainApp.app {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  #mainApp > .layout {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell {
    order: 2;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    flex-shrink: 0 !important;
    z-index: 20 !important;
    padding: 0 0 env(safe-area-inset-bottom) !important;
    background: #fff !important;
    border-top: 1px solid #efefef !important;
    box-shadow: 0 -2px 12px rgba(0,0,0,.04) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #mainApp > .layout > .main.app-shell-main {
    order: 1;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  #mainApp .app-topbar {
    flex-shrink: 0 !important;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px !important;
    background: #fff !important;
    color: #262626 !important;
    border-bottom: 1px solid transparent !important;
    box-shadow: none !important;
    transition: box-shadow .15s ease, border-color .15s ease !important;
    z-index: 10 !important;
  }

  #mainApp .app-brand-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    min-width: 0 !important;
  }

  #mainApp .app-brand-title {
    margin: 0 !important;
    min-width: 0 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    background: linear-gradient(135deg, #0095F6, #7C5BFF) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
  }

  #mainApp .app-topbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
  }

  #mainApp .top-icon-btn {
    width: 36px !important;
    height: 36px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #262626 !important;
    position: relative !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  #mainApp .top-icon-btn svg {
    width: 22px !important;
    height: 22px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  #mainApp .top-icon-badge {
    position: absolute !important;
    top: 3px !important;
    right: 2px !important;
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 4px !important;
    border-radius: 999px !important;
    background: #FF3B6B !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 0 0 2px #fff !important;
    line-height: 1 !important;
  }

  #mainApp .app-topbar .small.muted,
  #mainApp .app-topbar .topbar-meta {
    color: #8e8e8e !important;
  }

  #mainApp .app-topbar .topbar-name,
  #mainApp .app-topbar .topbar-shift,
  #mainApp .app-topbar .pill-user,
  #mainApp .app-topbar .pill-user span {
    color: #262626 !important;
  }

  #mainApp .top-profile-btn,
  #mainApp .top-settings-link {
    background: #fff !important;
    border-color: #efefef !important;
    box-shadow: none !important;
    color: #262626 !important;
  }

  #mainApp .top-profile-avatar {
    border-color: #efefef !important;
    background: #fafafa !important;
  }

  #mainApp .topbar-shift {
    background: #f5f5f5 !important;
  }

  #mainApp .app-topbar.is-scrolled {
    border-bottom-color: #efefef !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.04) !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0 !important;
    padding: 0 !important;
    min-height: 56px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock::after {
    content: none !important;
    display: none !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-btn {
    min-height: 56px !important;
    padding: 4px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    color: #262626 !important;
    background: transparent !important;
    box-shadow: none !important;
    position: relative !important;
    transition: transform .1s ease, color .18s ease, opacity .18s ease !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-btn::before,
  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-btn::after,
  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-icon::before {
    content: none !important;
    display: none !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-btn.active {
    color: #0095F6 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-icon {
    width: 32px !important;
    height: 32px !important;
    display: grid !important;
    place-items: center !important;
    color: currentColor !important;
    background: transparent !important;
    border-radius: 999px !important;
    position: relative !important;
    overflow: visible !important;
    transform: none !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-btn.active .tab-icon {
    background: rgba(0,149,246,.12) !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-icon svg {
    width: 26px !important;
    height: 26px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    filter: none !important;
    transform: none !important;
    overflow: visible !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-btn.active .tab-icon svg {
    stroke-width: 2.6 !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-label {
    display: block !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    color: #8e8e93 !important;
    margin: 0 !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-btn.active .tab-label {
    color: #0095F6 !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #FF3B6B;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
    line-height: 1;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-badge.hidden {
    display: none !important;
  }

  #appShellContent.app-shell-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #fafafa;
    padding: 0 0 12px !important;
  }

  #appShellContent > .header {
    margin: 0 10px 14px !important;
  }

  #mainApp .main,
  #mainApp .tab-panel,
  #appShellContent > .tab-panel,
  body.dashboard-focus-mode #dashboard,
  body.calendar-focus-mode #calendar,
  body.friends-focus-mode #friends {
    padding-bottom: 12px !important;
  }
}

/* iPhone punch workspace */
@media (max-width: 768px) {
  #attendance {
    padding: 0 !important;
    background: #fafafa;
  }
  #attendance .iphone-punch-page {
    min-height: 100%;
    padding: 10px 12px calc(var(--phone-nav-h, 86px) + 18px);
    background: #fafafa;
    color: #262626;
  }
  .iphone-punch-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 18px;
    color: #fff;
    box-shadow: 0 18px 40px rgba(17, 24, 39, .18);
    transform: translateZ(0);
  }
  .iphone-punch-hero::before {
    content: "";
    position: absolute;
    inset: -40% -15% auto auto;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    filter: blur(2px);
  }
  .iphone-punch-hero.is-off { background: linear-gradient(135deg, #262626 0%, #3a3a3c 100%); }
  .iphone-punch-hero.is-working { background: linear-gradient(135deg, #9b5cff 0%, #ff3d88 52%, #ff9500 100%); }
  .iphone-punch-hero.is-overtime { background: linear-gradient(135deg, #ff3b30 0%, #ff9500 100%); }
  .iphone-punch-hero.is-locked { background: linear-gradient(135deg, #34c759 0%, #1b7a3a 100%); }
  .iphone-punch-hero.is-leave { background: linear-gradient(135deg, #8e8e93 0%, #3a3a3c 100%); }
  .iphone-punch-status-line,
  .iphone-punch-money-wrap,
  .iphone-punch-metrics { position: relative; z-index: 1; }
  .iphone-punch-status-line {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    line-height: 1;
  }
  .iphone-punch-status-line em {
    margin-left: auto;
    font-style: normal;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    font-size: 10px;
  }
  .iphone-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.7);
    box-shadow: 0 0 0 5px rgba(255,255,255,.12);
  }
  .is-working .iphone-live-dot,
  .is-overtime .iphone-live-dot {
    background: #34ff6d;
    animation: payrollPulseDot 1.2s ease-in-out infinite;
  }
  .iphone-punch-money-wrap { margin-top: 18px; display: grid; gap: 6px; }
  .iphone-punch-money-wrap span { font-size: 12px; opacity: .78; font-weight: 800; }
  .iphone-punch-money {
    display: block;
    font-size: clamp(38px, 10vw, 48px);
    line-height: .95;
    letter-spacing: -.05em;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
  }
  .iphone-punch-money-wrap small {
    max-width: 280px;
    font-size: 11px;
    line-height: 1.55;
    color: rgba(255,255,255,.82);
  }
  .iphone-punch-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 15px;
  }
  .iphone-punch-metrics div {
    min-width: 0;
    padding: 10px 8px;
    border-radius: 15px;
    background: rgba(255,255,255,.16);
    backdrop-filter: blur(10px);
    text-align: center;
  }
  .iphone-punch-metrics span { display: block; font-size: 9px; opacity: .76; }
  .iphone-punch-metrics strong {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
  }
  .iphone-punch-action-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin: 18px 0 12px;
  }
  .iphone-punch-orb {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 10px 26px rgba(0,0,0,.16);
  }
  .iphone-punch-orb.is-off { background: linear-gradient(135deg, #262626, #3a3a3c); }
  .iphone-punch-orb.is-working { background: linear-gradient(135deg, #9b5cff, #ff3d88); animation: payrollSoftFloat 2.4s ease-in-out infinite; }
  .iphone-punch-orb.is-overtime { background: linear-gradient(135deg, #ff3b30, #ff9500); animation: payrollSoftFloat 2.4s ease-in-out infinite; }
  .iphone-punch-orb.is-locked { background: linear-gradient(135deg, #34c759, #1b7a3a); }
  .iphone-punch-orb.is-leave { background: linear-gradient(135deg, #8e8e93, #3a3a3c); }
  .iphone-punch-primary {
    position: relative;
    width: min(230px, 68vw);
    height: min(230px, 68vw);
    border: 0;
    border-radius: 999px;
    color: white;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #9b5cff 0%, #0095f6 100%);
    box-shadow: 0 22px 44px -10px rgba(0,149,246,.48);
    -webkit-tap-highlight-color: transparent;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  }
  .iphone-punch-primary::after {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: inherit;
    border: 1px solid rgba(255,255,255,.26);
    pointer-events: none;
  }
  .iphone-punch-primary:active { transform: scale(.965); }
  .iphone-punch-primary span { font-size: 23px; font-weight: 950; letter-spacing: -.02em; }
  .iphone-punch-primary small { font-size: 11px; opacity: .84; font-weight: 800; }
  .iphone-punch-primary.is-out {
    background: linear-gradient(135deg, #ff3d88 0%, #ff9500 100%);
    box-shadow: 0 22px 44px -10px rgba(255,61,136,.48);
  }
  .iphone-punch-primary.is-done {
    background: linear-gradient(135deg, #34c759 0%, #1b7a3a 100%);
    box-shadow: 0 18px 32px -12px rgba(52,199,89,.38);
    opacity: .92;
  }
  .iphone-punch-side-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  .iphone-punch-side-actions button,
  .iphone-record-heading button {
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: #262626;
    min-height: 46px;
    font-size: 13px;
    font-weight: 850;
    box-shadow: 0 8px 22px rgba(17,24,39,.06);
    -webkit-tap-highlight-color: transparent;
  }
  .iphone-punch-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
  }
  .iphone-punch-stats div {
    min-width: 0;
    border-radius: 20px;
    padding: 12px 10px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(17,24,39,.055);
  }
  .iphone-punch-stats span,
  .iphone-punch-stats small { display: block; color: #8e8e8e; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .iphone-punch-stats strong { display: block; margin-top: 7px; font-size: 18px; color: #262626; white-space: nowrap; }
  .iphone-punch-stats small { margin-top: 3px; color: #34c759; }
  .iphone-record-section {
    margin-top: 12px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(17,24,39,.055);
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: 420px;
  }
  .iphone-record-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 16px 8px;
  }
  .iphone-record-heading h2 { margin: 0; color: #262626; font-size: 15px; line-height: 1.2; }
  .iphone-record-heading p { margin: 5px 0 0; color: #8e8e8e; font-size: 11px; line-height: 1.45; }
  .iphone-record-heading button { min-height: 34px; padding: 0 12px; color: #0095f6; background: #e5f4ff; box-shadow: none; }
  .iphone-record-list { display: grid; gap: 0; padding: 2px 10px 10px; max-height: none; overflow: visible; margin: 0; }
  .iphone-record-row {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 68px;
    padding: 9px 4px;
    border-top: 1px solid #f2f2f7;
  }
  .iphone-record-date {
    width: 45px;
    height: 45px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    align-content: center;
    background: #f2f2f7;
    color: #262626;
    flex: 0 0 auto;
  }
  .iphone-record-row.is-live .iphone-record-date { background: linear-gradient(135deg, #9b5cff, #ff3d88); color: #fff; }
  .iphone-record-row.is-leave .iphone-record-date { background: #f2f2f7; color: #c7c7cc; }
  .iphone-record-date span { font-size: 9px; line-height: 1; color: inherit; opacity: .72; }
  .iphone-record-date strong { margin-top: 3px; font-size: 15px; line-height: 1; }
  .iphone-record-main { min-width: 0; flex: 1; }
  .iphone-record-title { color: #262626; font-size: 13px; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .iphone-record-title span { color: #8e8e8e; }
  .iphone-record-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; color: #8e8e8e; font-size: 10px; line-height: 1.2; }
  .iphone-record-meta b { padding: 3px 6px; border-radius: 999px; background: #f5e8ff; color: #af52de; font-size: 9px; }
  .iphone-record-meta b.live { background: #ffe5ec; color: #ff2d55; }
  .iphone-record-meta b.synced { background: #e5f8ec; color: #1b7a3a; }
  .iphone-record-money { color: #262626; font-size: 13px; font-weight: 950; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .iphone-record-empty { padding: 20px 16px 22px; color: #8e8e8e; font-size: 12px; line-height: 1.7; text-align: center; }
  html[data-theme="light"] #attendance,
  html[data-theme="light"] #attendance .iphone-punch-page { background: #fafafa; color: #262626; }
  @keyframes payrollPulseDot {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 5px rgba(52,255,109,.12); }
    50% { transform: scale(1.25); box-shadow: 0 0 0 9px rgba(52,255,109,.08); }
  }
  @keyframes payrollSoftFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
  }
}

@media (min-width: 769px) {
  #attendance .iphone-punch-page {
    display: grid;
    grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr);
    gap: 18px;
  }
  #attendance .iphone-punch-hero,
  #attendance .iphone-punch-action-card,
  #attendance .iphone-punch-stats {
    grid-column: 1;
  }
  #attendance .iphone-record-section {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  body.attendance-focus-mode #mainApp .app-topbar,
  body.attendance-focus-mode #mainApp > .layout > .main > .card.header {
    display: none !important;
  }
  body.attendance-focus-mode #mainApp.app {
    padding-top: 0 !important;
  }
  body.attendance-focus-mode #mainApp .main {
    gap: 0 !important;
  }
  .iphone-punch-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 2px 2px 10px;
  }
  .iphone-punch-topbar span {
    display: block;
    color: #8e8e8e;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
  }
  .iphone-punch-topbar strong {
    display: block;
    margin-top: 4px;
    color: #262626;
    font-size: 27px;
    line-height: 1;
    letter-spacing: -.03em;
  }
  .iphone-punch-topbar button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #262626;
    box-shadow: 0 8px 22px rgba(17,24,39,.06);
    font-size: 18px;
    font-weight: 900;
  }
}

@media (max-width: 768px) {
  .iphone-punch-page { padding-top: 6px !important; }
  .iphone-punch-topbar { min-height: 40px; padding-bottom: 8px; }
  .iphone-punch-topbar strong { font-size: 24px; }
  .iphone-punch-topbar button { width: 34px; height: 34px; font-size: 16px; }
  .iphone-punch-hero { border-radius: 26px; padding: 15px !important; }
  .iphone-punch-money-wrap { margin-top: 13px; gap: 4px; }
  .iphone-punch-money { font-size: clamp(34px, 8.8vw, 42px); }
  .iphone-punch-money-wrap small { font-size: 10.5px; line-height: 1.45; }
  .iphone-punch-metrics { gap: 7px; margin-top: 12px; }
  .iphone-punch-metrics div { border-radius: 13px; padding: 8px 6px; }
  .iphone-punch-metrics strong { font-size: 12px; }
  .iphone-punch-action-card { gap: 10px; margin: 12px 0 10px; }
  .iphone-punch-orb { width: 46px; height: 46px; border-radius: 15px; font-size: 21px; }
  .iphone-punch-primary { width: min(188px, 56vw); height: min(188px, 56vw); }
  .iphone-punch-primary span { font-size: 21px; }
  .iphone-punch-primary small { font-size: 10.5px; }
  .iphone-punch-stats { margin-top: 8px; }
}

/* IG settings page */
#settings.ig-settings-panel {
  padding: 0 !important;
  background: transparent;
}
.ig-settings-page {
  --ig-bg: #fff;
  --ig-text: #262626;
  --ig-muted: #8e8e8e;
  --ig-line: #dbdbdb;
  --ig-soft: #efefef;
  --ig-blue: #0095f6;
  min-height: 100%;
  width: 100%;
  background: var(--ig-bg);
  color: var(--ig-text);
  position: relative;
  overflow: hidden;
  font-family: Inter, "Noto Sans TC", sans-serif;
}
.ig-settings-page.is-dark {
  --ig-bg: #000;
  --ig-text: #fff;
  --ig-muted: rgba(255,255,255,.56);
  --ig-line: rgba(255,255,255,.12);
  --ig-soft: rgba(255,255,255,.1);
}
.ig-settings-statusbar,
.ig-settings-header,
.ig-settings-search,
.ig-settings-profile,
.ig-settings-row,
.ig-settings-language-row,
.ig-settings-form-grid,
.ig-settings-mini-grid,
.ig-settings-pay-card,
.ig-settings-advanced-body,
.ig-settings-stats,
.ig-settings-footer {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.ig-settings-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 24px 4px;
  font-size: 15px;
  font-weight: 800;
}
.ig-settings-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--ig-line);
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--ig-bg) 92%, transparent);
  backdrop-filter: blur(14px);
}
.ig-settings-header button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ig-settings-header button:first-child {
  width: 40px;
  height: 40px;
  font-size: 34px;
  line-height: 1;
}
.ig-settings-header button:last-child {
  color: var(--ig-blue);
  font-size: 14px;
}
.ig-settings-header strong { font-size: 16px; }
.ig-settings-main {
  height: calc(100vh - 96px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}
.ig-settings-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-top: 12px;
  margin-bottom: 4px;
  padding: 0 14px;
  width: calc(100% - 24px);
  border-radius: 10px;
  background: var(--ig-soft);
  color: var(--ig-muted);
}
.ig-settings-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ig-text);
  font-size: 13px;
}
.ig-settings-search button {
  border: 0;
  background: transparent;
  color: var(--ig-muted);
  font-size: 18px;
}
.ig-settings-profile {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ig-settings-avatar,
.ig-settings-avatar-ring {
  display: block;
  border-radius: 999px;
  padding: 3px;
  background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af);
}
.ig-settings-avatar img,
.ig-settings-avatar-ring img {
  width: 66px;
  height: 66px;
  display: block;
  border-radius: 999px;
  object-fit: cover;
  background: var(--ig-bg);
  padding: 2px;
}
.ig-settings-profile-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.ig-settings-profile-copy strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-settings-profile-copy em { font-style: normal; color: var(--ig-muted); font-size: 12px; }
.ig-settings-profile-copy small { color: var(--ig-blue); font-weight: 800; font-size: 11px; }
.ig-settings-camera {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--ig-blue);
  color: #fff;
  font-weight: 900;
}
.ig-settings-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ig-line);
  border-radius: 14px;
  overflow: hidden;
  width: calc(100% - 24px);
  margin-bottom: 4px;
}
.ig-settings-stats div {
  text-align: center;
  padding: 10px 6px;
  border-right: 1px solid var(--ig-line);
}
.ig-settings-stats div:last-child { border-right: 0; }
.ig-settings-stats strong { display: block; font-size: 15px; }
.ig-settings-stats span { display: block; color: var(--ig-muted); font-size: 10px; margin-top: 2px; }
.ig-settings-section-title {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 6px;
  color: var(--ig-muted);
  font-size: 12px;
  font-weight: 900;
}
.ig-settings-list { max-width: 560px; margin: 0 auto; }
.ig-settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ig-settings-row:active { background: rgba(128,128,128,.1); }
.ig-settings-row-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: inherit;
  font-weight: 900;
  font-size: 18px;
}
.ig-settings-row-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.ig-settings-row-copy strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-settings-row-copy em { font-style: normal; font-size: 11px; color: var(--ig-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-settings-row-right { color: var(--ig-muted); font-size: 22px; transform-origin: center; transition: transform .2s ease; }
.ig-settings-row-right.is-open { transform: rotate(90deg); }
.ig-settings-row.is-danger { color: #ed4956; }
.ig-settings-blue { color: var(--ig-blue); font-size: 11px; font-weight: 900; }
.ig-switch {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: #d1d1d6;
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
}
.ig-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: left .2s ease;
}
.ig-switch.is-on { background: var(--ig-blue); }
.ig-switch.is-on i { left: 22px; }
.ig-settings-language-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px 8px;
}
.ig-settings-language-row button,
.ig-settings-tax-row button {
  height: 40px;
  border: 0;
  border-radius: 13px;
  background: var(--ig-soft);
  color: var(--ig-text);
  font-weight: 900;
  font-size: 12px;
}
.ig-settings-language-row button.is-active,
.ig-settings-tax-row button.is-active { background: var(--ig-blue); color: #fff; }
.ig-settings-form-grid {
  display: grid;
  gap: 12px;
  padding: 0 12px;
}
.ig-settings-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ig-settings-field { display: grid; gap: 6px; }
.ig-settings-field span { color: var(--ig-muted); font-size: 11px; font-weight: 900; }
.ig-settings-input-wrap {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--ig-line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--ig-soft) 55%, transparent);
  padding: 0 12px;
}
.ig-settings-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ig-text);
  font-size: 14px;
  font-weight: 700;
}
.ig-settings-input-wrap b { color: var(--ig-muted); font-size: 11px; }
.ig-settings-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}
.ig-settings-mini-grid div,
.ig-settings-pay-card,
.ig-settings-leave-card,
.ig-settings-deduction-card {
  border: 1px solid var(--ig-line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--ig-soft) 42%, transparent);
  padding: 12px;
}
.ig-settings-mini-grid span,
.ig-settings-mini-grid em { display: block; color: var(--ig-muted); font-size: 10px; font-style: normal; }
.ig-settings-mini-grid strong { display: block; font-size: 16px; margin: 4px 0 2px; }
.ig-settings-pay-card {
  display: flex;
  gap: 12px;
  margin: 0 12px;
  border-color: rgba(0,149,246,.25);
  background: linear-gradient(135deg, rgba(155,92,255,.11), rgba(255,61,136,.1), rgba(0,149,246,.1));
}
.ig-settings-pay-card > span {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ig-blue);
  font-weight: 900;
}
.ig-settings-pay-card strong { display: block; color: #0064c8; font-size: 12px; }
.ig-settings-pay-card b { display: block; color: #0064c8; font-size: 24px; margin-top: 3px; }
.ig-settings-pay-card small { display: block; color: rgba(0,100,200,.72); font-size: 10px; line-height: 1.5; }
.ig-settings-advanced-body {
  display: grid;
  gap: 12px;
  padding: 4px 0 10px;
}
.ig-settings-tax-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 12px;
}
.ig-settings-leave-card,
.ig-settings-deduction-card { margin: 0 12px; display: grid; gap: 10px; }
.ig-settings-leave-card strong,
.ig-settings-deduction-card strong { font-size: 12px; }
.ig-settings-leave-card p { color: var(--ig-muted); font-size: 10px; line-height: 1.55; margin: 0; }
.ig-settings-deduction-card div { display: flex; justify-content: space-between; font-size: 12px; color: var(--ig-muted); }
.ig-settings-deduction-card b { color: var(--ig-text); }
.ig-settings-footer {
  color: var(--ig-muted);
  text-align: center;
  font-size: 10px;
  padding: 24px 0 34px;
}
.ig-settings-toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(0,0,0,.86);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.ig-settings-toast.hidden { display: none; }
.ig-settings-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,.42);
  display: flex;
  align-items: flex-end;
}
.ig-settings-sheet,
.ig-settings-action-sheet {
  width: 100%;
  max-height: 82vh;
  background: #fff;
  color: #262626;
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  box-shadow: 0 -20px 80px rgba(0,0,0,.28);
}
.ig-settings-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #d1d1d6;
  margin: 9px auto 10px;
}
.ig-settings-sheet-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 0 12px 12px;
  border-bottom: 1px solid #dbdbdb;
}
.ig-settings-sheet-head button {
  border: 0;
  background: transparent;
  color: #262626;
  font-size: 24px;
}
.ig-settings-sheet-head strong { text-align: center; font-size: 15px; }
.ig-settings-sheet > p {
  text-align: center;
  color: #8e8e8e;
  font-size: 12px;
  margin: 10px 0 6px;
}
.ig-settings-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  overflow-y: auto;
  padding: 12px 18px 24px;
}
.ig-settings-avatar-option {
  position: relative;
  display: grid;
  gap: 5px;
  justify-items: center;
  border: 0;
  background: transparent;
  color: #262626;
  font-size: 10px;
  font-weight: 800;
}
.ig-settings-avatar-option .ig-settings-avatar-ring { background: #efefef; }
.ig-settings-avatar-option.is-active .ig-settings-avatar-ring { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.ig-settings-avatar-option img { width: 62px; height: 62px; }
.ig-settings-avatar-option b {
  position: absolute;
  right: 5px;
  top: 45px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ig-blue);
  border: 2px solid #fff;
}
.ig-settings-confirm-copy { padding: 16px 24px; text-align: center; }
.ig-settings-confirm-copy strong { display: block; font-size: 16px; }
.ig-settings-confirm-copy p { color: #8e8e8e; font-size: 13px; line-height: 1.6; }
.ig-settings-confirm,
.ig-settings-cancel {
  width: 100%;
  height: 50px;
  border: 0;
  border-top: 1px solid #dbdbdb;
  background: #fff;
  color: #0095f6;
  font-weight: 900;
  font-size: 15px;
}
.ig-settings-confirm.is-danger { color: #ed4956; }
.ig-settings-cancel { color: #262626; font-weight: 700; }
@media (min-width: 769px) {
  #settings.ig-settings-panel { padding: 18px !important; }
  .ig-settings-page { border-radius: 30px; min-height: calc(100vh - 54px); box-shadow: 0 20px 70px rgba(0,0,0,.25); }
  .ig-settings-main { height: calc(100vh - 160px); }
}
@media (max-width: 768px) {
  body:has(#settings.ig-settings-panel:not(.hidden)) .app,
  body.settings-ig-mode .app { padding: 0 !important; max-width: none !important; }
  body:has(#settings.ig-settings-panel:not(.hidden)) .layout,
  body.settings-ig-mode .layout { display: block !important; min-height: 100svh; }
  body:has(#settings.ig-settings-panel:not(.hidden)) .sidebar,
  body.settings-ig-mode .sidebar,
  body:has(#settings.ig-settings-panel:not(.hidden)) .main > .header,
  body.settings-ig-mode .main > .header { display: none !important; }
  body:has(#settings.ig-settings-panel:not(.hidden)) .main,
  body.settings-ig-mode .main { display: block !important; min-height: 100svh; }
  body:has(#settings.ig-settings-panel:not(.hidden)) .tab-panel,
  body.settings-ig-mode .tab-panel { min-height: 100svh; }
}

@media (max-width: 768px) {
  body.settings-ig-mode .main .header,
  body.settings-ig-mode .header.card,
  body.settings-ig-mode .top-context,
  body.settings-ig-mode .topbar,
  body.settings-ig-mode .sidebar {
    display: none !important;
  }
  body.settings-ig-mode {
    background: #000;
  }
  body.settings-ig-mode .ig-settings-page {
    min-height: 100svh;
  }
  body.settings-ig-mode #settings {
    display: block !important;
  }
}
@media (max-width: 768px) {
  body.settings-ig-mode .app-topbar {
    display: none !important;
  }
}

/* IG social refresh */
body.ig-social-mode .app-topbar {
  display: none !important;
}
body.ig-social-chat-open .nav.nav-dock {
  display: none !important;
}
body.ig-social-chat-open .content {
  padding-bottom: 0 !important;
}
#friends.ig-social-panel {
  padding: 0 !important;
  margin: 0 !important;
  background: #fff !important;
  color: #262626 !important;
  min-height: 100%;
  overflow: hidden;
}
#friends.ig-social-panel .card,
#friends.ig-social-panel .section {
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
.ig-social-panel .ig-social-screen,
.ig-social-overlay .ig-social-screen {
  --ig-text: #262626;
  --ig-muted: #8e8e8e;
  --ig-border: #efefef;
  --ig-soft: #efefef;
  --ig-blue: #0095f6;
  min-height: calc(100svh - var(--phone-nav-h, 78px));
  width: 100%;
  background: #fff;
  color: var(--ig-text);
  display: flex;
  flex-direction: column;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}
body.ig-social-chat-open .ig-social-panel .ig-social-screen {
  min-height: 100svh;
}
.ig-social-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: #fff;
}
.ig-social-status {
  height: 35px;
  padding: 10px 24px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  flex: 0 0 auto;
}
.ig-social-status > div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ig-social-status svg {
  width: 17px;
  height: 12px;
}
.ig-battery {
  position: relative;
  width: 24px;
  height: 11px;
  border: 1.4px solid currentColor;
  border-radius: 3px;
  display: inline-block;
  margin-left: 2px;
}
.ig-battery::after {
  content: "";
  position: absolute;
  right: -3.5px;
  top: 3px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}
.ig-battery i {
  position: absolute;
  inset: 2px 5px 2px 2px;
  border-radius: 1px;
  background: currentColor;
}
.ig-social-screen svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ig-icon-btn,
.ig-inbox-actions button,
.ig-chat-header button,
.ig-x-btn,
.ig-compose button {
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ig-icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}
.ig-social-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}
.ig-search-header,
.ig-inbox-header,
.ig-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ig-border);
  background: #fff;
  flex: 0 0 auto;
}
.ig-search-box,
.ig-inbox-search label {
  height: 36px;
  border-radius: 10px;
  background: var(--ig-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  flex: 1;
  min-width: 0;
}
.ig-search-box svg,
.ig-inbox-search svg {
  width: 17px;
  height: 17px;
  color: var(--ig-muted);
  stroke-width: 2.5;
}
.ig-search-box input,
.ig-inbox-search input,
.ig-compose input {
  border: 0;
  outline: 0;
  min-width: 0;
  flex: 1;
  background: transparent;
  color: var(--ig-text);
  font-size: 14px;
}
.ig-search-box input::placeholder,
.ig-inbox-search input::placeholder,
.ig-compose input::placeholder {
  color: var(--ig-muted);
}
.ig-search-box button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ig-muted);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-search-box button svg {
  width: 12px;
  height: 12px;
  color: #fff;
}
.ig-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 6px;
  font-size: 14px;
  font-weight: 750;
}
.ig-section-title button {
  border: 0;
  background: transparent;
  color: var(--ig-blue);
  font-size: 12px;
  font-weight: 700;
}
.ig-section-title.with-icon span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ig-section-title.with-icon svg {
  width: 16px;
  height: 16px;
  color: var(--ig-muted);
}
.ig-person-row,
.ig-chat-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ig-text);
  transition: background .16s ease, transform .16s ease;
}
.ig-person-row:active,
.ig-chat-row:active,
.ig-follow-btn:active,
.ig-story:active,
.ig-invite-card button:active {
  transform: scale(.985);
  background: rgba(0,0,0,.04);
}
.ig-person-row.compact {
  padding-top: 8px;
  padding-bottom: 8px;
}
.ig-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ig-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
  background: #fafafa;
}
.ig-avatar b {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #5bd167;
  border: 2px solid #fff;
}
.ig-avatar-sm { width: 36px; height: 36px; }
.ig-avatar-md { width: 48px; height: 48px; }
.ig-avatar-lg { width: 56px; height: 56px; }
.ig-avatar-xl { width: 66px; height: 66px; }
.ig-avatar-story { width: 56px; height: 56px; }
.ig-person-main,
.ig-chat-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.ig-person-account {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.ig-person-account strong,
.ig-chat-main strong {
  font-size: 14px;
  font-weight: 760;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ig-person-main p,
.ig-person-main em,
.ig-chat-main em {
  margin: 0;
  font-style: normal;
  color: var(--ig-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ig-person-main p { font-size: 12px; }
.ig-person-main em { font-size: 11px; }
.ig-chat-main em { font-size: 13px; }
.ig-chat-row.is-unread .ig-chat-main em,
.ig-chat-row.is-unread .ig-chat-main strong {
  color: #262626;
  font-weight: 760;
}
.ig-social-verified {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 auto;
}
.ig-social-verified path:first-child {
  fill: var(--ig-blue);
  stroke: none;
}
.ig-social-verified path:last-child {
  stroke: #fff;
  stroke-width: 2.2;
}
.ig-follow-btn,
.ig-invite-card button {
  border: 0;
  border-radius: 8px;
  background: var(--ig-blue);
  color: #fff;
  min-width: 62px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}
.ig-follow-btn.is-followed {
  background: var(--ig-soft);
  color: #262626;
}
.ig-x-btn {
  width: 30px;
  height: 30px;
  color: var(--ig-muted);
}
.ig-x-btn svg { width: 17px; height: 17px; }
.ig-empty-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 32px 40px;
  color: var(--ig-text);
}
.ig-empty-search.compact { padding: 44px 24px; }
.ig-empty-search > div {
  width: 64px;
  height: 64px;
  border: 2px solid #262626;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.ig-empty-search svg { width: 30px; height: 30px; }
.ig-empty-search strong { font-size: 15px; }
.ig-empty-search p { color: var(--ig-muted); font-size: 12px; max-width: 260px; line-height: 1.6; }
.ig-invite-card {
  margin: 20px 16px 4px;
  border: 1px solid #dbdbdb;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ig-invite-card > span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg,#9B5CFF,#FF3D88);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ig-invite-card div { flex: 1; min-width: 0; }
.ig-invite-card strong { font-size: 13px; display: block; }
.ig-invite-card p { margin: 3px 0 0; color: var(--ig-muted); font-size: 11px; line-height: 1.4; }
.ig-social-footnote {
  color: #c7c7cc;
  font-size: 10px;
  text-align: center;
  padding: 20px 24px 32px;
  margin: 0;
}
.ig-inbox-header {
  justify-content: space-between;
  border-bottom: 0;
}
.ig-inbox-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  font-weight: 760;
}
.ig-inbox-title svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}
.ig-inbox-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.ig-inbox-actions button { width: 24px; height: 24px; }
.ig-inbox-search { padding: 0 16px 8px; }
.ig-inbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 10px;
  font-size: 14px;
}
.ig-inbox-bar button {
  border: 0;
  background: transparent;
  color: var(--ig-muted);
  font-size: 14px;
  font-weight: 750;
}
.ig-story-strip {
  display: flex;
  gap: 14px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 0 0 auto;
}
.ig-story-strip::-webkit-scrollbar { display: none; }
.ig-story {
  width: 64px;
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ig-text);
  padding: 0;
}
.ig-story > span {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(45deg,#F58529,#DD2A7B,#8134AF);
}
.ig-story.is-me > span {
  background: transparent;
  border: 2px dashed #dbdbdb;
  padding: 2px;
}
.ig-story .ig-avatar { width: 100%; height: 100%; }
.ig-story .ig-avatar img { border: 2px solid #fff; }
.ig-story > span > i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--ig-blue);
  border: 2px solid #fff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-style: normal;
  line-height: 1;
}
.ig-story em {
  width: 64px;
  color: var(--ig-text);
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}
.ig-chat-list { padding-bottom: calc(var(--phone-nav-h, 78px) + env(safe-area-inset-bottom)); }
.ig-chat-row {
  padding-top: 8px;
  padding-bottom: 8px;
}
.ig-unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ig-blue);
  flex: 0 0 auto;
}
.ig-camera-link {
  color: #262626;
  display: inline-flex;
}
.ig-camera-link svg { width: 24px; height: 24px; stroke-width: 1.5; }
.ig-chat-header {
  gap: 9px;
  padding: 7px 12px;
}
.ig-chat-header > div:not(.ig-social-status) {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.ig-chat-header strong {
  font-size: 14px;
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ig-chat-header em {
  color: var(--ig-muted);
  font-size: 11px;
  font-style: normal;
}
.ig-chat-header > span {
  flex: 1;
}
.ig-chat-header button:not(.ig-icon-btn) {
  width: 30px;
  height: 30px;
}
.ig-chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  padding: 16px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ig-chat-profile {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 4px 16px 12px;
}
.ig-chat-profile strong { font-size: 15px; }
.ig-chat-profile p { margin: 0; font-size: 12px; color: var(--ig-muted); }
.ig-chat-profile button {
  margin-top: 6px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--ig-soft);
  color: var(--ig-text);
  font-size: 13px;
  font-weight: 750;
}
.ig-chat-time {
  text-align: center;
  color: var(--ig-muted);
  font-size: 11px;
  margin: 6px 0;
}
.ig-msg-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 12px;
  position: relative;
}
.ig-msg-row.me { align-items: flex-end; }
.ig-msg-row.them { align-items: flex-start; }
.ig-msg-bubble {
  max-width: min(270px, 74vw);
  border-radius: 24px;
  padding: 9px 14px;
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-line;
  word-break: break-word;
}
.ig-msg-row.me .ig-msg-bubble {
  color: #fff;
  background: linear-gradient(135deg,#9B5CFF,#FF3D88);
  border-bottom-right-radius: 6px;
}
.ig-msg-row.them .ig-msg-bubble {
  color: #262626;
  background: var(--ig-soft);
  border-bottom-left-radius: 6px;
}
.ig-msg-row em {
  color: var(--ig-muted);
  font-size: 10px;
  font-style: normal;
  padding: 0 8px;
}
.ig-msg-image {
  width: min(220px, 66vw);
  max-height: 260px;
  border-radius: 18px;
  object-fit: cover;
}
.ig-msg-row.reaction b {
  position: absolute;
  right: 18px;
  bottom: -10px;
  padding: 2px 7px;
  border: 1px solid var(--ig-border);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
}
.ig-voice-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(270px, 78vw);
  border-radius: 999px;
  background: var(--ig-soft);
  padding: 8px 12px;
}
.ig-voice-bubble button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-voice-bubble svg {
  width: 11px;
  height: 13px;
  fill: #111;
  stroke: none;
}
.ig-voice-bubble span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 26px;
}
.ig-voice-bubble i {
  width: 2px;
  border-radius: 999px;
  background: rgba(38,38,38,.62);
}
.ig-voice-bubble em {
  color: #262626;
  font-size: 12px;
  font-style: normal;
}
.ig-seen-label {
  align-self: flex-end;
  color: var(--ig-muted);
  font-size: 11px;
  padding: 4px 18px 0;
}
.ig-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ig-border);
  background: #fff;
  flex: 0 0 auto;
}
.ig-compose-camera {
  width: 38px;
  height: 38px;
  border-radius: 999px !important;
  background: var(--ig-blue) !important;
  color: #fff !important;
  flex: 0 0 auto;
}
.ig-compose-camera svg { width: 20px; height: 20px; stroke-width: 2; }
.ig-compose label {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 1px solid #dbdbdb;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}
.ig-compose label span {
  color: #262626;
  display: inline-flex;
}
.ig-compose label svg { width: 20px; height: 20px; }
.ig-compose-send {
  min-width: 34px;
  height: 34px;
  color: #262626;
  font-size: 13px;
  font-weight: 800;
}
.ig-compose-send.has-text {
  color: var(--ig-blue);
  padding: 0 6px;
}
.ig-home-indicator {
  width: 134px;
  height: 5px;
  border-radius: 999px;
  background: #000;
  align-self: center;
  margin: 4px 0 8px;
  flex: 0 0 auto;
}
.ig-social-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 950;
  max-width: min(320px, 86vw);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.88);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 18px 38px rgba(0,0,0,.24);
  backdrop-filter: blur(14px);
}
@media (min-width: 860px) {
  .ig-social-panel .ig-social-screen {
    max-width: 520px;
    margin: 0 auto;
    min-height: min(820px, calc(100svh - 30px));
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(15,23,42,.16);
    border: 1px solid rgba(15,23,42,.06);
  }
  body.ig-social-chat-open .ig-social-panel .ig-social-screen {
    min-height: min(840px, calc(100svh - 30px));
  }
  #friends.ig-social-panel {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg,#f8fafc,#eef2ff) !important;
    min-height: calc(100svh - 96px);
  }
}
@media (max-width: 680px) {
  #friends.ig-social-panel {
    min-height: 100svh;
  }
  .ig-social-panel .ig-social-screen,
  .ig-social-overlay .ig-social-screen {
    min-height: calc(100svh - var(--phone-nav-h, 78px));
  }
  body.ig-social-chat-open .ig-social-panel .ig-social-screen {
    min-height: 100svh;
  }
  body.ig-social-mode #mainApp {
    background: #fff !important;
  }
  body.ig-social-mode .content {
    padding: 0 !important;
  }
}

/* DM Refresh */
.ig-dm-screen {
  position: relative;
}
.ig-dm-header,
.ig-dm-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ig-border);
  background: #fff;
  flex: 0 0 auto;
}
.ig-dm-header strong,
.ig-dm-chat-header strong {
  font-size: 17px;
  font-weight: 760;
}
.ig-dm-header-actions,
.ig-dm-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ig-dm-header-actions button,
.ig-dm-chat-actions button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #262626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-dm-chat-left {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.ig-dm-chat-left > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.ig-dm-chat-left em {
  color: var(--ig-muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-dm-me-strip {
  margin: 0 12px 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: linear-gradient(90deg, #ffe0f0 0%, #e0f0ff 100%);
  color: #262626;
}
.ig-dm-me-strip > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.ig-dm-me-strip strong {
  font-size: 13px;
  font-weight: 760;
}
.ig-dm-me-strip em {
  color: var(--ig-muted);
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-dm-list {
  padding-bottom: calc(var(--phone-nav-h, 78px) + env(safe-area-inset-bottom));
}
.ig-dm-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: #262626;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 16px;
}
.ig-dm-row:active,
.ig-dm-me-strip:active,
.ig-dm-empty button:active,
.ig-dm-avatar-option:active {
  transform: scale(.985);
}
.ig-dm-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}
.ig-dm-meta strong {
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-dm-meta em {
  color: var(--ig-muted);
  font-size: 13px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-dm-meta em.is-unread {
  color: #262626;
  font-weight: 600;
}
.ig-dm-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ig-blue);
  flex: 0 0 auto;
}
.ig-dm-avatar {
  --avatar-size: 48px;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 999px;
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-dm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 999px;
  background: #fafafa;
}
.ig-dm-avatar.is-ring {
  padding: 2px;
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 45%, #8134af 100%);
}
.ig-dm-avatar.is-ring img {
  border: 2px solid #fff;
}
.ig-dm-avatar b {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #5bd167;
  border: 2px solid #fff;
}
.ig-dm-thread {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ig-dm-thread-intro {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 4px 16px 12px;
}
.ig-dm-thread-intro strong {
  font-size: 15px;
  font-weight: 760;
}
.ig-dm-thread-intro p {
  margin: 0;
  color: var(--ig-muted);
  font-size: 12px;
  text-align: center;
}
.ig-dm-first-message {
  margin: 0;
  padding: 14px 16px 28px;
  text-align: center;
  color: #c7c7cc;
  font-size: 12px;
}
.ig-dm-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 0 12px;
}
.ig-dm-bubble-row.is-me {
  justify-content: flex-end;
}
.ig-dm-bubble-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: min(260px, 72vw);
}
.ig-dm-bubble-stack.align-end {
  align-items: flex-end;
}
.ig-dm-bubble {
  padding: 9px 14px;
  border-radius: 24px;
  background: #efefef;
  color: #262626;
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-line;
  word-break: break-word;
}
.ig-dm-bubble.is-me {
  color: #fff;
  background: linear-gradient(135deg, #9b5cff, #ff3d88);
  border-bottom-right-radius: 6px;
}
.ig-dm-bubble-row:not(.is-me) .ig-dm-bubble {
  border-bottom-left-radius: 6px;
}
.ig-dm-bubble-stack em {
  color: var(--ig-muted);
  font-size: 10px;
  font-style: normal;
  padding: 0 8px;
}
.ig-dm-image {
  width: min(220px, 66vw);
  max-height: 300px;
  border-radius: 18px;
  object-fit: cover;
  background: #fafafa;
}
.ig-dm-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ig-border);
  background: #fff;
  flex: 0 0 auto;
}
.ig-dm-compose-media {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--ig-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ig-dm-compose-field {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 2px solid rgba(0, 149, 246, .15);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 16px;
}
.ig-dm-compose-field:focus-within {
  border-color: rgba(0, 149, 246, .8);
}
.ig-dm-compose-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #262626;
  font-size: 15px;
}
.ig-dm-compose-field input::placeholder {
  color: var(--ig-muted);
}
.ig-dm-compose-field > span,
.ig-dm-send {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #8e8e8e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ig-dm-send.is-active {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--ig-blue);
  color: #fff;
}
.ig-dm-send.is-active svg {
  width: 16px;
  height: 16px;
}
.ig-dm-empty,
.ig-dm-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 28px 40px;
}
.ig-dm-empty > div {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  border: 2px solid #262626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.ig-dm-empty > div svg {
  width: 34px;
  height: 34px;
}
.ig-dm-empty strong,
.ig-dm-search-empty strong {
  font-size: 18px;
  font-weight: 760;
}
.ig-dm-empty p,
.ig-dm-search-empty p {
  margin: 8px 0 0;
  color: var(--ig-muted);
  font-size: 13px;
  line-height: 1.6;
}
.ig-dm-empty button {
  margin-top: 22px;
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--ig-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.ig-dm-sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, .4);
  display: flex;
  align-items: flex-end;
}
.ig-dm-sheet {
  width: 100%;
  max-height: 88%;
  background: #fff;
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  animation: igDmSlideUp .22s ease-out;
}
.ig-dm-sheet-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ig-border);
}
.ig-dm-sheet-header strong {
  font-size: 15px;
  font-weight: 760;
}
.ig-dm-sheet-header button {
  border: 0;
  background: transparent;
  color: #0095f6;
  font-size: 14px;
  font-weight: 700;
  padding: 0;
}
.ig-dm-sheet-header button:last-child {
  justify-self: end;
}
.ig-dm-sheet-header button:not(.is-active):last-child {
  color: #c7c7cc;
}
.ig-dm-preview {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 16px 8px;
}
.ig-dm-preview strong {
  font-size: 13px;
  font-weight: 760;
}
.ig-dm-preview em {
  color: var(--ig-muted);
  font-style: normal;
  font-size: 11px;
}
.ig-dm-name-wrap {
  padding: 8px 16px;
  display: grid;
  gap: 6px;
}
.ig-dm-name-wrap label,
.ig-dm-grid-head span {
  color: var(--ig-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ig-dm-name-wrap input {
  height: 44px;
  border: 0;
  outline: 0;
  border-radius: 12px;
  background: #efefef;
  padding: 0 12px;
  font-size: 15px;
  color: #262626;
}
.ig-dm-grid-head {
  padding: 10px 16px 8px;
}
.ig-dm-avatar-grid {
  padding: 0 16px 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  overflow-y: auto;
}
.ig-dm-avatar-option {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 0;
  background: transparent;
  padding: 0;
}
.ig-dm-avatar-option.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px #0095f6;
}
.ig-dm-avatar-option .grid-avatar {
  width: 100%;
  height: 100%;
}
.ig-dm-avatar-check {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #0095f6;
  color: #fff;
  border: 2px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-dm-avatar-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.8;
}
@keyframes igDmSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes igDmPopUp {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.ig-dm-discover-screen {
  background: #fafafa;
}
.ig-dm-gradient-head {
  padding-bottom: 14px;
  background: linear-gradient(135deg, #ff8fb1 0%, #c66cd8 52%, #7c5bff 100%);
}
.ig-dm-headbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 2px;
  color: #fff;
}
.ig-dm-head-btn {
  color: #fff;
}
.ig-dm-head-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}
.ig-dm-head-title svg {
  width: 20px;
  height: 20px;
}
.ig-dm-me-strip {
  margin: 10px 12px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(69, 44, 132, .12);
}
.ig-dm-me-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
}
.ig-dm-me-avatar-wrap i {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #0095f6;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-dm-me-avatar-wrap i svg {
  width: 9px;
  height: 9px;
  stroke-width: 2.8;
}
.ig-dm-me-strip strong {
  display: block;
}
.ig-dm-me-strip b {
  color: #c66cd8;
  display: inline-flex;
  margin-left: auto;
}
.ig-dm-me-strip b svg {
  width: 16px;
  height: 16px;
}
.ig-dm-gradient-head .ig-dm-toolbar {
  padding: 12px 12px 0;
}
.ig-dm-gradient-head .ig-inbox-search label {
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 8px 18px rgba(69, 44, 132, .1);
}
.ig-dm-tabs {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-bottom: 1px solid #efefef;
  position: sticky;
  top: 0;
  z-index: 8;
}
.ig-dm-tab {
  position: relative;
  flex: 1;
  height: 48px;
  border: 0;
  background: transparent;
  color: #8e8e8e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}
.ig-dm-tab.is-active {
  color: #262626;
}
.ig-dm-tab svg {
  width: 16px;
  height: 16px;
}
.ig-dm-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.ig-dm-tab-badge.is-subtle {
  background: #5bd167;
}
.ig-dm-tab b {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #9b5cff 0%, #ff3d88 100%);
}
.ig-dm-discover-body {
  padding: 12px 12px calc(var(--phone-nav-h, 78px) + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
}
.ig-dm-section-card {
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}
.ig-dm-section-label {
  margin: 0;
  padding: 14px 16px 8px;
  color: #8e8e8e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ig-dm-online-card {
  padding-bottom: 6px;
}
.ig-dm-online-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 10px;
  scrollbar-width: none;
}
.ig-dm-online-strip::-webkit-scrollbar {
  display: none;
}
.ig-dm-online-chip {
  width: 72px;
  border: 0;
  background: transparent;
  color: #262626;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0;
  flex: 0 0 auto;
}
.ig-dm-online-avatar {
  position: relative;
}
.ig-dm-online-ring {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd23f 0%, #ff6b9d 50%, #9b5cff 100%);
}
.ig-dm-online-ring.is-green {
  background: linear-gradient(135deg, #5bd167 0%, #0095f6 100%);
}
.ig-dm-online-ring .ig-dm-avatar {
  padding: 2px;
  background: #fff;
}
.ig-dm-online-chip i {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #5bd167;
  border: 2px solid #fff;
}
.ig-dm-online-chip em {
  width: 72px;
  font-style: normal;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.ig-dm-row,
.ig-dm-hit-row,
.ig-dm-friend-row {
  width: 100%;
}
.ig-dm-row + .ig-dm-row,
.ig-dm-hit-row + .ig-dm-hit-row,
.ig-dm-friend-row + .ig-dm-friend-row {
  border-top: 1px solid #f5f5f5;
}
.ig-dm-row-avatar,
.ig-dm-friend-avatar {
  position: relative;
  flex: 0 0 auto;
}
.ig-dm-row-online {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #5bd167;
  border: 2px solid #fff;
}
.ig-dm-hit-row {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-align: left;
}
.ig-dm-hit-row span {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}
.ig-dm-hit-row strong {
  font-size: 13px;
  font-weight: 760;
}
.ig-dm-hit-row em {
  color: #8e8e8e;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-dm-hit-row i {
  color: #8e8e8e;
  font-size: 10px;
  font-style: normal;
}
.ig-dm-mark {
  padding: 0 .2em;
  border-radius: 4px;
  background: #ffe45c;
  color: #262626;
}
.ig-dm-friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}
.ig-dm-friend-avatar,
.ig-dm-friend-main,
.ig-dm-friend-btn {
  border: 0;
  background: transparent;
}
.ig-dm-friend-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
  text-align: left;
  color: #262626;
}
.ig-dm-friend-main strong {
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-dm-friend-main em {
  color: #8e8e8e;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-dm-friend-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #9b5cff 0%, #ff3d88 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}
.ig-dm-friend-btn.is-added {
  background: #efefef;
  color: #262626;
}
.ig-dm-friend-btn svg {
  width: 14px;
  height: 14px;
}
.ig-dm-row:active,
.ig-dm-me-strip:active,
.ig-dm-empty button:active,
.ig-dm-avatar-option:active,
.ig-dm-hit-row:active,
.ig-dm-online-chip:active,
.ig-dm-friend-avatar:active,
.ig-dm-friend-main:active,
.ig-dm-friend-btn:active,
.ig-dm-search-empty button:active {
  transform: scale(.985);
}
.ig-dm-empty,
.ig-dm-search-empty {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}
.ig-dm-search-empty.compact {
  padding: 44px 24px;
}
.ig-dm-empty > div.is-gradient {
  border: 0;
  background: linear-gradient(135deg, #ff8fb1 0%, #c66cd8 52%, #7c5bff 100%);
  color: #fff;
}
.ig-dm-empty button,
.ig-dm-search-empty button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(90deg, #9b5cff 0%, #ff3d88 100%);
}
.ig-dm-empty button svg {
  width: 16px;
  height: 16px;
}
.ig-dm-quick-backdrop {
  position: absolute;
  inset: 0;
  z-index: 31;
  background: rgba(0, 0, 0, .5);
  display: grid;
  place-items: center;
  padding: 24px;
}
.ig-dm-quick-dialog {
  width: min(360px, 100%);
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  animation: igDmPopUp .18s ease-out;
}
.ig-dm-quick-top {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 22px 20px 18px;
  color: #fff;
  background: linear-gradient(135deg, #ff8fb1 0%, #c66cd8 52%, #7c5bff 100%);
}
.ig-dm-quick-top strong {
  font-size: 15px;
  font-weight: 800;
}
.ig-dm-quick-top em {
  font-style: normal;
  font-size: 11px;
  opacity: .92;
}
.ig-dm-quick-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}
.ig-dm-quick-body label {
  color: #8e8e8e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ig-dm-quick-body input {
  height: 44px;
  border: 0;
  outline: 0;
  border-radius: 12px;
  background: #efefef;
  color: #262626;
  padding: 0 12px;
  font-size: 15px;
}
.ig-dm-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.ig-dm-quick-actions button {
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #efefef;
  color: #262626;
  font-size: 14px;
  font-weight: 700;
}
.ig-dm-quick-actions button.is-active {
  background: linear-gradient(90deg, #9b5cff 0%, #ff3d88 100%);
  color: #fff;
}

/* iOS Settings refresh */
body.settings-ios-mode .app-topbar,
body.settings-ios-mode .nav.nav-dock {
  display: none !important;
}
body.settings-ios-mode .content,
body.settings-ios-mode .app {
  padding: 0 !important;
  max-width: none !important;
}
body.settings-ios-mode .layout {
  display: block !important;
  min-height: 100svh;
}
.ios-home-logo {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#settings.ios-settings-panel {
  padding: 0 !important;
  margin: 0 !important;
  background: #f2f2f7 !important;
  min-height: 100svh;
  overflow: hidden;
}
.ios-settings-page {
  --ios-bg: #f2f2f7;
  --ios-card: #fff;
  --ios-text: #262626;
  --ios-muted: #8e8e93;
  --ios-line: #f2f2f7;
  --ios-blue: #0095f6;
  min-height: 100svh;
  width: 100%;
  background: var(--ios-bg);
  color: var(--ios-text);
  display: flex;
  flex-direction: column;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}
.ios-settings-page svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ios-settings-status {
  height: 35px;
  padding: 10px 24px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ios-card);
  font-size: 15px;
  font-weight: 700;
  color: #000;
  flex: 0 0 auto;
}
.ios-settings-status > div {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ios-settings-status svg {
  width: 17px;
  height: 12px;
}
.ios-settings-battery {
  position: relative;
  width: 24px;
  height: 11px;
  border: 1.4px solid currentColor;
  border-radius: 3px;
  display: inline-block;
  margin-left: 2px;
}
.ios-settings-battery::after {
  content: "";
  position: absolute;
  right: -3.5px;
  top: 3px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}
.ios-settings-battery i {
  position: absolute;
  inset: 2px 5px 2px 2px;
  border-radius: 1px;
  background: currentColor;
}
.ios-settings-header {
  flex: 0 0 auto;
  background: var(--ios-card);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 45px;
  padding: 4px 12px 8px;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.ios-settings-header button {
  border: 0;
  background: transparent;
  color: var(--ios-blue);
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  font-size: 15px;
  cursor: pointer;
}
.ios-settings-header button svg {
  width: 25px;
  height: 25px;
  stroke-width: 2.2;
}
.ios-settings-header .ios-settings-save {
  justify-self: end;
  font-weight: 700;
}
.ios-settings-header strong {
  font-size: 15px;
  font-weight: 720;
}
.ios-settings-search {
  flex: 0 0 auto;
  background: var(--ios-card);
  padding: 0 16px 12px;
}
.ios-settings-search label {
  height: 36px;
  border-radius: 10px;
  background: #efeff4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.ios-settings-search svg {
  color: var(--ios-muted);
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}
.ios-settings-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ios-text);
  font-size: 14px;
}
.ios-settings-search input::placeholder {
  color: var(--ios-muted);
}
.ios-settings-search button {
  border: 0;
  background: transparent;
  color: var(--ios-muted);
  display: flex;
}
.ios-settings-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.ios-settings-profile {
  width: 100%;
  border: 0;
  background: var(--ios-card);
  margin-top: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ios-text);
  text-align: left;
  cursor: pointer;
}
.ios-settings-profile:active,
.ios-settings-row:active {
  background: #fafafa;
}
.ios-settings-profile > span:first-child {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(45deg,#f58529,#dd2a7b,#8134af);
  flex: 0 0 auto;
}
.ios-settings-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #fff;
}
.ios-settings-profile div {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.ios-settings-profile strong {
  font-size: 15px;
  font-weight: 720;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ios-settings-profile em {
  color: var(--ios-muted);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ios-settings-profile > svg {
  color: #c7c7cc;
}
.ios-settings-section {
  margin-top: 20px;
}
.ios-settings-section > p {
  margin: 0;
  padding: 0 16px 6px;
  color: var(--ios-muted);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: .02em;
}
.ios-settings-list {
  background: var(--ios-card);
}
.ios-settings-row {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--ios-line);
  background: var(--ios-card);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: var(--ios-text);
  text-align: left;
  cursor: pointer;
}
.ios-settings-row.is-last {
  border-bottom: 0;
}
.ios-settings-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--row-bg);
  color: var(--row-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ios-settings-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}
.ios-settings-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: currentColor;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ios-settings-row.is-danger {
  color: #ff3b30;
  font-weight: 700;
}
.ios-settings-right {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #c7c7cc;
  font-size: 13px;
  flex: 0 0 auto;
}
.ios-settings-right.is-open svg {
  transform: rotate(90deg);
}
.ios-settings-value {
  color: var(--ios-muted);
  font-size: 13px;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ios-settings-switch {
  width: 51px;
  height: 31px;
  border: 0;
  border-radius: 999px;
  background: #e9e9eb;
  padding: 2px;
  transition: background .18s ease;
}
.ios-settings-switch i {
  display: block;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
  transform: translateX(0);
  transition: transform .18s ease;
}
.ios-settings-switch.is-on {
  background: #34c759;
}
.ios-settings-switch.is-on i {
  transform: translateX(20px);
}
.ios-settings-advanced {
  display: grid;
  gap: 12px;
  background: var(--ios-card);
  padding: 12px 16px 14px;
  border-top: 1px solid var(--ios-line);
}
.ios-settings-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ios-settings-segment button {
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #efeff4;
  color: var(--ios-text);
  font-size: 12px;
  font-weight: 750;
}
.ios-settings-segment button.is-active {
  background: var(--ios-blue);
  color: #fff;
}
.ios-settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ios-settings-field {
  display: grid;
  gap: 5px;
}
.ios-settings-field span {
  color: var(--ios-muted);
  font-size: 11px;
  font-weight: 760;
}
.ios-settings-field div {
  height: 42px;
  border-radius: 12px;
  background: #f7f7f8;
  border: 1px solid #ededf0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
}
.ios-settings-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ios-text);
  font-size: 13px;
}
.ios-settings-field b {
  color: var(--ios-muted);
  font-size: 10px;
}
.ios-settings-quota,
.ios-settings-deductions,
.ios-settings-summary {
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5e5ea;
  padding: 12px;
}
.ios-settings-quota strong,
.ios-settings-deductions strong,
.ios-settings-summary strong {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
}
.ios-settings-quota p,
.ios-settings-summary p {
  margin: 7px 0 0;
  color: var(--ios-muted);
  font-size: 11px;
  line-height: 1.55;
}
.ios-settings-deductions div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ios-muted);
  font-size: 12px;
  padding: 3px 0;
}
.ios-settings-deductions b {
  color: var(--ios-text);
}
.ios-settings-summary {
  margin: 18px 16px 0;
}
.ios-settings-version {
  margin: 0;
  padding: 20px 16px 26px;
  text-align: center;
  color: #c7c7cc;
  font-size: 11px;
}
.ios-settings-toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 930;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(0,0,0,.88);
  color: #fff;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 16px 34px rgba(0,0,0,.24);
}
.ios-settings-toast.hidden {
  display: none;
}
.ios-settings-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 920;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: flex-end;
}
.ios-settings-sheet,
.ios-settings-action-sheet {
  width: 100%;
  max-height: 82svh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  animation: iosSettingsSheet .22s ease-out;
}
.ios-settings-sheet > i,
.ios-settings-action-sheet > i {
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #d1d1d6;
  margin: 8px auto 6px;
}
.ios-settings-sheet header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  padding: 8px 14px 10px;
  border-bottom: 1px solid #efeff4;
}
.ios-settings-sheet header button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #262626;
}
.ios-settings-sheet header strong {
  text-align: center;
  font-size: 15px;
}
.ios-settings-sheet > p {
  margin: 0;
  padding: 10px 16px 4px;
  color: var(--ios-muted);
  text-align: center;
  font-size: 12px;
}
.ios-settings-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  padding: 12px 16px 20px;
}
.ios-settings-avatar-grid button {
  border: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 5px;
  position: relative;
}
.ios-settings-avatar-grid span {
  width: 66px;
  height: 66px;
  border-radius: 999px;
  padding: 2px;
  background: #efeff4;
}
.ios-settings-avatar-grid button.is-active span {
  background: linear-gradient(45deg,#f58529,#dd2a7b,#8134af);
}
.ios-settings-avatar-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  border: 2px solid #fff;
}
.ios-settings-avatar-grid em {
  max-width: 72px;
  color: var(--ios-muted);
  font-size: 10px;
  font-style: normal;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ios-settings-action-sheet div {
  padding: 16px 24px;
  text-align: center;
}
.ios-settings-action-sheet strong {
  display: block;
  font-size: 16px;
}
.ios-settings-action-sheet p {
  margin: 8px 0 0;
  color: var(--ios-muted);
  font-size: 13px;
  line-height: 1.55;
}
.ios-settings-action-sheet button {
  width: 100%;
  height: 50px;
  border: 0;
  border-top: 1px solid #efeff4;
  background: #fff;
  color: var(--ios-blue);
  font-size: 15px;
  font-weight: 800;
}
.ios-settings-action-sheet button.is-danger {
  color: #ff3b30;
}
@keyframes iosSettingsSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@media (min-width: 860px) {
  #settings.ios-settings-panel {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg,#f8fafc,#eef2ff) !important;
    padding: 18px !important;
  }
  .ios-settings-page {
    max-width: 480px;
    min-height: min(840px, calc(100svh - 36px));
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(15,23,42,.2);
  }
}
@media (max-width: 390px) {
  .ios-settings-form-grid {
    grid-template-columns: 1fr;
  }
  .ios-settings-value {
    max-width: 112px;
  }
}

/* DM App Refresh 2026-04-25 */
.ig-social-status-dark {
  color: #fff;
  background: linear-gradient(90deg, #ff8fb1 0%, #c66cd8 52%, #7c5bff 100%);
}
.ig-login-screen,
.ig-profile-page,
.ig-dm-app-shell {
  background: #fff;
}
.ig-login-lang {
  display: flex;
  justify-content: center;
  padding-top: 22px;
}
.ig-login-lang-btn {
  border: 0;
  background: transparent;
  color: #8e8e8e;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ig-login-lang-btn svg {
  width: 12px;
  height: 12px;
}
.ig-login-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 40px 24px;
}
.ig-login-logo {
  margin: 0 0 48px;
  font-size: 52px;
  line-height: 1;
  font-family: 'Billabong', 'Dancing Script', 'Pacifico', cursive;
  background: linear-gradient(90deg, #ff8fb1 0%, #c66cd8 52%, #7c5bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}
.ig-login-fields {
  width: 100%;
  display: grid;
  gap: 10px;
}
.ig-login-input {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid #dbdbdb;
  background: #fafafa;
  padding: 0 12px;
  font-size: 13px;
  color: #262626;
  box-shadow: none !important;
}
.ig-login-input:focus {
  outline: none;
  border-color: #a8a8a8;
}
.ig-login-btn {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(90deg, #9b5cff 0%, #ff3d88 100%);
}
.ig-login-btn.is-disabled {
  opacity: .5;
}
.ig-login-btn.is-active:active {
  transform: scale(.99);
}
.ig-login-help {
  margin: 24px 0 0;
  font-size: 12px;
  display: flex;
  gap: 4px;
}
.ig-login-help span {
  color: #8e8e8e;
}
.ig-login-help strong {
  font-weight: 700;
}
.ig-login-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}
.ig-login-divider i {
  flex: 1;
  height: 1px;
  background: #dbdbdb;
}
.ig-login-divider span {
  color: #8e8e8e;
  font-size: 11px;
  font-weight: 700;
}
.ig-login-fb {
  margin-top: 20px;
  border: 0;
  background: transparent;
  color: #385185;
  font-size: 13px;
  font-weight: 700;
}
.ig-login-footer {
  border-top: 1px solid #dbdbdb;
  padding: 20px 0;
  text-align: center;
  font-size: 12px;
}
.ig-login-footer strong {
  margin-left: 4px;
  color: #0095f6;
  font-weight: 700;
}
.ig-inbox-shell {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ig-inbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  color: #fff;
  background: linear-gradient(90deg, #ff8fb1 0%, #c66cd8 52%, #7c5bff 100%);
}
.ig-inbox-topbtn {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
}
.ig-inbox-center {
  border: 0;
  background: transparent;
  color: inherit;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 800;
}
.ig-inbox-center svg {
  width: 16px;
  height: 16px;
}
.ig-inbox-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
}
.ig-dm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 12px;
}
.ig-dm-toolbar .ig-inbox-search {
  flex: 1;
  padding: 0;
}
.ig-dm-toolbar .ig-inbox-search label {
  height: 40px;
  border-radius: 12px;
}
.ig-dm-toolbar .ig-inbox-search button {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: #8e8e8e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-dm-toolbar .ig-inbox-search button svg {
  width: 10px;
  height: 10px;
  color: #fff;
}
.ig-dm-add-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #9b5cff 0%, #ff3d88 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ig-dm-add-btn:active {
  transform: scale(.96);
}
.ig-inbox-menu-layer {
  position: absolute;
  inset: 44px 0 0;
  z-index: 18;
}
.ig-inbox-menu-backdrop {
  position: absolute;
  inset: 0;
}
.ig-inbox-menu {
  position: absolute;
  top: 8px;
  left: 50%;
  width: min(260px, calc(100vw - 32px));
  transform: translateX(-50%);
  border-radius: 22px;
  border: 1px solid #efefef;
  background: #fff;
  box-shadow: 0 24px 44px rgba(15, 23, 42, .18);
  overflow: hidden;
}
.ig-inbox-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #efefef;
}
.ig-inbox-menu-head span {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.ig-inbox-menu-head strong {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-inbox-menu-head em {
  font-style: normal;
  color: #8e8e8e;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-inbox-menu-head i {
  color: #0095f6;
  display: inline-flex;
}
.ig-inbox-menu-head i svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.6;
}
.ig-inbox-menu-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: #262626;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13px;
  text-align: left;
}
.ig-inbox-menu-row.is-danger {
  color: #ed4956;
  border-top: 1px solid #efefef;
  font-weight: 700;
}
.ig-inbox-menu-row:active {
  background: #fafafa;
}
.ig-profile-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.ig-profile-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #efefef;
}
.ig-profile-header button {
  border: 0;
  background: transparent;
  color: #0095f6;
  font-size: 15px;
  font-weight: 700;
  justify-self: start;
  padding: 0;
}
.ig-profile-header strong {
  font-size: 16px;
  font-weight: 800;
}
.ig-profile-avatar-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 18px;
}
.ig-profile-avatar-btn {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
}
.ig-profile-avatar-btn > span {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #0095f6;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-profile-avatar-btn > span svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}
.ig-profile-change {
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: #0095f6;
  font-size: 14px;
  font-weight: 700;
}
.ig-profile-rows {
  border-top: 1px solid #efefef;
  border-bottom: 1px solid #efefef;
}
.ig-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.ig-profile-row + .ig-profile-row {
  border-top: 1px solid #efefef;
}
.ig-profile-row span {
  width: 96px;
  flex: 0 0 auto;
  color: #8e8e8e;
  font-size: 13px;
}
.ig-profile-row strong {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: #262626;
}
.ig-profile-row strong.is-muted {
  color: #8e8e8e;
}
.ig-profile-actions {
  padding: 24px 16px 0;
}
.ig-profile-logout {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid #efefef;
  background: #fafafa;
  color: #ed4956;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ig-profile-spacer {
  flex: 1;
}
.ig-profile-picker-backdrop {
  position: absolute;
  inset: 0;
  z-index: 32;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: flex-end;
}
.ig-profile-picker {
  width: 100%;
  max-height: 70%;
  border-radius: 22px 22px 0 0;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.ig-profile-picker-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #efefef;
}
.ig-profile-picker-header button {
  border: 0;
  background: transparent;
  color: #8e8e8e;
  font-size: 14px;
  padding: 0;
}
.ig-profile-picker-header button.is-active,
.ig-profile-picker-header button:last-child {
  color: #0095f6;
  font-weight: 800;
}
.ig-profile-picker-header strong {
  font-size: 15px;
  font-weight: 800;
}
.ig-profile-picker-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 14px 18px;
}
.ig-profile-picker-item {
  border: 0;
  background: transparent;
  border-radius: 16px;
  padding: 6px;
  display: grid;
  justify-items: center;
  gap: 6px;
}
.ig-profile-picker-item.is-active {
  background: linear-gradient(135deg, #ffe0ec 0%, #e0e7ff 100%);
}
.ig-profile-picker-avatar {
  border-radius: 999px;
}
.ig-profile-picker-avatar.is-active {
  box-shadow: 0 0 0 2px #0095f6;
}
.ig-profile-picker-item span {
  width: 100%;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   v20260425 IG 流暢度補強（新增功能，不衝突任何既有規則）
   ============================================================ */



/* 3. iPhone 字體（覆蓋 Inter，更原生）*/
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* 5. 卡片陰影升級（iOS 雙層光感）*/
@media (max-width: 768px) {
  #appShellContent .card {
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04) !important;
    border-radius: 18px !important;
  }
}

/* 6. 點擊 scale 反饋（補強 iOS 觸感）*/
@media (max-width: 768px) {
  #mainApp .nav.nav-dock .tab-btn,
  #mainApp .top-icon-btn {
    transition: transform .12s cubic-bezier(.22,.61,.36,1) !important;
  }
  #mainApp .nav.nav-dock .tab-btn:active,
  #mainApp .top-icon-btn:active {
    transform: scale(.92) !important;
  }
}

/* 7. 漸層 logo 升級為 IG 三色 */
@media (max-width: 768px) {
  #mainApp .app-brand-title {
    background: linear-gradient(135deg, #0095F6 0%, #7C5BFF 60%, #FF3D88 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
}



/* ============================================================
   v20260517 mobile stabilization pass
   Reconcile the old 4-tab shell with the newer 5-tab phone app.
   ============================================================ */
:root {
  --phone-nav-h: 56px;
}

@media (max-width: 768px) {

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-template-rows: var(--phone-nav-h) !important;
    min-height: var(--phone-nav-h) !important;
    height: var(--phone-nav-h) !important;
    position: relative;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-btn {
    min-height: var(--phone-nav-h) !important;
    height: var(--phone-nav-h) !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 20% !important;
    height: 2px;
    background: #0095F6;
    border-radius: 0 0 2px 2px;
    transition: transform .26s cubic-bezier(.22,.61,.36,1);
    pointer-events: none;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock:has([data-tab="dashboard"].active)::before  { transform: translateX(0) !important; }
  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock:has([data-tab="attendance"].active)::before { transform: translateX(100%) !important; }
  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock:has([data-tab="calendar"].active)::before   { transform: translateX(200%) !important; }
  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock:has([data-tab="salary"].active)::before     { transform: translateX(300%) !important; }
  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock:has([data-tab="settings"].active)::before   { transform: translateX(400%) !important; }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-icon svg {
    width: 25px !important;
    height: 25px !important;
  }

  #mainApp > .layout > .sidebar.iphone-nav-shell .nav.nav-dock .tab-label {
    font-size: 10px !important;
  }

  body.friends-focus-mode #friends,
  body.friends-focus-mode #friends > .card.section,
  body.friends-focus-mode #friends .dm-shell,
  body.friends-focus-mode #friends .dm-sidebar-card,
  body.friends-focus-mode #friends .dm-thread-card,
  body.friends-focus-mode #friends .dm-thread-panel,
  .ig-social-panel .ig-social-screen {
    min-height: calc(100dvh - var(--phone-nav-h) - env(safe-area-inset-bottom)) !important;
  }

  body.ig-social-chat-open .ig-social-panel .ig-social-screen {
    min-height: 0 !important;
    height: 100% !important;
  }

  .ig-dm-list {
    padding-bottom: calc(var(--phone-nav-h) + env(safe-area-inset-bottom) + 12px);
  }

  body.ig-social-chat-open #mainApp > .layout > .sidebar.iphone-nav-shell {
    display: none !important;
  }

  body.ig-social-chat-open #appShellContent.app-shell-content {
    overflow: hidden !important;
  }

  body.ig-social-chat-open #friends.ig-social-panel,
  body.ig-social-chat-open #friends .ig-social-screen,
  body.ig-social-chat-open #friends .ig-dm-screen {
    height: 100% !important;
    min-height: 0 !important;
  }
}

@media (min-width: 900px) {
  .nav.nav-dock {
    grid-auto-rows: 64px;
  }

  .nav.nav-dock:has(.tab-btn[data-tab="dashboard"].active)::before  { transform: translateY(0) !important; }
  .nav.nav-dock:has(.tab-btn[data-tab="attendance"].active)::before { transform: translateY(64px) !important; }
  .nav.nav-dock:has(.tab-btn[data-tab="calendar"].active)::before   { transform: translateY(128px) !important; }
  .nav.nav-dock:has(.tab-btn[data-tab="salary"].active)::before     { transform: translateY(192px) !important; }
  .nav.nav-dock:has(.tab-btn[data-tab="settings"].active)::before   { transform: translateY(256px) !important; }
}

/* ============================================================
   v20260517 Replit mobile patch adaptation
   Port the useful performance and chat ideas onto the current DOM.
   ============================================================ */
.toast-wrap {
  position: fixed;
  top: max(12px, env(safe-area-inset-top)) !important;
  right: 12px !important;
  bottom: auto !important;
  left: 12px !important;
  min-height: 0;
  height: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 1200;
}
.toast {
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  pointer-events: auto;
}
.toast.error {
  background: rgba(237, 73, 86, .94);
}

@media (max-width: 768px) {
  #mainApp .app-topbar,
  #mainApp .iphone-nav-shell,
  #mainApp .nav.nav-dock::before,
  #appShellContent {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  #mainApp .tab-panel:not(.hidden) {
    animation: ppMobileFade .18s ease-out;
    will-change: opacity;
  }

  @keyframes ppMobileFade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  #appShellContent.app-shell-content {
    contain: layout paint;
    scroll-behavior: auto;
  }

  #appShellContent .card {
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.03) !important;
  }

  #mainApp .tab-btn,
  #mainApp .top-icon-btn,
  #mainApp button {
    transition-duration: .12s;
  }

  #friends.ig-social-panel,
  #friends .ig-social-screen,
  #friends .ig-dm-gradient-head,
  #friends .ig-dm-row {
    contain: layout paint;
  }

  #friends .ig-dm-discover-body {
    min-height: 0;
    overscroll-behavior: contain;
  }

  #friends .ig-dm-row {
    min-height: 68px;
  }

  body.ig-social-chat-open #mainApp .app-topbar,
  body.ig-social-chat-open #mainApp > .layout > .sidebar.iphone-nav-shell {
    display: none !important;
  }

  body.ig-social-chat-open #appShellContent.app-shell-content {
    overflow: hidden !important;
    padding: 0 !important;
  }

  body.ig-social-chat-open #friends.ig-social-panel,
  body.ig-social-chat-open #friends .ig-social-screen,
  body.ig-social-chat-open #friends .ig-dm-screen {
    min-height: 0 !important;
    height: 100% !important;
  }

  body.ig-social-chat-open #igDmThread {
    overscroll-behavior: contain;
    scroll-behavior: auto;
  }

  body.ig-social-chat-open .ig-dm-compose {
    padding-bottom: calc(8px + env(safe-area-inset-bottom) + var(--kb-offset, 0px));
  }

  body.ig-social-chat-open.keyboard-open .ig-home-indicator {
    display: none;
  }

  #igDmDraftInput {
    font-size: 16px;
  }
}

@media (max-width: 380px), (max-height: 700px) {
  #mainApp .nav.nav-dock .tab-label {
    font-size: 9.5px !important;
    letter-spacing: -.2px;
  }

  #mainApp .nav.nav-dock .tab-icon svg {
    width: 23px !important;
    height: 23px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mainApp *,
  #mainApp *::before,
  #mainApp *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   v20260518 security center replacement
   Full account / privacy page adapted to the static production shell.
   ============================================================ */
body.security-center-mode .app-topbar,
body.security-center-mode .nav.nav-dock {
  display: none !important;
}

#settings.security-center-panel {
  padding: 0 !important;
}

.security-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at top right, rgba(124,91,255,.08), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #f6f7fb 100%);
  color: #111827;
}

.security-page svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.security-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 18px 8px;
  font-size: 13px;
  font-weight: 700;
}

.security-status > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.security-status svg {
  width: 16px;
  height: 16px;
}

.security-battery {
  position: relative;
  width: 22px;
  height: 11px;
  border: 1.6px solid currentColor;
  border-radius: 3px;
}

.security-battery::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}

.security-battery i {
  display: block;
  width: 15px;
  height: 7px;
  margin: 1px;
  border-radius: 1.5px;
  background: currentColor;
}

.security-header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 12px;
  background: rgba(248,250,252,.9);
  border-bottom: 1px solid rgba(226,232,240,.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.security-header button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
}

.security-header div {
  display: grid;
  justify-items: center;
}

.security-header strong {
  font-size: 16px;
  font-weight: 800;
}

.security-header em {
  font-size: 11px;
  color: #94a3b8;
  font-style: normal;
}

.security-main {
  display: grid;
  gap: 14px;
  padding: 16px 14px calc(24px + env(safe-area-inset-bottom));
}

.security-section {
  overflow: hidden;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 16px 32px rgba(15,23,42,.05);
}

.security-section > header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 14px 10px;
}

.security-section > header strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.security-section > header em {
  display: block;
  margin-top: 1px;
  color: #94a3b8;
  font-size: 11px;
  font-style: normal;
}

.security-section-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  color: #fff;
}

.security-section-icon.tone-blue { background: #3b82f6; }
.security-section-icon.tone-indigo { background: #6366f1; }
.security-section-icon.tone-violet { background: #8b5cf6; }
.security-section-icon.tone-cyan { background: #06b6d4; }
.security-section-icon.tone-amber { background: #f59e0b; }
.security-section-icon.tone-green { background: #10b981; }
.security-section-icon.tone-slate { background: #64748b; }

.security-section-body {
  display: grid;
  gap: 4px;
  padding: 0 14px 14px;
}

.security-row,
.security-toggle-row,
.security-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border-top: 1px solid #f1f5f9;
}

.security-row:first-child,
.security-toggle-row:first-child,
.security-link:first-child {
  border-top: 0;
}

.security-row > div,
.security-toggle-row > div,
.security-link > span {
  min-width: 0;
}

.security-row strong,
.security-toggle-row strong,
.security-link strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
}

.security-row strong span,
.security-link strong svg {
  color: #64748b;
}

.security-row em,
.security-toggle-row em,
.security-link em {
  display: block;
  margin-top: 3px;
  color: #8a94a3;
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.45;
}

.security-row button {
  flex: none;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  padding: 7px 12px;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.security-sub {
  margin-top: 6px;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.security-sub h4,
.security-sub-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: #475569;
  font-size: 12.5px;
  font-weight: 800;
}

.security-logins {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.security-logins li {
  display: grid;
  gap: 3px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

.security-logins li:first-child {
  border-top: 0;
  padding-top: 0;
}

.security-logins strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.security-logins strong i {
  border-radius: 999px;
  background: #dcfce7;
  padding: 2px 7px;
  color: #166534;
  font-size: 10px;
  font-style: normal;
}

.security-logins span,
.security-empty {
  color: #8a94a3;
  font-size: 11.5px;
}

.security-hint {
  color: #8a94a3;
  font-size: 11.5px;
  line-height: 1.55;
  padding-top: 6px;
}

.security-btn {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  background: #111827;
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
}

.security-btn.is-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.security-btn.is-ghost {
  background: #f1f5f9;
  color: #111827;
}

.security-toggle-row input {
  position: relative;
  width: 42px;
  height: 25px;
  flex: none;
  appearance: none;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background .18s ease;
}

.security-toggle-row input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,.18);
  transition: transform .18s ease;
}

.security-toggle-row input:checked {
  background: #111827;
}

.security-toggle-row input:checked::after {
  transform: translateX(17px);
}

.security-radios {
  display: grid;
  gap: 7px;
  margin-bottom: 6px;
}

.security-radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 11px 12px;
}

.security-radio.is-active {
  border-color: #06b6d4;
  background: #ecfeff;
}

.security-radio input {
  margin-top: 3px;
  accent-color: #06b6d4;
}

.security-radio strong {
  display: block;
  font-size: 13px;
}

.security-radio em {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11.5px;
  font-style: normal;
}

.security-link {
  width: 100%;
  border: 0;
  border-top: 1px solid #f1f5f9;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.security-link > svg {
  flex: none;
  color: #94a3b8;
}

.security-tip {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin-top: 8px;
  border: 1px solid #fde68a;
  border-radius: 14px;
  background: #fffbeb;
  padding: 11px 12px;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

.security-tip svg {
  flex: none;
  margin-top: 1px;
}

.security-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15,23,42,.42);
}

.security-sheet {
  width: min(100%, 520px);
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -18px 50px rgba(15,23,42,.18);
}

.security-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef2f7;
  padding: 15px 16px;
}

.security-sheet > header strong {
  font-size: 15px;
  font-weight: 800;
}

.security-sheet > header button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #f8fafc;
}

.security-sheet > div {
  padding: 15px 16px calc(20px + env(safe-area-inset-bottom));
}

.security-sheet p {
  margin: 0 0 12px;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.security-sheet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.security-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.security-field span {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.security-field input,
.security-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 0 12px;
  color: #111827;
  font-size: 16px;
}

.security-field input {
  height: 44px;
}

.security-field textarea {
  min-height: 88px;
  padding-top: 12px;
  resize: none;
}

.security-strength {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.security-strength.hidden {
  display: none;
}

.security-strength::before {
  content: "";
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
}

.security-strength i {
  position: absolute;
  height: 6px;
  max-width: calc(100% - 80px);
  border-radius: 999px;
}

.security-strength b {
  font-size: 11.5px;
}

.security-rules {
  display: grid;
  gap: 6px;
  margin: 14px 0 6px;
  padding: 0;
  list-style: none;
}

.security-rules li {
  position: relative;
  padding-left: 14px;
  color: #94a3b8;
  font-size: 12px;
}

.security-rules li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
}

.security-rules li.is-ok {
  color: #10b981;
}

.security-rules li.is-ok::before {
  background: #10b981;
}

.security-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.security-chip {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  padding: 8px 14px;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.security-chip.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

@media (min-width: 769px) {
  body.security-center-mode #settings.security-center-panel {
    max-width: 760px;
    margin: 0 auto;
  }
}
