  :root {
    /* ===== DESIGN TOKENS — Home Care AI ===== */
    /* Teal medis tenang sebagai primer, navy gelap untuk struktur, coral untuk urgensi */
    --teal-900: #0B3D36;
    --teal-800: #0F4F45;
    --teal-700: #11604F;
    --teal-600: #157A65;
    --teal-500: #1A9379;
    --teal-400: #3FAF94;
    --teal-300: #7FCBB6;
    --teal-200: #B8E2D5;
    --teal-100: #DFF1E9;
    --teal-50:  #F1FAF6;

    --navy-900: #101B22;
    --navy-800: #16242C;
    --navy-700: #1E323C;
    --navy-600: #2A4250;

    --cream-50: #FAF8F3;
    --cream-100:#F4F0E7;
    --cream-200:#ECE5D6;

    --ink-900: #16201D;
    --ink-700: #3A4944;
    --ink-500: #647670;
    --ink-300: #97A8A2;
    --ink-100: #D8E2DD;

    --coral-600:#C1502F;
    --coral-500:#D9663F;
    --coral-100:#FBE4D9;
    --coral-50: #FDF1EB;

    --gold-600: #9A7521;
    --gold-500: #B5903A;
    --gold-100: #F4E8C9;
    --gold-50:  #FBF5E4;

    --sky-600:  #1D6FA8;
    --sky-100:  #DCEBF6;
    --sky-50:   #F0F7FC;

    --plum-600: #6E4A8E;
    --plum-100: #E9DEF2;
    --plum-50:  #F6F1FA;

    --white: #FFFFFF;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --shadow-xs: 0 1px 2px rgba(16, 27, 34, 0.06);
    --shadow-sm: 0 2px 8px rgba(16, 27, 34, 0.07);
    --shadow-md: 0 8px 24px rgba(16, 27, 34, 0.10);
    --shadow-lg: 0 18px 48px rgba(16, 27, 34, 0.16);
    --shadow-glow: 0 0 0 4px rgba(26, 147, 121, 0.14);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 999px;

    --ease-out: cubic-bezier(.16,1,.3,1);
    --ease-spring: cubic-bezier(.34,1.56,.64,1);
    --dur-fast: 160ms;
    --dur-med: 320ms;
    --dur-slow: 560ms;
  }

  * { margin:0; padding:0; box-sizing:border-box; }

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

  html { scroll-behavior: smooth; }

  body {
    font-family: var(--font-body);
    background: var(--cream-50);
    color: var(--ink-900);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  h1, h2, h3, .font-display { font-family: var(--font-display); letter-spacing: -0.01em; }

  ::selection { background: var(--teal-200); color: var(--teal-900); }

  a { color: inherit; }

  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--ink-100); border-radius: 99px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

  /* ====== ICON SYSTEM (monochrome, currentColor strokes) ====== */
  .icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
  .icon svg { width: 100%; height: 100%; display:block; }
  .icon-sm { font-size: 16px; }
  .icon-md { font-size: 20px; }
  .icon-lg { font-size: 28px; }
  .icon-xl { font-size: 40px; }

  /* ====== PAGE TRANSITION SYSTEM ====== */
  .screen { display: none; min-height: 100vh; }
  .screen.active { display: flex; flex-direction: column; }
  .screen.enter { animation: screenEnter var(--dur-slow) var(--ease-out) both; }
  @keyframes screenEnter {
    from { opacity: 0; transform: translateY(14px) scale(0.992); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  }

  #mainContent { animation: contentEnter var(--dur-med) var(--ease-out) both; }
  @keyframes contentEnter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .stagger > * { animation: itemRise 480ms var(--ease-out) both; }
  .stagger > *:nth-child(1){animation-delay:.02s}
  .stagger > *:nth-child(2){animation-delay:.07s}
  .stagger > *:nth-child(3){animation-delay:.12s}
  .stagger > *:nth-child(4){animation-delay:.17s}
  .stagger > *:nth-child(5){animation-delay:.22s}
  .stagger > *:nth-child(6){animation-delay:.27s}
  @keyframes itemRise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ====== BUTTONS ====== */
  .btn {
    padding: 0.7rem 1.4rem; border-radius: var(--radius-full); border: none; cursor: pointer;
    font-size: 0.9rem; font-weight: 600; font-family: var(--font-body);
    transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
    text-decoration: none; display: inline-flex; align-items: center; justify-content:center; gap: 8px;
    position: relative;
  }
  .btn:active { transform: scale(0.96); }
  .btn-white { background: var(--white); color: var(--teal-800); }
  .btn-white:hover { background: var(--teal-50); transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .btn-outline-white { background: rgba(255,255,255,0.06); color: white; border: 1.5px solid rgba(255,255,255,0.45); backdrop-filter: blur(6px); }
  .btn-outline-white:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }
  .btn-teal { background: var(--teal-600); color: white; box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset; }
  .btn-teal:hover { background: var(--teal-700); transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .btn-coral { background: var(--coral-600); color: white; }
  .btn-coral:hover { background: #A8431F; transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .btn-ghost { background: var(--cream-100); color: var(--ink-700); }
  .btn-ghost:hover { background: var(--cream-200); }
  .btn-danger { background: #B23A2E; color: white; }
  .btn-danger:hover { background: #94301F; }
  .btn-lg { padding: 0.95rem 2.1rem; font-size: 1rem; }
  .btn-full { width: 100%; }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; transform:none !important; }

  /* ====== HERO / LANDING ====== */
  #landing {
    position: relative;
    background:
      linear-gradient(165deg, rgba(11,61,54,0.94) 0%, rgba(15,79,69,0.90) 38%, rgba(22,36,44,0.93) 100%),
      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1000"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.012" numOctaves="3" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.5"/></svg>'),
      radial-gradient(120% 80% at 15% 0%, #1A9379 0%, transparent 55%),
      var(--navy-800);
    background-size: cover, 600px 600px, cover, cover;
  }
  .hero-photo-layer {
    position: absolute; inset: 0; overflow: hidden; z-index: 0;
  }
  .hero-photo-layer img {
    width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
    opacity: 0.34; mix-blend-mode: luminosity;
    animation: heroPan 26s ease-in-out infinite alternate;
  }
  @keyframes heroPan { from { transform: scale(1.06) translateX(-1%); } to { transform: scale(1.12) translateX(1%); } }
  .hero-photo-layer::after {
    content:''; position:absolute; inset:0;
    background: linear-gradient(165deg, rgba(11,61,54,0.92) 0%, rgba(15,79,69,0.82) 40%, rgba(16,27,34,0.92) 100%);
  }

  .nav { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 1.4rem 2.4rem; }
  .logo { display: flex; align-items: center; gap: 12px; color: white; font-size: 1.3rem; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; }
  .logo-icon { width: 42px; height: 42px; background: linear-gradient(155deg, var(--teal-400), var(--teal-600)); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; box-shadow: var(--shadow-sm); }
  .nav-btns { display: flex; gap: 12px; }

  .hero { position: relative; z-index: 2; flex: 1; display: flex; align-items: center; justify-content: center; padding: 3.5rem 2rem 2.5rem; text-align: center; color: white; }
  .hero-inner { max-width: 740px; }
  .hero-badge {
    display: inline-flex; align-items: center; gap: 9px; background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    padding: 0.45rem 1.1rem; border-radius: var(--radius-full); font-size: 0.82rem; margin-bottom: 1.6rem;
    animation: badgeFloat 4s ease-in-out infinite;
  }
  @keyframes badgeFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
  .badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #6EE7B7; box-shadow: 0 0 0 3px rgba(110,231,183,0.25); animation: pulse 2s infinite; }
  @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(1.3)} }
  .hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); font-weight: 600; line-height: 1.15; margin-bottom: 1.1rem; }
  .hero h1 em { font-style: italic; font-weight: 500; color: var(--teal-200); }
  .hero p { font-size: 1.1rem; opacity: 0.82; margin-bottom: 2.2rem; line-height: 1.7; font-weight: 300; }
  .hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
  .features-strip { position: relative; z-index: 2; display: flex; justify-content: center; gap: 2.2rem; padding: 1.4rem 2rem; background: rgba(255,255,255,0.06); border-top: 1px solid rgba(255,255,255,0.08); flex-wrap: wrap; backdrop-filter: blur(6px); }
  .feat { display: flex; align-items: center; gap: 9px; color: white; font-size: 0.85rem; opacity: 0.92; }
  .feat .icon { color: var(--teal-300); }

  /* ====== AUTH SCREENS ====== */
  .auth-wrap {
    flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem;
    background:
      linear-gradient(180deg, rgba(250,248,243,0.97), rgba(250,248,243,0.99)),
      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"><circle cx="40" cy="40" r="1.4" fill="%230F4F45" opacity="0.18"/><circle cx="160" cy="100" r="1.4" fill="%230F4F45" opacity="0.14"/><circle cx="300" cy="60" r="1.4" fill="%230F4F45" opacity="0.16"/><circle cx="220" cy="220" r="1.4" fill="%230F4F45" opacity="0.14"/><circle cx="80" cy="300" r="1.4" fill="%230F4F45" opacity="0.16"/><circle cx="340" cy="340" r="1.4" fill="%230F4F45" opacity="0.14"/></svg>'),
      var(--cream-50);
  }
  .auth-card {
    background: var(--white); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
    border: 1px solid var(--cream-200);
    padding: 2.6rem; width: 100%; max-width: 430px;
    animation: cardPop 520ms var(--ease-out) both;
  }
  @keyframes cardPop { from { opacity:0; transform: translateY(18px) scale(0.97);} to {opacity:1; transform: translateY(0) scale(1);} }
  .auth-logo { text-align: center; margin-bottom: 2rem; }
  .auth-logo .logo-icon { width: 58px; height: 58px; background: linear-gradient(155deg, var(--teal-500), var(--teal-700)); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.85rem; box-shadow: var(--shadow-sm); color:white; }
  .auth-logo h2 { font-size: 1.5rem; font-weight: 600; color: var(--ink-900); }
  .auth-logo p { color: var(--ink-500); font-size: 0.9rem; margin-top: 2px; }
  .form-group { margin-bottom: 1.1rem; }
  .form-group label { display: flex; align-items:center; gap:6px; font-size: 0.84rem; font-weight: 600; color: var(--ink-700); margin-bottom: 0.4rem; }
  .form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.72rem 1rem; border: 1.5px solid var(--ink-100); border-radius: var(--radius-sm);
    font-size: 0.95rem; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); background: var(--white); color: var(--ink-900); font-family: var(--font-body);
  }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--teal-500); box-shadow: var(--shadow-glow); }
  .form-group textarea { resize: vertical; min-height: 80px; }
  .role-select { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1.1rem; }
  .role-card { border: 1.5px solid var(--ink-100); border-radius: var(--radius-md); padding: 1rem; text-align: center; cursor: pointer; transition: all var(--dur-fast) var(--ease-out); }
  .role-card:hover { border-color: var(--teal-300); background: var(--teal-50); transform: translateY(-2px); }
  .role-card.selected { border-color: var(--teal-600); background: var(--teal-50); box-shadow: var(--shadow-glow); }
  .role-card .r-icon { color: var(--teal-700); margin-bottom: 0.4rem; }
  .role-card .r-title { font-size: 0.85rem; font-weight: 600; color: var(--ink-700); }
  .auth-switch { text-align: center; margin-top: 1.2rem; font-size: 0.875rem; color: var(--ink-500); }
  .auth-switch a { color: var(--teal-700); font-weight: 600; cursor: pointer; text-decoration: none; }
  .auth-switch a:hover { text-decoration: underline; }
  .divider { display: flex; align-items: center; gap: 1rem; margin: 1.1rem 0; color: var(--ink-300); font-size: 0.78rem; text-transform:uppercase; letter-spacing:0.06em; }
  .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--ink-100); }

  /* ====== DASHBOARD LAYOUT ====== */
  .app-layout { flex: 1; display: flex; }
  .sidebar {
    width: 252px; background: linear-gradient(195deg, var(--navy-800), var(--navy-900));
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
    transition: transform var(--dur-med) var(--ease-out);
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  .sidebar-logo { padding: 1.3rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.07); display: flex; align-items: center; gap: 10px; }
  .sidebar-logo .logo-icon { width: 36px; height: 36px; background: linear-gradient(155deg, var(--teal-400), var(--teal-600)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; }
  .sidebar-logo span { font-weight: 600; color: white; font-size: 1.05rem; font-family: var(--font-display); }
  .sidebar-user { padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .user-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(155deg, var(--teal-400), var(--teal-700)); display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 0.9rem; flex-shrink: 0; }
  .user-info { display: flex; align-items: center; gap: 10px; }
  .user-name { font-weight: 600; font-size: 0.875rem; color: white; }
  .user-role { font-size: 0.74rem; color: var(--teal-300); }
  .sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
  .nav-section { padding: 0 1rem 0.6rem; }
  .nav-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.3); padding: 0.6rem 0.6rem 0.35rem; }
  .nav-item {
    display: flex; align-items: center; gap: 11px; padding: 0.62rem 0.8rem; border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.62); font-size: 0.875rem; font-weight: 500; cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out); margin-bottom: 2px; position: relative;
  }
  .nav-item:hover { background: rgba(255,255,255,0.06); color: white; transform: translateX(2px); }
  .nav-item.active { background: linear-gradient(95deg, rgba(26,147,121,0.28), rgba(26,147,121,0.08)); color: white; font-weight: 600; }
  .nav-item.active::before { content:''; position:absolute; left:-1rem; top:8px; bottom:8px; width:3px; background: var(--teal-400); border-radius: 0 4px 4px 0; }
  .nav-item .icon { flex-shrink: 0; }
  .nav-badge { margin-left: auto; background: var(--coral-600); color: white; font-size: 0.65rem; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-full); }
  .sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.06); }
  .sidebar-overlay { display:none; position: fixed; inset:0; background: rgba(16,27,34,0.5); z-index: 99; backdrop-filter: blur(2px); }
  .sidebar-overlay.open { display:block; animation: fadeIn var(--dur-fast) ease; }
  @keyframes fadeIn { from{opacity:0} to{opacity:1} }

  .main-content { flex: 1; margin-left: 252px; padding: 1.6rem 1.8rem 2.4rem; min-height: 100vh; }
  .page-header { margin-bottom: 1.6rem; display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
  .page-header h1 { font-size: 1.7rem; font-weight: 600; color: var(--ink-900); display:flex; align-items:center; gap:12px; }
  .page-header h1 .icon { color: var(--teal-600); }
  .page-header p { color: var(--ink-500); margin-top: 0.3rem; font-size: 0.92rem; }

  .topbar { display: none; }
  .hamburger { display:none; }

  /* ====== DASHBOARD CARDS ====== */
  .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
  .stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 1.3rem; box-shadow: var(--shadow-sm); border: 1px solid var(--cream-200); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast); }
  .stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .stat-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.8rem; }
  .stat-icon.teal { background: var(--teal-100); color: var(--teal-700); }
  .stat-icon.green { background: var(--teal-50); color: var(--teal-600); }
  .stat-icon.gold { background: var(--gold-50); color: var(--gold-600); }
  .stat-icon.coral { background: var(--coral-50); color: var(--coral-600); }
  .stat-icon.plum { background: var(--plum-50); color: var(--plum-600); }
  .stat-val { font-size: 1.85rem; font-weight: 700; color: var(--ink-900); line-height: 1; font-family: var(--font-display); }
  .stat-label { font-size: 0.8rem; color: var(--ink-500); margin-top: 5px; }
  .stat-change { font-size: 0.75rem; margin-top: 7px; font-weight: 600; display:flex; align-items:center; gap:3px; }
  .stat-change.up { color: var(--teal-600); }

  .card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--cream-200); transition: box-shadow var(--dur-fast); }
  .card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--cream-200); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .card-title { font-size: 1rem; font-weight: 700; color: var(--ink-900); display:flex; align-items:center; gap:9px; }
  .card-title .icon { color: var(--teal-600); }
  .card-body { padding: 1.25rem 1.5rem; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }

  /* ====== BADGES ====== */
  .badge { display: inline-flex; align-items: center; gap: 5px; padding: 0.25rem 0.7rem; border-radius: var(--radius-full); font-size: 0.74rem; font-weight: 700; }
  .badge .icon { font-size: 12px; }
  .badge-green { background: var(--teal-50); color: var(--teal-700); }
  .badge-gold { background: var(--gold-50); color: var(--gold-600); }
  .badge-orange { background: var(--coral-50); color: #B5562E; }
  .badge-red { background: #FCEAE6; color: #B23A2E; }
  .badge-plum { background: var(--plum-50); color: var(--plum-600); }
  .badge-teal { background: var(--teal-50); color: var(--teal-700); }
  .badge-sky { background: var(--sky-50); color: var(--sky-600); }

  /* ====== VISIT DOCUMENTATION BANNER (NEW) ====== */
  .visit-banner {
    position: relative; overflow: hidden; border-radius: var(--radius-xl);
    background: linear-gradient(120deg, var(--teal-800) 0%, var(--teal-700) 55%, var(--teal-600) 100%);
    padding: 1.9rem 2.1rem; color: white; margin-bottom: 1.6rem;
    box-shadow: var(--shadow-md);
  }
  .visit-banner::before {
    content:''; position:absolute; inset:0; opacity:0.5;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240"><g fill="none" stroke="white" stroke-width="1" opacity="0.16"><circle cx="40" cy="40" r="26"/><path d="M40 24v32M24 40h32"/><circle cx="180" cy="160" r="40"/><path d="M180 132v56M152 160h56"/></g></svg>');
    background-size: 280px, 280px; background-position: -20px -30px, right -10px bottom -40px; background-repeat: no-repeat, no-repeat;
  }
  .visit-banner-grid { position:relative; z-index:1; display:flex; align-items:center; gap:1.6rem; flex-wrap:wrap; }
  .visit-banner-icon {
    width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.25);
    display:flex; align-items:center; justify-content:center; flex-shrink:0; color: white;
    animation: gentleBob 3.2s ease-in-out infinite;
  }
  @keyframes gentleBob { 0%,100%{transform:translateY(0) rotate(0)} 50%{transform:translateY(-5px) rotate(-2deg)} }
  .visit-banner-text { flex: 1; min-width: 220px; }
  .visit-banner-text h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 4px; }
  .visit-banner-text p { font-size: 0.88rem; opacity: 0.86; line-height: 1.5; max-width: 480px; }
  .visit-banner-stats { display:flex; gap: 1.6rem; }
  .vb-stat { text-align:center; }
  .vb-stat-num { font-size: 1.5rem; font-weight: 700; font-family: var(--font-display); }
  .vb-stat-label { font-size: 0.7rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.05em; margin-top:2px; }
  .visit-banner-actions { display: flex; gap: 10px; flex-shrink:0; }

  .doc-upload-zone {
    border: 1.5px dashed rgba(255,255,255,0.45); border-radius: var(--radius-md);
    padding: 1.6rem; text-align:center; cursor:pointer; transition: all var(--dur-fast) var(--ease-out);
    background: rgba(255,255,255,0.05);
  }
  .doc-upload-zone:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.7); }

  .doc-gallery { display:grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 0.9rem; }
  .doc-thumb { position:relative; border-radius: var(--radius-md); overflow:hidden; aspect-ratio:4/3; box-shadow: var(--shadow-sm); cursor:pointer; transition: transform var(--dur-fast) var(--ease-out); }
  .doc-thumb:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
  .doc-thumb img { width:100%; height:100%; object-fit:cover; }
  .doc-thumb .doc-thumb-tag { position:absolute; bottom:6px; left:6px; right:6px; background:rgba(16,27,34,0.65); backdrop-filter: blur(4px); color:white; font-size:0.68rem; padding:4px 8px; border-radius: 8px; }

  .doc-entry { display:flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--cream-200); }
  .doc-entry:last-child { border-bottom:none; }
  .doc-entry-photo { width: 84px; height: 84px; border-radius: var(--radius-md); overflow:hidden; flex-shrink:0; box-shadow: var(--shadow-xs); }
  .doc-entry-photo img { width:100%; height:100%; object-fit:cover; }
  .doc-entry-body { flex:1; }
  .doc-entry-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:4px; }
  .doc-entry-title { font-weight:700; font-size:0.92rem; color:var(--ink-900); }
  .doc-entry-meta { font-size:0.76rem; color:var(--ink-500); display:flex; align-items:center; gap:6px; }
  .doc-entry-note { font-size:0.84rem; color:var(--ink-700); line-height:1.5; }

  /* ====== AI CONSULTATION ====== */
  .ai-layout { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; }
  .ai-chat { display: flex; flex-direction: column; height: calc(100vh - 180px); min-height: 420px; }
  .ai-header { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--cream-200); display:flex; align-items:center; gap:12px; background: linear-gradient(95deg, var(--teal-50), transparent); border-radius: var(--radius-lg) var(--radius-lg) 0 0; flex-shrink: 0; }
  .ai-avatar { width:44px; height:44px; border-radius: 13px; background: linear-gradient(155deg, var(--teal-500), var(--teal-700)); display:flex; align-items:center; justify-content:center; color:white; flex-shrink:0; box-shadow: var(--shadow-sm); }
  .ai-name { font-weight:700; color:var(--ink-900); font-size:0.95rem; }
  .ai-status { font-size:0.78rem; color: var(--teal-600); display:flex; align-items:center; gap:5px; }
  .ai-body { flex:1; overflow-y:auto; padding: 1.4rem; min-height: 0; }
  .symptom-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 0.6rem; margin: 1rem 0 1.4rem; }
  .symptom-chip { display:flex; align-items:center; gap:9px; padding: 0.65rem 0.9rem; border: 1.5px solid var(--ink-100); border-radius: var(--radius-md); cursor:pointer; font-size:0.85rem; transition: all var(--dur-fast) var(--ease-out); background: var(--white); }
  .symptom-chip:hover { border-color: var(--teal-300); background: var(--teal-50); transform: translateY(-1px); }
  .symptom-chip.selected { border-color: var(--teal-600); background: var(--teal-50); color: var(--teal-800); font-weight:600; }
  .symptom-chip .chk { width:18px; height:18px; border-radius:6px; border:1.5px solid var(--ink-300); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition: all var(--dur-fast); }
  .symptom-chip.selected .chk { background: var(--teal-600); border-color: var(--teal-600); color:white; }

  .diag-result { border-radius: var(--radius-lg); padding: 1.4rem; margin-bottom: 1rem; border: 1.5px solid var(--cream-200); animation: itemRise 420ms var(--ease-out) both; }
  .diag-result.level-1 { border-color: var(--teal-200); background: var(--teal-50); }
  .diag-result.level-2 { border-color: var(--gold-100); background: var(--gold-50); }
  .diag-result.level-3 { border-color: var(--coral-100); background: var(--coral-50); }
  .diag-result.level-4 { border-color: #F3C9C1; background: #FCEAE6; }

  .ai-input-bar { padding: 1.1rem 1.4rem; border-top: 1px solid var(--cream-200); display:flex; gap:10px; align-items:center; flex-shrink: 0; }

  /* ====== CONSULTATION / CHAT ====== */
  .consult-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1rem; height: calc(100vh - 180px); min-height: 420px; }
  .chat-list { display:flex; flex-direction:column; overflow-y:auto; min-height:0; }
  .chat-filter-bar { padding: 0.7rem 0.9rem 0.6rem; border-bottom: 1px solid var(--cream-200); }
  .chat-item { display:flex; align-items:center; gap:10px; padding:0.9rem 1.1rem; cursor:pointer; border-bottom:1px solid var(--cream-200); transition:background var(--dur-fast); }
  .chat-item:hover { background: var(--cream-50); }
  .chat-item.active { background: var(--teal-50); }
  .chat-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(155deg, var(--teal-300), var(--teal-600)); display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 0.9rem; flex-shrink: 0; position: relative; }
  .online-dot { position: absolute; bottom: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal-500); border: 2px solid white; }
  .chat-info { flex: 1; min-width: 0; }
  .chat-name { font-size: 0.875rem; font-weight: 600; color: var(--ink-900); }
  .chat-preview { font-size: 0.775rem; color: var(--ink-500); overflow-wrap:anywhere; white-space: normal; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .chat-meta { text-align: right; flex-shrink:0; }
  .chat-time { font-size: 0.7rem; color: var(--ink-300); }
  .chat-unread { width: 18px; height: 18px; background: var(--teal-600); border-radius: 50%; color: white; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 3px; margin-left: auto; }
  .chat-group { display:flex; flex-direction:column; }
  .chat-group-title { font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--ink-500); padding:0.55rem 1rem 0.2rem; }
  .chat-urgency { display:inline-flex; align-items:center; gap:5px; padding:0.2rem 0.55rem; border-radius:999px; font-size:0.7rem; font-weight:700; margin-top:0.3rem; }
  .chat-urgency.kritis { background:#FDE7E6; color:#B0392D; }
  .chat-urgency.berat { background:#FFF4D9; color:#AD6A00; }
  .chat-urgency.sedang { background:#E8F5F1; color:#0F6E5B; }
  .chat-urgency.ringan { background:#EAF7EA; color:#257A34; }
  .chat-window { display:flex; flex-direction:column; overflow:hidden; min-height:0; }
  .chat-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--cream-200); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
  .chat-header-info { flex: 1; }
  .chat-header-name { font-weight: 700; color: var(--ink-900); }
  .chat-header-status { font-size: 0.78rem; color: var(--teal-600); }
  .messages-area { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; background: var(--cream-50); min-height: 0; }
  .msg-row { display:flex; gap:10px; align-items:flex-end; animation:msgIn 280ms var(--ease-out) both; min-width:0; width:100%; }
  @keyframes msgIn { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)} }
  .msg-row.from-me { flex-direction: row-reverse; justify-content:flex-end; }
  .msg-row.from-other { justify-content:flex-start; }
  .msg-row > div:last-child { display:flex; flex-direction:column; align-items:flex-start; min-width:0; max-width:min(78%, 420px); }
  .msg-row.from-me > div:last-child { align-items:flex-end; margin-left:auto; }
  .msg-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--teal-100); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: var(--teal-700); flex-shrink: 0; }
  .msg-bubble { display:block; width:fit-content; max-width:100%; min-width:0; padding:0.65rem 0.95rem; border-radius:var(--radius-md); font-size:0.875rem; line-height:1.5; overflow-wrap:anywhere; word-break:break-word; white-space:normal; }
  .msg-row.from-other .msg-bubble { background:white; color:var(--ink-900); border:1px solid var(--cream-200); border-bottom-left-radius:4px; }
  .msg-row.from-me .msg-bubble { background:var(--teal-600); color:white; border-bottom-right-radius:4px; margin-left:auto; }
  .msg-time { font-size: 0.68rem; color: var(--ink-300); margin-top: 2px; text-align: right; }
  .msg-row.from-other .msg-time { text-align: left; }
  .chat-input-area { padding: 1rem 1.25rem; border-top: 1px solid var(--cream-200); display: flex; gap: 10px; align-items: flex-end; flex-shrink: 0; }
  .chat-input { flex: 1; border: 1.5px solid var(--ink-100); border-radius: var(--radius-lg); padding: 0.65rem 1.05rem; font-size: 0.9rem; resize: none; max-height: 120px; outline: none; font-family: inherit; }
  .chat-input:focus { border-color: var(--teal-500); box-shadow: var(--shadow-glow); }
  .send-btn { width: 42px; height: 42px; background: var(--teal-600); border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: white; transition: all var(--dur-fast) var(--ease-spring); flex-shrink: 0; }
  .send-btn:hover { background: var(--teal-700); transform: scale(1.08) rotate(8deg); }

  /* ====== FILTER / SEARCH ====== */
  .filter-row { display:flex; gap:10px; margin-bottom:1.2rem; flex-wrap:wrap; align-items:center; }
  .search-bar { display:flex; align-items:center; gap:8px; background:var(--white); border:1.5px solid var(--ink-100); border-radius: var(--radius-full); padding: 0.55rem 1.1rem; transition: border-color var(--dur-fast); }
  .search-bar:focus-within { border-color: var(--teal-500); box-shadow: var(--shadow-glow); }
  .search-bar .icon { color: var(--ink-300); }
  .search-bar input { border:none; outline:none; flex:1; font-size:0.88rem; font-family: var(--font-body); }
  .filter-select { padding: 0.55rem 1rem; border-radius: var(--radius-full); border: 1.5px solid var(--ink-100); font-size: 0.85rem; background: var(--white); font-family: var(--font-body); }

  /* ====== TABLE ====== */
  .patient-table { width:100%; border-collapse:collapse; font-size:0.86rem; }
  .patient-table th { text-align:left; padding: 0.8rem 1.1rem; background: var(--cream-50); color: var(--ink-500); font-weight:600; font-size:0.74rem; text-transform:uppercase; letter-spacing:0.05em; border-bottom:1px solid var(--cream-200); }
  .patient-table td { padding: 0.85rem 1.1rem; border-bottom:1px solid var(--cream-200); color: var(--ink-900); }
  .patient-table tr:hover td { background: var(--cream-50); }
  .patient-name-cell { display:flex; align-items:center; gap:10px; }

  /* ====== MODAL ====== */
  .modal-overlay { display:none; position:fixed; inset:0; background:rgba(16,27,34,0.55); backdrop-filter: blur(3px); z-index:1000; align-items:center; justify-content:center; padding:1.5rem; }
  .modal-overlay.open { display:flex; animation: fadeIn var(--dur-fast) ease; }
  .modal-box { background:var(--white); border-radius: var(--radius-xl); max-width: 480px; width:100%; box-shadow: var(--shadow-lg); max-height:88vh; overflow-y:auto; animation: modalPop var(--dur-med) var(--ease-spring) both; }
  @keyframes modalPop { from { opacity:0; transform: translateY(24px) scale(0.95);} to {opacity:1; transform: translateY(0) scale(1);} }
  .modal-header { padding: 1.3rem 1.5rem; border-bottom:1px solid var(--cream-200); display:flex; align-items:center; justify-content:space-between; }
  .modal-header h3 { font-size:1.1rem; font-weight:700; color:var(--ink-900); display:flex; align-items:center; gap:10px; }
  .modal-close { width:32px; height:32px; border-radius:50%; border:none; background:var(--cream-100); cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--ink-500); transition: all var(--dur-fast); }
  .modal-close:hover { background: var(--coral-100); color: var(--coral-600); transform: rotate(90deg); }
  .modal-body { padding: 1.5rem; }
  .modal-footer { padding: 1.1rem 1.5rem; border-top:1px solid var(--cream-200); display:flex; gap:10px; justify-content:flex-end; }

  /* ====== PROFILE ====== */
  .profile-hero { background: linear-gradient(120deg, var(--teal-700), var(--teal-500)); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 2.2rem 1.6rem; display:flex; align-items:center; gap:1.4rem; color:white; position:relative; overflow:hidden; }
  .profile-hero::after { content:''; position:absolute; inset:0; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><circle cx="170" cy="20" r="60" fill="white" opacity="0.06"/><circle cx="20" cy="180" r="50" fill="white" opacity="0.06"/></svg>'); }
  .profile-avatar-lg { width:84px; height:84px; border-radius:50%; background: rgba(255,255,255,0.18); border:2px solid rgba(255,255,255,0.4); display:flex; align-items:center; justify-content:center; font-size:1.8rem; font-weight:700; flex-shrink:0; position:relative; z-index:1; }
  .profile-info { position:relative; z-index:1; }
  .profile-info h2 { font-size:1.3rem; font-weight:600; }
  .profile-info p { font-size:0.86rem; opacity:0.85; margin-top:2px; }
  .info-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
  .info-item label { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-300); font-weight:700; }
  .info-item p { font-size:0.92rem; color:var(--ink-900); margin-top:3px; font-weight:500; }

  /* ====== SCHEDULE / CALENDAR ====== */
  .schedule-grid { display:grid; grid-template-columns: repeat(7,1fr); gap:6px; }
  .day-header { text-align:center; font-size:0.72rem; font-weight:700; color:var(--ink-500); text-transform:uppercase; padding:6px 0; }
  .day-cell { aspect-ratio:1; border-radius: var(--radius-sm); border:1px solid var(--cream-200); padding:6px; font-size:0.75rem; position:relative; overflow:hidden; transition: all var(--dur-fast); }
  .day-cell:hover { border-color: var(--teal-300); }
  .day-cell.today { background: var(--teal-50); border-color: var(--teal-500); }
  .day-number { font-weight:600; color:var(--ink-700); }
  .day-cell.today .day-number { color: var(--teal-700); }
  .day-event { font-size:0.62rem; background:var(--teal-100); color:var(--teal-800); border-radius:5px; padding:1px 5px; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

  /* ====== RISK LEVEL DOTS ====== */
  .risk-bar { display:flex; gap:3px; }
  .risk-dot { width:7px; height:16px; border-radius:3px; background: var(--ink-100); }
  .risk-dot.fill-1 { background: var(--teal-500); }
  .risk-dot.fill-2 { background: var(--gold-500); }
  .risk-dot.fill-3 { background: var(--coral-500); }
  .risk-dot.fill-4 { background: #B23A2E; }

  .drug-pill { display:inline-flex; align-items:center; gap:6px; background: var(--sky-50); color: var(--sky-600); padding: 0.4rem 0.85rem; border-radius: var(--radius-full); font-size: 0.8rem; font-weight:500; }

  /* ====== TOAST ====== */
  #toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(30px);
    background: var(--navy-800); color: white; padding: 0.85rem 1.6rem; border-radius: var(--radius-full);
    font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 2000;
    opacity: 0; pointer-events:none; transition: all var(--dur-med) var(--ease-spring);
    display:flex; align-items:center; gap:9px;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events:auto; }
  #toast .icon { color: var(--teal-300); }

  /* ====== EMPTY STATE ====== */
  .empty-state { text-align:center; padding: 3rem 1.5rem; color: var(--ink-500); }
  .empty-state .icon { color: var(--ink-100); margin-bottom: 1rem; }
  .empty-state h4 { font-size:1rem; color:var(--ink-700); margin-bottom:4px; }
  .empty-state p { font-size:0.85rem; }

  /* ====== RESPONSIVE ====== */
  @media (max-width: 968px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding-top: 4.4rem; }
    .topbar { display:flex; position:fixed; top:0; left:0; right:0; height:60px; background:var(--white); border-bottom:1px solid var(--cream-200); align-items:center; gap:12px; padding:0 1.2rem; z-index:90; box-shadow: var(--shadow-xs); }
    .hamburger { display:flex; width:38px; height:38px; align-items:center; justify-content:center; border:none; background:var(--cream-100); border-radius: var(--radius-sm); cursor:pointer; color: var(--ink-700); }
    .topbar .logo { flex:1; font-size:1.05rem; }
    .ai-layout, .consult-grid { grid-template-columns: 1fr; height: auto; }
    .consult-grid .chat-list { max-height: 240px; }
    .consult-grid .chat-window { height: 70vh; min-height: 420px; }
    .ai-chat { height: 78vh; }
    .grid-2 { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .visit-banner-grid { flex-direction:column; align-items:flex-start; }
    .visit-banner-actions { width:100%; }
    .visit-banner-actions .btn { flex:1; }
  }

/* AI Assistant: FAQ chat and administrative patient clusters */
.assistant-grid{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(320px,1.15fr);gap:1.1rem;align-items:start}
.assistant-chat-card,.assistant-cluster-card,.assistant-info-card{overflow:hidden}
.assistant-chat-card .card-header,.assistant-cluster-card .card-header,.assistant-info-card .card-header{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem;padding:1.1rem 1.25rem;border-bottom:1px solid var(--cream-200)}
.assistant-chat-card .card-header h3,.assistant-cluster-card .card-header h3,.assistant-info-card .card-header h3{display:flex;align-items:center;gap:.5rem;margin:0;font-size:1rem}
.assistant-chat-card .card-header p,.assistant-cluster-card .card-header p{margin:.35rem 0 0;color:var(--ink-500);font-size:.8rem;line-height:1.45}
.assistant-messages{height:330px;overflow:auto;display:flex;flex-direction:column;gap:.8rem;padding:1rem;background:var(--cream-50,#faf9f6)}
.assistant-bubble{max-width:90%;padding:.75rem .9rem;border-radius:14px;font-size:.86rem;line-height:1.55;overflow-wrap:anywhere}
.assistant-bubble p{margin:.25rem 0 0;white-space:pre-wrap}.assistant-bubble strong{font-size:.78rem}.assistant-bubble.bot{align-self:flex-start;background:#fff;border:1px solid var(--cream-200);border-top-left-radius:4px}.assistant-bubble.user{align-self:flex-end;background:var(--teal-700);color:#fff;border-top-right-radius:4px}
.assistant-suggestions{display:flex;flex-wrap:wrap;gap:.4rem;padding:.75rem 1rem 0}.assistant-suggestions .btn{font-size:.72rem;padding:.4rem .6rem}
.assistant-compose{display:flex;gap:.5rem;padding:.85rem 1rem}.assistant-compose input{min-width:0;flex:1;border:1px solid var(--cream-300);border-radius:10px;padding:.7rem .8rem;font:inherit;font-size:.85rem;background:#fff}.assistant-compose button{white-space:nowrap}
.assistant-disclaimer{font-size:.72rem;color:var(--ink-500);line-height:1.5;margin:0;padding:0 1rem 1rem}.assistant-cluster-card h4{font-size:.88rem;margin:1rem 1.1rem .6rem;color:var(--ink-800)}
.assistant-total{display:flex;align-items:baseline;gap:.55rem;padding:1rem 1.1rem .2rem}.assistant-total strong{font-size:1.8rem;color:var(--teal-700);font-family:var(--font-mono)}.assistant-total span,.assistant-method{font-size:.78rem;color:var(--ink-500)}.assistant-method{margin:.1rem 1.1rem .5rem;line-height:1.5}
.assistant-cluster-list,.assistant-specialty-list{display:grid;gap:.5rem;padding:0 1rem}.assistant-cluster,.assistant-specialty{border:1px solid var(--cream-200);border-radius:11px;background:#fff;overflow:hidden}.assistant-cluster summary,.assistant-specialty summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:.6rem;padding:.75rem .8rem;font-size:.82rem}.assistant-cluster summary::-webkit-details-marker,.assistant-specialty summary::-webkit-details-marker{display:none}.assistant-cluster summary>span:first-child{display:flex;align-items:center;gap:.55rem}.assistant-cluster summary i{width:9px;height:9px;border-radius:50%;background:#2f9b71}.severity-level-2 summary i{background:#d6a33a}.severity-level-3 summary i{background:#e57c36}.severity-level-4 summary i{background:#d84d4d}.assistant-count{font-size:.72rem;color:var(--ink-500);white-space:nowrap}.assistant-cluster>p{margin:0;padding:0 .8rem .65rem;font-size:.75rem;color:var(--ink-500);line-height:1.45}.assistant-patient-list{padding:0 .75rem .65rem}.assistant-patient{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding:.55rem 0;border-top:1px solid var(--cream-100,#f1eee8);font-size:.78rem}.assistant-patient>div{min-width:0}.assistant-patient strong,.assistant-patient small{display:block;overflow-wrap:anywhere}.assistant-patient small{font-size:.72rem;color:var(--ink-500);margin-top:.18rem}.assistant-patient>span{font-size:.68rem;color:var(--ink-500);white-space:nowrap}.assistant-empty{font-size:.75rem!important}.assistant-clinical-notice{display:flex;gap:.55rem;align-items:flex-start;margin:1rem;padding:.75rem;border-radius:9px;background:#fff8e8;color:#795b20;font-size:.73rem;line-height:1.5}.assistant-loading,.assistant-error{padding:1.25rem;color:var(--ink-500);font-size:.84rem}.assistant-info-card>p{padding:0 1.25rem;color:var(--ink-500);font-size:.85rem;line-height:1.6}.assistant-info-card>button{margin:0 1.25rem 1.25rem}
@media(max-width:1000px){.assistant-grid{grid-template-columns:1fr}.assistant-messages{height:290px}}
@media(max-width:520px){.assistant-chat-card .card-header,.assistant-cluster-card .card-header{padding:.9rem}.assistant-compose{padding:.7rem}.assistant-compose button{padding:.6rem}.assistant-suggestions{padding:.6rem .7rem 0}.assistant-messages{height:260px}.assistant-cluster-list,.assistant-specialty-list{padding:0 .7rem}}

/* Assistant operational workspace */
.assistant-workspace{margin-top:1.1rem;padding:1.15rem;overflow:hidden}
.assistant-service-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;align-items:start}
.assistant-service-grid>div{min-width:0;border:1px solid var(--cream-200);border-radius:12px;padding:1rem;background:var(--cream-50,#fffdf9)}
.assistant-service-grid h4{margin:0 0 .85rem;font-size:.92rem;color:var(--ink-800)}
.assistant-action-form{display:grid;gap:.7rem}
.assistant-action-form label{display:grid;gap:.3rem;font-size:.76rem;color:var(--ink-600);font-weight:600}
.assistant-action-form input,.assistant-action-form select,.assistant-action-form textarea{width:100%;min-width:0;border:1px solid var(--cream-300);border-radius:8px;padding:.65rem .7rem;background:white;color:var(--ink-800);font:inherit;font-weight:400}
.assistant-action-form textarea{resize:vertical}
.assistant-visit-list{display:grid;gap:.55rem;max-height:360px;overflow:auto}
.assistant-visit-item{display:grid;gap:.22rem;padding:.75rem;border-radius:9px;background:white;border:1px solid var(--cream-200);font-size:.78rem}
.assistant-visit-item span{color:var(--teal-700);font-weight:600}.assistant-visit-item small{color:var(--ink-500);line-height:1.4}
.assistant-success{margin:.8rem 0 0;padding:.7rem .8rem;border-radius:8px;background:#eaf7ef;color:#216b43;font-size:.82rem}
@media(max-width:900px){.assistant-service-grid{grid-template-columns:1fr}}


/* ====== HOMECARE AI: consultation layout hardening ====== */
.ai-layout,
.ai-layout > *,
.ai-chat,
#aiChecklistView,
#aiChatFreeView,
#aiBody,
#aiChatBody,
#diagResultArea,
#aiServiceWorkspace {
  min-width: 0;
  box-sizing: border-box;
}
.ai-layout {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
  align-items: stretch;
  column-gap: 1rem;
  row-gap: 1rem;
}
.ai-chat {
  min-height: 560px;
  max-height: calc(100dvh - 190px);
}
.ai-body {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.symptom-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.symptom-chip {
  display: grid;
  grid-template-columns: 18px 18px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  transform: none;
}
.symptom-chip:hover {
  transform: translateY(-1px);
}
.symptom-chip > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.symptom-chip .icon,
.symptom-chip .chk {
  position: static;
  flex: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
}
.diag-result,
.diag-result * {
  min-width: 0;
  box-sizing: border-box;
}
.diag-result ul {
  margin: 0;
  overflow-wrap: anywhere;
}
.diag-result > div {
  max-width: 100%;
}
.ai-input-bar {
  min-width: 0;
  flex-wrap: nowrap;
}
.ai-input-bar > * {
  min-width: 0;
}
#aiChatInput {
  width: 100%;
  min-width: 0;
  max-height: 130px;
}
#aiChatMessages .msg-row > div:last-child {
  max-width: min(88%, 620px);
  min-width: 0;
}
#aiChatMessages .msg-bubble {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#aiServiceWorkspace {
  width: 100%;
  max-width: 100%;
  margin-top: 1rem;
}
#aiServiceWorkspace .assistant-workspace,
#aiServiceWorkspace .assistant-chat-card,
#aiServiceWorkspace .assistant-cluster-card {
  min-width: 0;
  max-width: 100%;
}
.schedule-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
}
.day-cell {
  min-width: 0;
  padding: clamp(3px, .6vw, 7px);
}
.day-event {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 968px) {
  .ai-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .ai-chat {
    height: auto;
    min-height: 620px;
    max-height: none;
  }
  #aiChecklistView {
    min-height: 0;
  }
  #aiBody,
  #aiChatBody {
    max-height: 58vh;
  }
  #aiServiceWorkspace {
    margin-top: .85rem;
  }
}
@media (max-width: 560px) {
  .ai-header {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: .9rem;
  }
  .ai-header > div:last-child {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }
  .ai-header > div:last-child button {
    flex: 1;
    justify-content: center;
  }
  .symptom-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem;
  }
  .symptom-chip {
    padding: .7rem .75rem;
  }
  .ai-input-bar {
    padding: .8rem;
    gap: .55rem;
  }
  .ai-input-bar .btn {
    padding-inline: .65rem;
    white-space: nowrap;
  }
  .diag-result {
    padding: 1rem;
  }
  .diag-result > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .75rem !important;
  }
  .schedule-grid {
    gap: 3px;
  }
  .day-cell {
    font-size: .68rem;
    min-height: 42px;
    aspect-ratio: auto;
  }
}


