/* assets/css/components.css */
/* Navbar */
  .nav{
    position:sticky; top:0; z-index:10;
    background:var(--card);
    backdrop-filter:saturate(160%) blur(8px);
    border-bottom:var(--pen-stroke);
    box-shadow:0 2px 0 0 var(--ink);
  }
  .nav-inner{
    max-width:1100px; margin:0 auto;
    display:flex; align-items:center; gap:14px;
    padding:14px 18px;
  }
  .brand{ display:flex; align-items:center; gap:10px; font-weight:1000; font-size:20px; }
  .brand .logo{
    width:34px; height:34px; border-radius:10px;
    display:grid; place-items:center;
    background:#fff;
    border:var(--pen-stroke);
    box-shadow:var(--pen-shadow);
  }
  .nav-links{ display:flex; gap:12px; margin-left:8px; }
  .nav-links a{
    padding:10px 14px; border-radius:10px;
    color:var(--muted); font-weight:950; font-size:17px;
  }
  .nav-links a.active{color:var(--ink); background:#e8eef7}
  
  /* 햄버거 메뉴 버튼 */
  .nav-toggle{
    display:none;
    background:none;
    border:none;
    padding:8px;
    cursor:pointer;
    flex-direction:column;
    gap:4px;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    margin-left:auto;
  }
  .nav-toggle span{
    display:block;
    width:20px;
    height:2px;
    background:var(--ink);
    border-radius:2px;
    transition:all .2s ease;
  }
  .nav-toggle.active span:nth-child(1){
    transform:rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle.active span:nth-child(2){
    opacity:0;
  }
  .nav-toggle.active span:nth-child(3){
    transform:rotate(-45deg) translate(7px, -6px);
  }
  
  /* 하단 고정 탭 */
  .bottom-nav{
    display:none;
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    background:var(--card);
    border-top:var(--pen-stroke);
    box-shadow:0 -2px 8px rgba(0,0,0,.1);
    z-index:10;
    padding:10px 0 max(10px, env(safe-area-inset-bottom));
  }
  .bottom-nav-inner{
    max-width:1100px;
    margin:0 auto;
    display:flex;
    justify-content:space-around;
    align-items:center;
    padding:0 20px;
  }
  .bottom-nav a{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:6px;
    padding:10px 20px;
    text-decoration:none;
    color:var(--muted);
    font-weight:950;
    font-size:16px;
    border-radius:12px;
    transition:all .2s ease;
    min-width:72px;
    position:relative;
  }
  .bottom-nav a.active{
    color:var(--ink);
    background:#e8eef7;
  }
  .bottom-nav a[data-nav="home"]::before{
    content:"";
    width:28px;
    height:28px;
    display:block;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E");
    background-size:contain;
    background-repeat:no-repeat;
    background-position:center;
  }
  .bottom-nav a[data-nav="groups"]::before{
    content:"";
    width:28px;
    height:28px;
    display:block;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
    background-size:contain;
    background-repeat:no-repeat;
    background-position:center;
  }
  .bottom-nav a[data-nav="spiritual-log"]::before{
    content:"";
    width:28px;
    height:28px;
    display:block;
    /* 새싹 아이콘 (오늘의 씨앗) */
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21v-8'/%3E%3Cpath d='M12 13c0-3 2.5-5.5 5.5-5.5h2.5v0.5C20 11 17 13 14 13h-2'/%3E%3Cpath d='M12 13c0-3-2.5-5.5-5.5-5.5H4v0.5C4 11 7 13 10 13h2'/%3E%3Ccircle cx='12' cy='13' r='0.1'/%3E%3C/svg%3E");
    background-size:contain;
    background-repeat:no-repeat;
    background-position:center;
  }
  
  /* 모바일 메뉴 (햄버거 메뉴) */
  .mobile-menu{
    display:none;
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:rgba(0,0,0,.5);
    z-index:100;
    opacity:0;
    visibility:hidden;
    transition:opacity .2s ease, visibility .2s ease;
  }
  .mobile-menu.active{
    opacity:1;
    visibility:visible;
  }
  .mobile-menu-content{
    position:absolute;
    top:0;
    right:0;
    width:280px;
    max-width:85vw;
    height:100%;
    background:var(--card);
    box-shadow:-4px 0 16px rgba(0,0,0,.2);
    display:flex;
    flex-direction:column;
    padding:16px;
    gap:12px;
    transform:translateX(100%);
    transition:transform .3s ease;
  }
  .mobile-menu.active .mobile-menu-content{
    transform:translateX(0);
  }
  .mobile-menu-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:8px;
  }
  .mobile-menu-header h3{
    margin:0;
    font-size:18px;
    font-weight:1100;
    color:var(--ink);
  }
  .mobile-menu-close{
    background:none;
    border:none;
    padding:8px;
    cursor:pointer;
    font-size:20px;
    color:var(--ink);
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:8px;
  }
  .mobile-menu-close:hover{
    background:rgba(0,0,0,.05);
  }
  .mobile-menu-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px;
    border-radius:10px;
    text-decoration:none;
    color:var(--ink);
    font-weight:950;
    font-size:15px;
    transition:background .2s ease;
  }
  .mobile-menu-item:hover{
    background:rgba(0,0,0,.05);
  }
  .mobile-menu-item.chip{
    border:var(--pen-stroke);
    box-shadow:var(--pen-shadow);
  }
  .mobile-menu-footer-links{
    display:flex;
    flex-direction:column;
    gap:4px;
    margin-top:auto;
    padding-top:12px;
    border-top:1px solid var(--border);
  }
  .mobile-menu-footer-links .mobile-menu-item{
    font-size:14px;
    color:var(--ink-muted);
  }
  .mobile-menu-footer-links .mobile-menu-item:hover{
    color:var(--ink);
  }
  
  /* 모바일 스타일 */
  @media (max-width: 640px){
    .nav-links{ display:none; }
    .nav-toggle{ display:flex; }
    .lang-selector{ display:none !important; }
    .mobile-menu .lang-selector{ display:flex !important; }
    .chip{ display:none; }
    .bottom-nav{ display:block; }
    body{ padding-bottom:72px; }
    .mobile-menu{ display:block; }
  .footer .footer-links{ display:none; }
  }
  
  .chip{
    display:flex; align-items:center; gap:8px;
    padding:8px 10px; border:var(--pen-stroke);
    border-radius:999px; background:#fff;
    font-weight:950; font-size:15px;
    color:var(--ink);
    box-shadow:var(--pen-shadow);
  }
  a.chip{ text-decoration:none; cursor:pointer; }
  a.chip:hover{ color:var(--ink); }
  button.chip{ border:var(--pen-stroke); cursor:pointer; font:inherit; }
  button.chip:hover{ color:var(--ink); }
  .chip-avatar{ width:26px; height:26px; border-radius:50%; object-fit:cover; flex-shrink:0; }
  .dot{width:8px; height:8px; border-radius:50%; background:var(--success)}
  
  /* Hero - 단색 배경 + 볼펜 테두리 */
  .hero{
    margin-top:16px;
    border:var(--pen-stroke);
    background:transparent;
    border-radius:22px;
    padding:18px;
    box-shadow:var(--pen-shadow);
    overflow:hidden;
    position:relative;
  }
  .hero-inner{
    position:relative;
    display:flex; gap:16px;
    align-items:flex-start; justify-content:space-between;
    flex-wrap:wrap;
  }
  .hero h1{margin:0; font-size:26px; letter-spacing:-.2px; line-height:1.25; color:var(--ink)}
  .hero p{margin:8px 0 0; font-size:15px; color:var(--ink-muted); line-height:1.55; max-width:640px}
  .hero-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}

  .hero-actions{margin-top:12px}
  .hero-side{min-width:260px}

  /* Hero 769px 이상: 두 컬럼 비율 정리 */
  @media (min-width: 769px){
    .hero-inner{flex-wrap:nowrap; align-items:stretch; gap:20px}
    .hero-inner > div:first-child{flex:1 1 0; min-width:0; max-width:100%}
    .hero-side{flex:0 0 280px; min-width:260px; max-width:320px}
  }

  /* Hero 반응형 */
  @media (max-width: 768px){
    .hero{padding:14px 16px; margin-top:12px; border-radius:18px}
    .hero-inner{gap:14px}
    .hero-inner > div:first-child{min-width:0; flex:1 1 100%}
    .hero-side{min-width:0; width:100%}
    .hero h1{font-size:24px}
    .hero p{font-size:15px; max-width:100%}
  }
  @media (max-width: 480px){
    .hero{padding:14px 16px; margin-top:12px; border-radius:18px}
    .hero-inner{gap:14px}
    .hero h1{font-size:22px}
    .hero p{font-size:15px}
    .hero-actions{flex-direction:column; gap:10px; margin-top:12px}
    .hero-actions .btn{width:100%; justify-content:center}
  }

  /* 스마트폰: 글자·요소 크기 더 축소 */
  @media (max-width: 640px){
    .btn{ padding: 6px 8px; font-size: 12px; border-radius: 8px; min-height: 32px; }
    .card-head{ padding: 8px 10px; font-size: 13px; }
    .card-body{ padding: 8px 10px; }
    .nav-inner{ padding: 10px 14px; }
    .brand{ font-size: 16px; }
    .nav-links a{ padding: 6px 8px; font-size: 14px; min-height: 36px; box-sizing: border-box; display: inline-flex; align-items: center; }
    .chip{ padding: 6px 10px; font-size: 12px; min-height: 34px; }
    .hero h1{ font-size: 16px; }
    .hero p{ font-size: 12px; }
    .big{ font-size: 18px; }
    .small{ font-size: 10px; }
    .progress-wrap{ padding: 6px; gap: 4px; border-radius: 8px; }
    .bar{ height: 6px; }
    .mobile-menu-content{ padding: 8px; gap: 6px; width: 220px; }
    .mobile-menu-header h3{ font-size: 14px; }
    .mobile-menu-item{ padding: 6px; font-size: 12px; }
    .mobile-menu-footer-links{ padding-top: 6px; gap: 0; }
    .mobile-menu-footer-links .mobile-menu-item{ font-size: 11px; }
    .bottom-nav a{ padding: 8px 14px; font-size: 14px; min-width: 56px; }
    .bottom-nav a[data-nav="home"]::before,
    .bottom-nav a[data-nav="groups"]::before{ width: 22px; height: 22px; }
    .footer-copyright{ font-size: 9px; margin-top: 2px; }
  }
  
  /* Buttons - 볼펜 테두리 */
  .btn{
    border:var(--pen-stroke);
    background:#fff;
    color:var(--ink);
    padding:10px 14px;
    border-radius:12px;
    font-weight:1000;
    font-size:15px;
    cursor:default;
    display:inline-flex; align-items:center; gap:8px;
    white-space:nowrap;
    box-shadow:var(--pen-shadow);
  }
  .btn.primary{border:var(--pen-stroke); background:#e8eef7; color:var(--ink)}
  .btn.success{border:var(--pen-stroke); background:#e8f5e0; color:#2d5a1c}
  .btn.ghost{background:transparent; box-shadow:var(--pen-shadow); color:var(--ink)}
  .btn:disabled{ opacity:.65; cursor:not-allowed; }
  
  /* Grid + Cards */
  .grid{
    display:grid;
    grid-template-columns: 1fr 380px;
    gap:14px;
    margin-top:14px;
  }
  @media (max-width: 980px){ .grid{grid-template-columns:1fr} }
  
  .card{
    background:var(--card);
    border:var(--pen-stroke);
    border-radius:var(--radius);
    box-shadow:var(--pen-shadow);
    overflow:hidden;
  }
  .card-head{
    padding:14px;
    border-bottom:var(--pen-stroke);
    display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
  }
  .card-head h2{margin:0; font-size:17px; letter-spacing:-.15px; color:var(--ink)}
  .sub{margin-top:4px; font-size:14px; color:var(--ink-muted)}
  .card-body{padding:14px}
  
  /* Progress - 단색 + 볼펜 테두리 */
  .progress-wrap{
    display:flex; flex-direction:column; gap:10px;
    border:var(--pen-stroke);
    border-radius:14px;
    background:var(--secondary);
    padding:12px;
    box-shadow:var(--pen-shadow);
  }
  .progress-top{display:flex; justify-content:space-between; align-items:flex-end; gap:10px}
  .big{font-size:26px; font-weight:1100; letter-spacing:-.3px; color:var(--ink); line-height:1}
  .small{font-size:13px; color:var(--ink-muted); font-weight:950}
  .bar{
    height:12px;
    background:#eef2f7;
    border-radius:999px;
    overflow:hidden;
    border:var(--pen-stroke);
  }
  .bar > div{
    height:100%;
    background:var(--ink);
    border-radius:999px;
    transition:width .25s ease;
  }
  .pill-row{display:flex; gap:10px; flex-wrap:wrap}
  .pill{
    display:inline-flex; align-items:center; gap:8px;
    padding:8px 10px;
    border:var(--pen-stroke);
    border-radius:999px;
    background:#fff;
    font-size:13px;
    font-weight:1000;
    color:var(--ink);
    box-shadow:var(--pen-shadow);
  }
  .pill.ok{background:#e8f5e0; color:#2d5a1c}
  .pill.info{background:#e8eef7; color:var(--ink)}
  
  /* Rows */
  .row{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:12px;
    border:var(--pen-stroke);
    border-radius:14px;
    background:#fff;
    box-shadow:var(--pen-shadow);
  }
  .row .left{min-width:0}
  .row .title{font-weight:1100; font-size:15px; letter-spacing:-.1px; color:var(--ink)}
  .row .desc{
    margin-top:4px;
    font-size:13px;
    color:var(--ink-muted);
    font-weight:950;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .mini{
    width:92px; height:10px; border-radius:999px;
    background:#eef2f7; border:var(--pen-stroke);
    overflow:hidden;
  }
  .mini > div{
    height:100%;
    background:var(--ink);
    border-radius:999px;
    transition:width .25s ease;
  }
  .list{display:flex; flex-direction:column; gap:10px}
  
  /* Stats grid - 오늘 체크 + 전체 진행률 */
  .stats-grid{
    display:flex;
    flex-direction:column;
    gap:14px;
  }
  @media (min-width: 769px){
    .stats-grid{
      flex-direction:row;
      align-items:stretch;
    }
    .stats-grid .today-box{
      flex:0 0 280px;
      min-width:0;
    }
    .stats-grid .progress-wrap{
      flex:1 1 0;
      min-width:0;
    }
  }

  /* Today box - 단색 + 볼펜 테두리 */
  .today-box{
    border:var(--pen-stroke);
    background:rgba(126,211,33,.12);
    border-radius:14px;
    padding:12px;
    display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
    box-shadow:var(--pen-shadow);
  }
  .today-box strong{font-size:15px; color:var(--ink)}
  .today-box p{margin:6px 0 0; font-size:13px; color:var(--ink-muted); font-weight:950; line-height:1.45}
  .today-box.today-checked{ background:rgba(126,211,33,.22); border-color:var(--ink); }

  /* Tags (small) */
  .tag{
    display:inline-flex; align-items:center; gap:6px;
    padding:6px 10px; border-radius:999px;
    border:var(--pen-stroke);
    font-size:13px; font-weight:1000;
    background:#fff; color:var(--ink);
    box-shadow:var(--pen-shadow);
  }
  .tag.ok{background:#e8f5e0; color:#2d5a1c}

  /* Footer */
  .footer{
    margin-top:48px;
    padding:24px 0;
    border-top:var(--pen-stroke);
    text-align:center;
  }
  .footer-links{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:16px;
    margin-bottom:12px;
  }
  .footer-links a{
    font-size:13px;
    color:var(--ink-muted);
    text-decoration:none;
    font-weight:950;
    transition:color .2s ease;
  }
  .footer-links a:hover{
    color:var(--ink);
    text-decoration:underline;
  }
  .footer-copyright{
    font-size:12px;
    color:var(--ink-muted);
    margin-top:8px;
  }

  /* 전역 로딩 스피너 (화면 전환·지연 시) */
  .page-loader{
    position:fixed;
    inset:0;
    z-index:9999;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(250,249,246,.92);
    backdrop-filter:blur(4px);
    transition:opacity .2s ease, visibility .2s ease;
  }
  .page-loader.hide{
    opacity:0;
    visibility:hidden;
    pointer-events:none;
  }
  .page-loader-spinner{
    width:44px;
    height:44px;
    border:3px solid var(--border);
    border-top-color:var(--ink);
    border-radius:50%;
    animation:page-loader-spin .75s linear infinite;
  }
  @keyframes page-loader-spin{
    to{ transform:rotate(360deg); }
  }
