    :root {
      --bg-color: #f4f6f9;
      --card-bg: #ffffff;
      --text-main: #1e293b;
      --text-muted: #64748b;
      --danger: #dc2626;
      --danger-soft: #fef2f2;
      --warning: #d97706;
      --warning-soft: #fffbeb;
      --safe: #059669;
      --safe-soft: #ecfdf5;
      --primary: #1d4ed8;
      --primary-dark: #1e40af;
      --primary-soft: #eff6ff;
      --border: #dbe2ea;
      --purple: #6d28d9;
      --pink: #be185d;
      --teal: #0f766e;
      --sidebar-width: 228px;
      --header-height: 50px;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background-color: var(--bg-color);
      color: var(--text-main);
      line-height: 1.5;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      overflow-x: clip;
      -webkit-font-smoothing: antialiased;
    }

    svg.icon {
      width: 17px;
      height: 17px;
      flex-shrink: 0;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    /* ---------------- TOPBAR HEADER (MENU LEFT, BRAND + BADGES RIGHT) ---------------- */
    header.app-header {
      height: var(--header-height);
      background: #ffffff;
      border-bottom: 1px solid var(--border);
      padding: 0 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 1000;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
      gap: 10px;
    }

    .header-nav-left {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .mobile-menu-btn {
      display: none;
      align-items: center;
      justify-content: center;
      width: 38px;
      height: 38px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: #ffffff;
      color: #0f172a;
      cursor: pointer;
      flex-shrink: 0;
    }
    .mobile-menu-btn:hover { background: #f1f5f9; }

    .role-switcher-container {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .role-switcher-label {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-muted);
      white-space: nowrap;
    }
    .role-switcher {
      display: inline-flex;
      background: #f1f5f9;
      padding: 3px;
      border-radius: 9px;
      border: 1px solid var(--border);
      gap: 3px;
    }
    .role-btn {
      border: 1px solid transparent;
      background: transparent;
      padding: 6px 13px;
      border-radius: 6px;
      font-size: 0.84rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.16s ease;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      color: var(--text-muted);
      white-space: nowrap;
    }
    .role-btn:hover { color: var(--text-main); }
    .role-btn.active-patient {
      background: #ffffff;
      color: #be185d;
      box-shadow: 0 1px 2px rgba(190, 24, 93, 0.12);
      border-color: #fbcfe8;
    }
    .role-btn.active-caregiver {
      background: #ffffff;
      color: #1d4ed8;
      box-shadow: 0 1px 2px rgba(29, 78, 216, 0.12);
      border-color: #bfdbfe;
    }
    .role-btn.active-developer {
      background: #ffffff;
      color: #0f766e;
      box-shadow: 0 1px 2px rgba(15, 118, 110, 0.12);
      border-color: #99f6e4;
    }

    .header-brand-right {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .header-brand-right h1 {
      font-size: 1.08rem;
      font-weight: 800;
      color: #0f172a;
      display: flex;
      align-items: center;
      gap: 7px;
      white-space: nowrap;
    }

    .badge {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 9999px;
      font-size: 0.72rem;
      font-weight: 700;
      white-space: nowrap;
    }
    .badge-fdeia { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
    .badge-asthma { background-color: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
    .badge-req {
      display: inline-block;
      background-color: #fee2e2;
      color: #b91c1c;
      font-size: 0.7rem;
      font-weight: 800;
      padding: 1px 6px;
      border-radius: 4px;
      margin-left: 6px;
      border: 1px solid #fecaca;
    }
    .badge-opt {
      display: inline-block;
      background-color: #f1f5f9;
      color: #64748b;
      font-size: 0.7rem;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 4px;
      margin-left: 6px;
      border: 1px solid #cbd5e1;
    }

    .chk-box {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 15px;
      height: 15px;
      border-radius: 3px;
      vertical-align: -2px;
      margin: 0 3px 0 1px;
      font-size: 0.72rem;
      font-weight: 900;
      line-height: 1;
    }
    .chk-box.chk-checked {
      background-color: #1d4ed8;
      border: 1.5px solid #1e40af;
      color: #ffffff;
    }
    .chk-box.chk-unchecked {
      background-color: #ffffff;
      border: 1.5px solid #94a3b8;
      color: transparent;
    }

    /* ---------------- MAIN LAYOUT: SIDEBAR + CONTENT ---------------- */
    .app-layout {
      display: flex;
      flex: 1;
      min-height: calc(100vh - var(--header-height));
      position: relative;
    }

    .sidebar-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      z-index: 1090;
    }
    .sidebar-backdrop.open { display: block; }

    aside.app-sidebar {
      width: var(--sidebar-width);
      background: #ffffff;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      position: sticky;
      top: var(--header-height);
      height: calc(100vh - var(--header-height));
      overflow-y: auto;
      z-index: 100;
    }
    .sidebar-mobile-header {
      display: none;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
    }
    .sidebar-close-btn {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: #f8fafc;
      color: #334155;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .sidebar-role-card {
      padding: 9px 11px;
      margin: 8px 10px 6px 10px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .sidebar-role-card.patient { background: #fdf2f8; border: 1px solid #fbcfe8; }
    .sidebar-role-card.caregiver { background: #eff6ff; border: 1px solid #bfdbfe; }
    .sidebar-role-card.developer { background: #f0fdf4; border: 1px solid #bbf7d0; }

    .role-avatar {
      font-size: 0.78rem;
      font-weight: 800;
      background: #ffffff;
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(15, 23, 42, 0.08);
      flex-shrink: 0;
      letter-spacing: -0.3px;
    }
    .sidebar-role-card.patient .role-avatar { color: #9d174d; }
    .sidebar-role-card.caregiver .role-avatar { color: #1e40af; }
    .sidebar-role-card.developer .role-avatar { color: #047857; }
    .role-title { font-size: 0.88rem; font-weight: 800; }
    .sidebar-role-card.patient .role-title { color: #9d174d; }
    .sidebar-role-card.caregiver .role-title { color: #1e40af; }
    .sidebar-role-card.developer .role-title { color: #047857; }
    .role-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }

    .sidebar-nav {
      padding: 4px 8px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      flex: 1;
    }
    .nav-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 7px;
      border: none;
      background: transparent;
      color: #334155;
      font-size: 0.84rem;
      font-weight: 600;
      text-align: left;
      cursor: pointer;
      transition: all 0.14s ease;
      width: 100%;
    }
    .nav-item:hover { background: #f1f5f9; color: #0f172a; }
    .nav-item.active { background: #e2e8f0; color: #0f172a; font-weight: 700; }
    .nav-label { flex: 1; }
    .nav-badge {
      font-size: 0.7rem;
      padding: 2px 7px;
      border-radius: 9999px;
      font-weight: 700;
      background: #e2e8f0;
      color: #334155;
    }
    .nav-badge.badge-safe { background: #d1fae5; color: #065f46; }
    .nav-badge.badge-danger { background: #fee2e2; color: #991b1b; }
    .nav-badge.badge-warning { background: #fef3c7; color: #92400e; }

    .sidebar-footer {
      padding: 12px 14px;
      border-top: 1px solid var(--border);
      font-size: 0.74rem;
      color: var(--text-muted);
    }
    .status-dot {
      display: inline-block;
      width: 7px;
      height: 7px;
      border-radius: 50%;
      margin-right: 5px;
    }
    .status-dot.online { background-color: var(--safe); }

    /* Main Content Area */
    main.app-main {
      flex: 1;
      padding: 12px 16px;
      max-width: 1240px;
      width: 100%;
      min-width: 0;
    }

    /* Mobile Bottom Tab Bar */
    nav.mobile-bottom-nav {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: #ffffff;
      border-top: 1px solid var(--border);
      z-index: 950;
      padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
      box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.06);
    }
    .mobile-bottom-nav-inner {
      display: flex;
      justify-content: space-around;
      align-items: stretch;
      gap: 2px;
    }
    .mobile-tab-btn {
      flex: 1;
      border: none;
      background: transparent;
      color: var(--text-muted);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      padding: 6px 2px;
      border-radius: 8px;
      font-size: 0.68rem;
      font-weight: 700;
      cursor: pointer;
    }
    .mobile-tab-btn.active {
      color: var(--primary);
      background: var(--primary-soft);
    }

    /* Welcome / Mode Banners */
    .mode-welcome-banner {
      padding: 7px 11px;
      border-radius: 7px;
      margin-bottom: 10px;
      font-size: 0.8rem;
      display: flex;
      align-items: center;
      gap: 6px;
      line-height: 1.35;
    }
    .patient-banner { background: #fdf2f8; border-left: 4px solid var(--pink); color: #831843; }
    .caregiver-banner { background: #eff6ff; border-left: 4px solid var(--primary); color: #1e3a8a; }
    .developer-banner { background: #f0fdf4; border-left: 4px solid var(--safe); color: #065f46; }

    /* View Panes */
    .view-pane { display: none; animation: fadeIn 0.16s ease-in-out; }
    .view-pane.active-view { display: block; }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(3px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Cards */
    .card {
      background: var(--card-bg);
      border-radius: 9px;
      padding: 12px 14px;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
      border: 1px solid var(--border);
      margin-bottom: 10px;
    }
    .card h2 {
      font-size: 0.96rem;
      margin-bottom: 10px;
      color: #0f172a;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--border);
      padding-bottom: 6px;
      gap: 6px;
      flex-wrap: wrap;
    }
    .card-title-left {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

    /* KPI Stat Boxes */
    .stat-box {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 7px;
      padding: 8px 10px;
    }
    .stat-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
    .stat-value { font-size: 1.12rem; font-weight: 800; color: #0f172a; margin-top: 1px; }
    .stat-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }

    /* Form Inputs */
    .form-group { margin-bottom: 9px; }
    label {
      display: flex;
      align-items: center;
      font-size: 0.8rem;
      font-weight: 700;
      margin-bottom: 3px;
      color: #334155;
      flex-wrap: wrap;
    }
    input[type="text"], input[type="time"], input[type="date"], input[type="number"], select, textarea {
      width: 100%;
      padding: 6px 9px;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      font-size: 0.84rem;
      background-color: #f8fafc;
      color: var(--text-main);
      transition: all 0.16s;
      font-family: inherit;
    }
    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: var(--primary);
      background-color: #ffffff;
      box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
    }
    textarea { min-height: 84px; resize: vertical; line-height: 1.48; }

    .btn {
      background-color: var(--primary);
      color: white;
      border: none;
      padding: 7px 12px;
      border-radius: 6px;
      font-size: 0.83rem;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      transition: all 0.16s;
      text-decoration: none;
      white-space: nowrap;
    }
    .btn:hover { background-color: var(--primary-dark); }
    .btn:disabled { opacity: 0.55; cursor: not-allowed; }
    .btn-secondary { background-color: #475569; }
    .btn-secondary:hover { background-color: #334155; }
    .btn-outline {
      background: #ffffff;
      color: #334155;
      border: 1px solid #cbd5e1;
    }
    .btn-outline:hover { background: #f1f5f9; color: #0f172a; }
    .btn-danger { background-color: var(--danger); }
    .btn-danger:hover { background-color: #b91c1c; }
    .btn-safe { background-color: var(--safe); }
    .btn-safe:hover { background-color: #047857; }
    .btn-ai { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: white; }
    .btn-ai:hover { opacity: 0.92; }
    .btn-sm { padding: 4px 8px; font-size: 0.76rem; border-radius: 5px; }

    /* Timer Styles */
    .timer-display {
      text-align: center;
      padding: 12px 14px;
      border-radius: 10px;
      margin-bottom: 10px;
      transition: all 0.25s ease;
    }
    .timer-danger { background-color: #fff1f2; border: 2px solid var(--danger); color: #9f1239; }
    .timer-caution { background-color: #fffbeb; border: 2px solid var(--warning); color: #92400e; }
    .timer-safe { background-color: #ecfdf5; border: 2px solid var(--safe); color: #065f46; }
    .timer-stopped { background-color: #f8fafc; border: 2px dashed #cbd5e1; color: #64748b; }

    .timer-zone { font-size: 0.88rem; font-weight: 800; letter-spacing: 0.2px; }
    .timer-clock {
      font-size: 2.3rem;
      font-weight: 800;
      letter-spacing: -1px;
      margin: 3px 0;
      font-variant-numeric: tabular-nums;
      line-height: 1.08;
    }
    .timer-target-strip {
      display: inline-flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 4px 12px;
      background: rgba(255, 255, 255, 0.85);
      border: 1px solid rgba(15, 23, 42, 0.1);
      border-radius: 7px;
      padding: 5px 10px;
      margin: 5px auto 4px;
      font-size: 0.79rem;
      color: #0f172a;
    }
    .timer-target-item strong { color: #0f172a; }
    .timer-progress-wrap {
      max-width: 460px;
      margin: 6px auto 4px;
    }
    .timer-progress-bar {
      height: 7px;
      background: rgba(15, 23, 42, 0.1);
      border-radius: 9999px;
      overflow: hidden;
      position: relative;
    }
    .timer-progress-fill {
      height: 100%;
      width: 0%;
      background: currentColor;
      transition: width 0.4s ease;
    }
    .timer-progress-labels {
      display: flex;
      justify-content: space-between;
      font-size: 0.7rem;
      margin-top: 3px;
      opacity: 0.85;
      font-weight: 600;
    }
    .timer-desc { font-size: 0.82rem; margin-top: 3px; font-weight: 600; }
    .timer-meal-row {
      margin-top: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .timer-meal-badge {
      background: rgba(255, 255, 255, 0.92);
      padding: 3px 10px;
      border-radius: 9999px;
      font-size: 0.78rem;
      font-weight: 700;
      border: 1px solid rgba(15, 23, 42, 0.1);
      color: #0f172a;
    }

    /* Allergen Tappable Check Chips & Timer Actions */
    .allergen-chip-grid {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 4px;
    }
    .allergen-check-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 10px;
      margin: 0;
      border-radius: 9999px;
      border: 1.5px solid #cbd5e1;
      background: #ffffff;
      color: #334155;
      font-size: 0.8rem;
      font-weight: 700;
      cursor: pointer;
      user-select: none;
      transition: all 0.15s ease;
    }
    .allergen-check-chip input[type="checkbox"] {
      width: 15px;
      height: 15px;
      accent-color: var(--danger);
      cursor: pointer;
    }
    .allergen-check-chip:has(input:checked) {
      background: #fff1f2;
      border-color: var(--danger);
      color: #9f1239;
    }
    .allergen-check-chip.allergen-chip-alcohol input[type="checkbox"] {
      accent-color: #7c3aed;
    }
    .allergen-check-chip.allergen-chip-alcohol:has(input:checked) {
      background: #f5f3ff;
      border-color: #7c3aed;
      color: #5b21b6;
    }
    .meal-datetime-row {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
    }
    .meal-date-quick {
      display: inline-flex;
      border: 1px solid #cbd5e1;
      border-radius: 7px;
      overflow: hidden;
      background: #ffffff;
      flex-shrink: 0;
    }
    .meal-date-btn {
      border: none;
      background: transparent;
      color: #475569;
      padding: 6px 10px;
      font-size: 0.78rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.14s ease;
    }
    .meal-date-btn + .meal-date-btn {
      border-left: 1px solid #e2e8f0;
    }
    .meal-date-btn.active {
      background: var(--primary);
      color: #ffffff;
    }
    .meal-date-hint {
      margin-top: 5px;
      font-size: 0.76rem;
      padding: 5px 9px;
      border-radius: 6px;
      line-height: 1.4;
    }
    .meal-date-hint.info {
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      color: #1e40af;
    }
    .meal-date-hint.past-mode {
      background: #fefce8;
      border: 1px solid #fde047;
      color: #854d0e;
    }
    .timer-action-row {
      display: flex;
      gap: 8px;
      margin-top: 6px;
      flex-wrap: wrap;
    }
    .timer-primary-cta {
      flex: 1;
      min-width: 180px;
    }

    /* Inline Active Meal Edit Panel */
    .inline-edit-panel {
      background: #f8fafc;
      border: 1px solid #93c5fd;
      border-radius: 7px;
      padding: 9px 11px;
      margin-bottom: 10px;
    }

    .slider-container { display: flex; align-items: center; gap: 10px; }
    .slider-container input[type="range"] { flex: 1; height: 6px; border-radius: 3px; background: #cbd5e1; }
    .slider-val { font-weight: 800; font-size: 0.9rem; color: var(--primary); width: 58px; text-align: right; }

    /* Condition Buttons */
    .condition-group {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 9px 11px;
      margin-bottom: 8px;
    }
    .condition-title {
      font-weight: 800;
      font-size: 0.85rem;
      margin-bottom: 6px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
    }
    .btn-toggle-group { display: flex; gap: 5px; flex-wrap: wrap; }
    .btn-toggle {
      flex: 1;
      min-width: 72px;
      padding: 6px 5px;
      border: 1px solid var(--border);
      background: white;
      border-radius: 6px;
      font-size: 0.79rem;
      font-weight: 700;
      cursor: pointer;
      color: #475569;
      transition: all 0.14s;
      text-align: center;
    }
    .btn-toggle:hover { background-color: #f1f5f9; }
    .btn-toggle.active { background-color: #dbeafe; border-color: var(--primary); color: var(--primary); }
    .btn-toggle.active-danger { background-color: #fee2e2; border-color: var(--danger); color: var(--danger); }

    .switch-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 9px;
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 6px;
      margin-bottom: 4px;
      font-size: 0.82rem;
      font-weight: 600;
      cursor: pointer;
    }
    .switch-label input { width: 17px; height: 17px; cursor: pointer; }

    /* Tooltips */
    .has-tooltip { position: relative; display: inline-flex; align-items: center; cursor: help; }
    .tooltip-icon {
      display: inline-flex;
      justify-content: center;
      align-items: center;
      width: 17px;
      height: 17px;
      background: #f1f5f9;
      color: #64748b;
      border-radius: 50%;
      font-size: 0.7rem;
      font-weight: 800;
      margin-left: 5px;
      border: 1px solid #cbd5e1;
    }
    .has-tooltip:hover .tooltip-icon { background: var(--primary); color: white; border-color: var(--primary); }
    .tooltip-content {
      visibility: hidden;
      opacity: 0;
      width: 270px;
      background-color: #0f172a;
      color: #fff;
      text-align: left;
      border-radius: 7px;
      padding: 9px 12px;
      position: absolute;
      z-index: 2000;
      bottom: 125%;
      left: 50%;
      transform: translateX(-50%);
      transition: opacity 0.18s;
      font-size: 0.78rem;
      font-weight: normal;
      line-height: 1.45;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
      pointer-events: none;
    }
    .has-tooltip:hover .tooltip-content { visibility: visible; opacity: 1; }

    /* Tables */
    .table-container {
      max-height: 360px;
      overflow: auto;
      margin-top: 6px;
      border: 1px solid var(--border);
      border-radius: 7px;
      background: #fff;
    }
    table.data-table { width: 100%; border-collapse: collapse; font-size: 0.79rem; }
    table.data-table th, table.data-table td {
      padding: 5px 8px;
      text-align: left;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
    }
    table.data-table th {
      background: #f1f5f9;
      color: #334155;
      position: sticky;
      top: 0;
      font-weight: 700;
      white-space: nowrap;
      z-index: 1;
    }
    .btn-sm-edit {
      background: #dbeafe;
      color: #1e40af;
      border: none;
      padding: 4px 8px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 0.74rem;
      font-weight: 700;
      margin-right: 4px;
    }
    .btn-sm-edit:hover { background: #bfdbfe; }
    .btn-sm-del {
      background: #fee2e2;
      color: #991b1b;
      border: none;
      padding: 4px 8px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 0.74rem;
      font-weight: 700;
    }
    .btn-sm-del:hover { background: #fecaca; }

    /* Horizontal Bar Chart (Meal Analytics) */
    .bar-row { margin-bottom: 8px; }
    .bar-header {
      display: flex;
      justify-content: space-between;
      font-size: 0.8rem;
      font-weight: 600;
      color: #334155;
      margin-bottom: 3px;
    }
    .bar-track { height: 9px; background: #e2e8f0; border-radius: 9999px; overflow: hidden; }
    .bar-fill { height: 100%; background: var(--primary); border-radius: 9999px; transition: width 0.3s ease; }
    .bar-fill.danger { background: var(--danger); }
    .bar-fill.warning { background: var(--warning); }
    .bar-fill.safe { background: var(--safe); }

    /* Pills */
    .pill {
      font-size: 0.72rem;
      padding: 2px 7px;
      border-radius: 9999px;
      font-weight: 700;
      display: inline-block;
      white-space: nowrap;
    }
    .pill-danger { background: #fee2e2; color: #991b1b; }
    .pill-warning { background: #fef3c7; color: #92400e; }
    .pill-safe { background: #d1fae5; color: #065f46; }
    .pill-neutral { background: #e2e8f0; color: #334155; }
    .pill-info { background: #dbeafe; color: #1e40af; }
    .pill-alcohol { background: #ede9fe; color: #5b21b6; }
    .bar-fill.alcohol { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }

    /* Episode Cards */
    .episode-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
      gap: 8px;
      margin-top: 6px;
    }
    .episode-card {
      border: 1.5px solid var(--border);
      border-radius: 7px;
      padding: 8px 10px;
      background: #f8fafc;
      cursor: pointer;
      transition: all 0.16s;
    }
    .episode-card:hover { border-color: var(--primary); background: #ffffff; }
    .episode-card.selected {
      border-color: var(--primary);
      background: #eff6ff;
      box-shadow: 0 0 0 1px var(--primary);
    }
    .episode-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
    .episode-date { font-weight: 800; font-size: 0.86rem; color: #0f172a; }
    .episode-time { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
    .episode-triggers { font-size: 0.77rem; color: #334155; margin-bottom: 5px; line-height: 1.3; }
    .episode-badges { display: flex; gap: 4px; flex-wrap: wrap; }

    /* Report Mode Switcher */
    .segmented-tabs {
      display: inline-flex;
      background: #e2e8f0;
      padding: 2px;
      border-radius: 7px;
      gap: 2px;
    }
    .seg-btn {
      border: none;
      background: transparent;
      padding: 5px 11px;
      border-radius: 5px;
      font-size: 0.8rem;
      font-weight: 700;
      color: #475569;
      cursor: pointer;
      transition: all 0.15s;
    }
    .seg-btn.active {
      background: #ffffff;
      color: #0f172a;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
    }

    /* Emergency Guide */
    .emergency-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
    .emergency-step-card {
      background: #fff;
      border: 1.5px solid #fecaca;
      border-radius: 8px;
      padding: 10px 12px;
    }
    .step-number {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      background: var(--danger);
      color: white;
      border-radius: 50%;
      font-size: 0.8rem;
      font-weight: 800;
      margin-right: 6px;
    }
    .script-box {
      background: #ffffff;
      border: 1px dashed #94a3b8;
      border-radius: 7px;
      padding: 11px 13px;
      font-size: 0.86rem;
      line-height: 1.55;
      color: #0f172a;
      margin-top: 6px;
    }

    /* ---------------- COMPACT FORMAL CLINICAL DOCUMENT (SINGLE-SCREEN & A4 PAPER) ---------------- */
    .med-report-card {
      background: #ffffff;
      border: 1px solid #94a3b8;
      border-radius: 4px;
      box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
      padding: 16px 20px;
      color: #0f172a;
      font-size: 12.5px;
      line-height: 1.42;
    }
    .med-report-header {
      border-bottom: 2px solid #1e293b;
      padding-bottom: 8px;
      margin-bottom: 10px;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      gap: 10px;
      flex-wrap: wrap;
    }
    .med-report-emblem {
      font-size: 10.5px;
      font-weight: 800;
      color: #1e3a8a;
      text-transform: uppercase;
      letter-spacing: 0.4px;
      margin-bottom: 2px;
    }
    .med-report-title {
      font-size: 15.5px;
      font-weight: 800;
      color: #0f172a;
      line-height: 1.25;
    }
    .med-report-meta-stamp {
      font-size: 11px;
      color: #475569;
      text-align: right;
      white-space: nowrap;
    }
    .med-doctor-notice {
      background: #f8fafc;
      border: 1px solid #cbd5e1;
      border-left: 3px solid #1e40af;
      padding: 6px 10px;
      margin-bottom: 10px;
      font-size: 11.5px;
      color: #1e293b;
      line-height: 1.4;
    }
    .med-h2 {
      font-size: 13px;
      font-weight: 800;
      color: #0f172a;
      margin: 11px 0 5px 0;
      padding: 3px 8px;
      background: #f1f5f9;
      border-left: 3px solid #1e293b;
      border-bottom: 1px solid #cbd5e1;
    }
    .med-h3 {
      font-size: 12px;
      font-weight: 700;
      color: #334155;
      margin: 8px 0 4px 0;
    }
    /* Formal 2-Column Bordered Clinical Metadata Table */
    .med-meta-table {
      width: 100%;
      border-collapse: collapse;
      margin: 4px 0 8px 0;
      border: 1px solid #94a3b8;
      font-size: 12px;
    }
    .med-meta-table th {
      background: #f8fafc;
      color: #334155;
      font-weight: 700;
      text-align: left;
      padding: 4px 8px;
      border: 1px solid #cbd5e1;
      width: 16%;
      white-space: nowrap;
    }
    .med-meta-table td {
      padding: 4px 8px;
      border: 1px solid #cbd5e1;
      color: #0f172a;
      width: 34%;
    }
    .med-bullet { font-size: 12px; padding: 2px 0; color: #1e293b; }
    .med-ol { margin: 4px 0 6px 18px; padding: 0; font-size: 12px; }
    .med-ol li { margin-bottom: 3px; }
    .med-divider { height: 1px; background: #cbd5e1; margin: 8px 0; }
    .report-table-wrapper {
      margin: 5px 0 8px 0;
      border: 1px solid #94a3b8;
      overflow-x: auto;
    }
    .med-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      table-layout: auto;
    }
    .med-table th {
      background: #f1f5f9;
      color: #0f172a;
      padding: 5px 8px;
      font-weight: 800;
      border: 1px solid #cbd5e1;
      text-align: left;
      white-space: nowrap;
    }
    .med-table td {
      padding: 5px 8px;
      border: 1px solid #cbd5e1;
      color: #1e293b;
      vertical-align: top;
      word-break: keep-all;
    }
    .med-cell-label {
      font-weight: 800;
      color: #0f172a;
      margin-top: 4px;
    }
    .med-cell-label:first-child { margin-top: 0; }
    .med-cell-bullet {
      padding-left: 16px;
      text-indent: -10px;
      line-height: 1.48;
    }
    .med-cell-line {
      padding-left: 16px;
      line-height: 1.48;
    }
    .med-table tr:nth-child(even) td { background-color: #fafbfc; }
    .med-badge-inline {
      display: inline-block;
      padding: 1px 6px;
      border-radius: 3px;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    .med-badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
    .med-badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
    .med-badge-safe { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
    .med-badge-neutral { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
    .med-raw-block {
      background: #f8fafc;
      border: 1px solid #cbd5e1;
      border-left: 3px solid #475569;
      border-radius: 4px;
      padding: 10px 12px;
      margin: 6px 0 8px 0;
      font-family: inherit;
      font-size: 11.5px;
      line-height: 1.5;
      color: #1e293b;
      white-space: pre-wrap;
      word-break: break-word;
    }

    /* Pagination Bar for Growing Grids & Tables */
    .pagination-bar {
      display: none;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 8px;
      padding: 6px 2px 2px;
      font-size: 0.78rem;
      color: var(--text-muted);
    }
    .pagination-info strong { color: #0f172a; }
    .pagination-controls {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
    }
    .pagination-pages {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      flex-wrap: wrap;
    }
    .pg-btn {
      min-width: 28px;
      height: 28px;
      padding: 0 7px;
      border: 1px solid var(--border);
      background: #ffffff;
      color: #334155;
      border-radius: 6px;
      font-size: 0.76rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.14s ease;
    }
    .pg-btn:hover:not(:disabled) {
      background: #f1f5f9;
      border-color: #94a3b8;
      color: #0f172a;
    }
    .pg-btn.active {
      background: var(--primary);
      border-color: var(--primary);
      color: #ffffff;
    }
    .pg-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
    .pg-ellipsis {
      padding: 0 3px;
      color: var(--text-muted);
      font-weight: 700;
    }
    select.pg-size-select {
      width: auto;
      height: 28px;
      padding: 2px 7px;
      font-size: 0.75rem;
      font-weight: 600;
      border-radius: 6px;
      background: #ffffff;
    }

    /* ---------------- 14-DAY TREND, PRE-EXERCISE PLANNER & TEMPLATE CHIPS ---------------- */
    .trend-14d-grid {
      display: grid;
      grid-template-columns: repeat(14, minmax(0, 1fr));
      gap: 5px;
      margin: 10px 0;
    }
    .trend-day-tile {
      border: 1.5px solid var(--border);
      border-radius: 7px;
      padding: 6px 3px;
      text-align: center;
      cursor: pointer;
      transition: all 0.14s ease;
      background: #f8fafc;
      color: #64748b;
      user-select: none;
    }
    .trend-day-tile:hover { transform: translateY(-1px); border-color: #94a3b8; }
    .trend-day-tile.trend-safe { background: #ecfdf5; border-color: #86efac; color: #065f46; }
    .trend-day-tile.trend-caution { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
    .trend-day-tile.trend-danger { background: #fff1f2; border-color: #fca5a5; color: #9f1239; }
    .trend-day-tile.selected { box-shadow: 0 0 0 2px var(--primary); border-color: var(--primary); }
    .trend-day-date { font-size: 0.7rem; font-weight: 800; line-height: 1.2; }
    .trend-day-wd { font-size: 0.66rem; opacity: 0.85; }
    .trend-day-cnt { font-size: 0.72rem; font-weight: 800; margin-top: 3px; }
    .trend-legend {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      font-size: 0.73rem;
      color: var(--text-muted);
      align-items: center;
    }
    .trend-dot {
      display: inline-block;
      width: 9px;
      height: 9px;
      border-radius: 3px;
      margin-right: 4px;
      vertical-align: -1px;
    }
    .trend-detail-panel {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px 12px;
      margin-top: 8px;
      font-size: 0.82rem;
    }
    .insight-item {
      background: #eff6ff;
      border-left: 3px solid var(--primary);
      padding: 7px 10px;
      border-radius: 6px;
      font-size: 0.82rem;
      color: #1e3a8a;
      margin-bottom: 6px;
      line-height: 1.45;
    }
    .menu-tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
    .menu-tag {
      font-size: 0.76rem;
      font-weight: 600;
      padding: 4px 9px;
      border-radius: 9999px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .menu-tag-safe { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
    .menu-tag-caution { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }

    .planner-result-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin: 12px 0;
    }
    .planner-box {
      border-radius: 9px;
      padding: 12px 14px;
      border: 1.5px solid var(--border);
      background: #f8fafc;
    }
    .planner-box.highlight-safe { background: #ecfdf5; border-color: #6ee7b7; }
    .planner-box.highlight-danger { background: #fff1f2; border-color: #fca5a5; }
    .planner-box.highlight-info { background: #eff6ff; border-color: #93c5fd; }
    .planner-box-label { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }
    .planner-box-value { font-size: 1.2rem; font-weight: 800; color: #0f172a; margin-top: 3px; }
    .planner-box-sub { font-size: 0.73rem; color: #475569; margin-top: 3px; }

    /* Simplified Meals UX Hero & Spotlight */
    .meal-hero-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 6px;
    }
    .meal-hero-score-wrap {
      display: flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: wrap;
    }
    .meal-hero-pct {
      font-size: 1.65rem;
      font-weight: 900;
      color: var(--safe);
      line-height: 1;
      letter-spacing: -0.5px;
    }
    .meal-hero-pct.meal-hero-empty {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-muted);
      background: #f1f5f9;
      border: 1px solid var(--border);
      padding: 3px 9px;
      border-radius: 9999px;
      letter-spacing: 0;
    }
    .meal-hero-label {
      font-size: 0.88rem;
      font-weight: 700;
      color: #0f172a;
    }
    .meal-hero-sub {
      font-size: 0.77rem;
      color: var(--text-muted);
    }
    .meal-hero-bar {
      height: 8px;
      background: #e2e8f0;
      border-radius: 9999px;
      overflow: hidden;
      margin-bottom: 7px;
    }
    .meal-hero-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, #10b981, #059669);
      border-radius: 9999px;
      transition: width 0.35s ease;
    }
    .meal-hero-tip {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-left: 3px solid var(--primary);
      border-radius: 6px;
      padding: 6px 9px;
      font-size: 0.79rem;
      color: #334155;
      line-height: 1.4;
    }
    .planner-step-row {
      display: flex;
      flex-direction: column;
      gap: 7px;
      margin-bottom: 8px;
    }
    .planner-step-box {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
    }
    .planner-step-title {
      font-size: 0.8rem;
      font-weight: 800;
      color: #1e293b;
      margin-bottom: 5px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      flex-wrap: wrap;
    }
    .planner-spotlight {
      background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
      border: 1.5px solid #6ee7b7;
      border-radius: 9px;
      padding: 11px 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .planner-spotlight-main {
      font-size: 1.1rem;
      font-weight: 900;
      color: #065f46;
      line-height: 1.25;
    }
    .planner-spotlight-sub {
      font-size: 0.79rem;
      color: #334155;
      margin-top: 2px;
    }
    .planner-danger-pill {
      background: #fff1f2;
      border: 1px solid #fecaca;
      color: #9f1239;
      padding: 5px 10px;
      border-radius: 7px;
      font-size: 0.77rem;
      font-weight: 700;
      text-align: right;
    }
    .preset-time-btn {
      border: 1px solid #cbd5e1;
      background: #ffffff;
      color: #334155;
      padding: 4px 8px;
      border-radius: 9999px;
      font-size: 0.75rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.14s ease;
    }
    .preset-time-btn:hover { background: #f1f5f9; }
    .preset-time-btn.active {
      background: var(--primary);
      border-color: var(--primary);
      color: #ffffff;
    }

    /* Flexible Template Memo UI */
    .soft-guide-banner {
      background: #f5f3ff;
      border: 1px solid #ddd6fe;
      border-left: 4px solid var(--purple);
      border-radius: 7px;
      padding: 7px 10px;
      font-size: 0.79rem;
      color: #4c1d95;
      margin-bottom: 8px;
      line-height: 1.4;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
    }
    .tpl-section {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 9px 11px;
      margin-bottom: 8px;
    }
    .tpl-section-title {
      font-size: 0.83rem;
      font-weight: 800;
      color: #1e293b;
      margin-bottom: 6px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .chip-group { display: flex; flex-wrap: wrap; gap: 5px; }
    .chip-btn {
      border: 1px solid #cbd5e1;
      background: #ffffff;
      color: #334155;
      padding: 4px 9px;
      border-radius: 9999px;
      font-size: 0.76rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.14s ease;
    }
    .chip-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
    .chip-btn.active { background: #ede9fe; border-color: #7c3aed; color: #5b21b6; font-weight: 700; }
    .chip-btn.active-danger { background: #fee2e2; border-color: #dc2626; color: #991b1b; font-weight: 700; }
    .chip-btn.active-warning { background: #fef3c7; border-color: #d97706; color: #92400e; font-weight: 700; }
    .chip-btn.active-safe { background: #d1fae5; border-color: #059669; color: #065f46; font-weight: 700; }
    .sym-system-row {
      display: grid;
      grid-template-columns: 118px 1fr;
      gap: 8px;
      align-items: center;
      padding: 6px 0;
      border-bottom: 1px dashed #e2e8f0;
    }
    .sym-system-row:last-child { border-bottom: none; padding-bottom: 0; }
    .sym-system-label { font-size: 0.78rem; font-weight: 800; color: #334155; }
    .tpl-timeline-row {
      display: grid;
      grid-template-columns: 115px 1fr 1fr auto;
      gap: 6px;
      margin-bottom: 6px;
      align-items: center;
    }

    /* ---------------- RESPONSIVE / MOBILE UX (<= 900px) ---------------- */
    @media (max-width: 900px) {
      html {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
      }
      body {
        height: 100%;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: manipulation;
      }
      #appShell {
        height: 100%;
        height: 100dvh;
        min-height: 0 !important;
        overflow: hidden;
        width: 100%;
      }

      .trend-14d-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
      .planner-result-grid { grid-template-columns: 1fr; }
      .planner-spotlight { padding: 13px 14px; }
      .planner-spotlight-main { font-size: 1.08rem; }
      .planner-danger-pill { width: 100%; text-align: left; }
      .sym-system-row { grid-template-columns: 1fr; gap: 5px; }
      .tpl-timeline-row { grid-template-columns: 1fr; }

      header.app-header {
        position: relative;
        top: auto;
        flex-shrink: 0;
        width: 100%;
        height: calc(46px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 8px 0 8px;
        gap: 6px;
      }
      .header-nav-left {
        gap: 6px;
        flex-shrink: 0;
      }
      .mobile-menu-btn {
        display: inline-flex;
        width: 32px;
        height: 32px;
      }
      .role-switcher-label { display: none; }
      .role-switcher {
        padding: 2px;
        gap: 2px;
      }
      .role-btn { padding: 4px 8px; font-size: 0.75rem; }
      .header-brand-right {
        min-width: 0;
        overflow: hidden;
        gap: 6px;
      }

      .app-layout {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        width: 100%;
      }

      aside.app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100%;
        height: 100dvh;
        width: 260px;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 4px 0 20px rgba(15, 23, 42, 0.18);
        overscroll-behavior: contain;
      }
      aside.app-sidebar.mobile-open { transform: translateX(0); }
      .sidebar-mobile-header { display: flex; }

      main.app-main {
        flex: 1;
        min-height: 0;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        padding: 8px 8px 12px;
      }

      nav.mobile-bottom-nav {
        display: block;
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        flex-shrink: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
      }
      .mobile-tab-btn {
        min-height: 44px;
        padding: 5px 2px;
        gap: 2px;
        font-size: 0.68rem;
        border-radius: 10px;
        transition: transform 0.1s ease, background-color 0.15s ease, color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
      }
      .mobile-tab-btn svg.icon {
        width: 19px;
        height: 19px;
      }
      .mobile-tab-btn:active {
        transform: scale(0.94);
      }

      .segmented-tabs {
        display: flex;
        width: 100%;
      }
      .seg-btn {
        flex: 1;
        padding: 7px 6px;
        font-size: 0.78rem;
        text-align: center;
      }

      /* 모바일에서는 중복 안내 배너 숨겨 첫 화면 핵심 기능 즉시 노출 */
      .mode-welcome-banner { display: none !important; }

      /* iOS Safari 입력창 포커스 시 강제 확대(auto-zoom) 방지 */
      input[type="text"], input[type="time"], input[type="date"], input[type="number"], input[type="password"], select, textarea {
        font-size: 16px;
        min-height: 40px;
        padding: 8px 10px;
      }

      .card { padding: 11px; margin-bottom: 8px; border-radius: 12px; }
      .card h2 { font-size: 0.94rem; margin-bottom: 8px; padding-bottom: 6px; }
      .grid-2, .grid-3, .emergency-grid { grid-template-columns: 1fr; gap: 8px; }
      .grid-4 { grid-template-columns: 1fr 1fr; gap: 6px; }

      /* 모바일 타이머 카드: 2x2 목표 시각 그리드 + 풀폭 CTA */
      .timer-display { padding: 12px 10px; margin-bottom: 10px; border-radius: 12px; }
      .timer-clock { font-size: 2.1rem; }
      .timer-target-strip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px 8px;
        width: 100%;
        text-align: left;
        padding: 7px 10px;
        font-size: 0.76rem;
      }
      .allergen-chip-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
      }
      .allergen-check-chip {
        justify-content: center;
        min-height: 40px;
        padding: 6px 4px;
        border-radius: 10px;
        font-size: 0.75rem;
      }
      .timer-action-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-top: 8px;
      }
      .timer-primary-cta {
        grid-column: 1 / -1;
        min-height: 44px;
        font-size: 0.9rem;
        border-radius: 10px;
      }
      .timer-secondary-cta {
        min-height: 40px;
        font-size: 0.8rem;
        border-radius: 9px;
      }

      /* 컨디션 트래커 터치 영역 확대 */
      .btn-toggle-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
      }
      .btn-toggle {
        min-height: 42px;
        padding: 8px 6px;
        font-size: 0.82rem;
        border-radius: 9px;
      }
      .switch-label {
        min-height: 44px;
        padding: 8px 11px;
        border-radius: 9px;
        font-size: 0.84rem;
      }
      .switch-label input { width: 20px; height: 20px; }

      .pagination-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
      }
      .pagination-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      .pagination-controls {
        justify-content: space-between;
      }
      .pg-btn {
        min-width: 34px;
        height: 34px;
        font-size: 0.8rem;
      }
      select.pg-size-select {
        min-height: 34px;
        height: 34px;
        font-size: 0.8rem;
        padding: 2px 8px;
      }

      .med-report-card { padding: 10px; font-size: 11.5px; }
      .med-meta-table th, .med-meta-table td { display: block; width: 100%; }
      .med-meta-table th { border-bottom: none; padding-bottom: 2px; }
      .med-meta-table td { border-top: none; padding-top: 2px; }
      .tooltip-content { width: 220px; left: auto; right: 0; transform: none; }
    }

    /* ---------------- MOBILE COMPACT GRID TABLE (<= 768px) ---------------- */
    @media (max-width: 768px) {
      .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      table.data-table {
        font-size: 0.75rem;
      }
      table.data-table th,
      table.data-table td {
        padding: 5px 7px;
      }
      table.data-table .btn-sm-edit,
      table.data-table .btn-sm-del {
        padding: 4px 7px;
        font-size: 0.72rem;
      }
    }

    @media (max-width: 420px) {
      .role-btn { padding: 4px 7px; font-size: 0.73rem; }
    }