/* ===== SKELETON SHIMMER LOADING ===== */
.skeleton-shimmer { position:relative; overflow:hidden; display:block; background:#e8efeb; border-radius:10px; color:transparent !important; }
.skeleton-shimmer::after { content:""; position:absolute; inset:0; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.78),transparent); animation:skeletonSweep 1.35s ease-in-out infinite; }
@keyframes skeletonSweep { 100% { transform:translateX(100%); } }
.skeleton-line { height:11px; margin:9px 0; border-radius:999px; }
.skeleton-line.sm { width:38%; height:9px; }
.skeleton-line.md { width:68%; }
.skeleton-line.lg { width:92%; }
.skeleton-circle { width:42px; height:42px; border-radius:50%; flex:0 0 auto; }
.skeleton-card { padding:14px; border:1px solid var(--ink-100); border-radius:var(--radius-md); background:#fff; margin:8px 0; }
.skeleton-row { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.skeleton-block { height:64px; border-radius:12px; margin:10px 0; }
.skeleton-stack { display:grid; gap:10px; }
.assistant-loading, .chat-loading { padding:12px 0; color:var(--ink-500); }
.skeleton-caption { width:52%; height:9px; margin-top:8px; }
@media (prefers-reduced-motion: reduce) { .skeleton-shimmer::after { animation:none; transform:none; opacity:.25; } }
