*{box-sizing:border-box}
:root{
  --bg:#f4f5f7;--surface:#f4f5f7;--surface-2:#f8f9fb;--text:#111418;--muted:#747a84;
  --border:rgba(23,27,32,.08);--accent:#111418;--shadow-dark:rgba(164,171,184,.35);--shadow-light:rgba(255,255,255,.95);
  --wood-1:#f3d3a7;--wood-2:#e9ba7c;--wood-line:rgba(121,73,28,.18);--beige:#f4ede2;
}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR","Segoe UI",sans-serif}
body{transition:background .25s ease,color .25s ease}
button,input{font:inherit}
button{color:inherit}
.app-shell{min-height:100vh;padding:max(20px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:52px}
.status-wrap{display:flex;align-items:center;gap:9px;font-weight:750}.online-dot{width:10px;height:10px;border-radius:50%;background:#1aae5b;box-shadow:0 0 0 4px rgba(26,174,91,.08)}
.top-actions{display:flex;gap:12px}.icon-label{display:flex;align-items:center;gap:9px}
.wood-button,.round-button,.primary-btn,.secondary-btn,.close-btn,.nav-btn,.theme-choice{
  border:0;cursor:pointer;transition:transform .12s ease,box-shadow .18s ease,background .18s ease
}
.wood-button:active,.round-button:active,.primary-btn:active,.secondary-btn:active,.nav-btn:active,.theme-choice:active{transform:translateY(1px)}
.wood-button{padding:12px 18px;border-radius:18px;background:var(--surface);box-shadow:7px 7px 14px var(--shadow-dark),-7px -7px 14px var(--shadow-light);font-weight:800}
main{flex:1;display:block;min-height:0}
.view{display:none;width:100%}.view.active{display:block}
.date-hero{text-align:center;margin:0 auto 20px}.year-month{font-size:clamp(24px,2vw,36px);font-weight:850;margin-bottom:2px}.date-number{font-size:clamp(118px,16vw,220px);line-height:.88;font-weight:900;letter-spacing:-.07em}.weekday{font-size:clamp(32px,4vw,58px);font-weight:900;letter-spacing:-.05em;margin-top:8px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:24px;max-width:1500px;margin:0 auto}
.info-card{border:1px solid var(--border);border-radius:28px;padding:22px 26px;background:var(--surface);box-shadow:12px 12px 24px var(--shadow-dark),-12px -12px 24px var(--shadow-light)}
.info-card h2{font-size:19px;margin:0 0 12px}.weather-main{display:flex;align-items:center;justify-content:center;gap:26px;min-height:110px}
.weather-icon{width:110px;height:86px;display:grid;place-items:center;color:var(--text)}.weather-icon svg{width:100%;height:100%;stroke:currentColor;fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.temps{display:flex;align-items:baseline;gap:16px;white-space:nowrap}.temps strong{font-size:clamp(45px,5vw,74px);letter-spacing:-.04em}.temps span{font-size:clamp(28px,3vw,46px);color:var(--muted)}
.weather-meta{display:flex;gap:10px;color:var(--muted);font-weight:650;margin-top:5px}
.schedule-grid{margin-top:22px}.schedule-card{min-height:190px}.event-list{display:grid;gap:10px}.empty{color:var(--muted);padding:20px 4px}
.event-row{display:grid;grid-template-columns:88px 1fr;gap:12px;align-items:center;padding:12px 15px;border-radius:18px;background:var(--surface-2);box-shadow:inset 1px 1px 0 rgba(255,255,255,.8),5px 5px 12px rgba(160,166,178,.18)}
.event-time{font-size:19px;font-weight:900}.event-title{font-weight:850}.event-memo{color:var(--muted);font-size:13px;margin-top:3px}
.bottom-nav{width:min(760px,100%);display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:22px auto 8px;padding:7px;border-radius:24px;background:var(--surface);box-shadow:9px 9px 20px var(--shadow-dark),-9px -9px 20px var(--shadow-light)}
.nav-btn{min-height:54px;border-radius:18px;background:transparent;display:flex;align-items:center;justify-content:center;gap:9px;font-size:17px}
.nav-btn.active{background:var(--surface-2);box-shadow:inset 2px 2px 5px rgba(164,171,184,.2),inset -2px -2px 5px rgba(255,255,255,.95)}
footer{display:flex;justify-content:center;gap:8px;color:var(--muted);font-size:14px}
.calendar-toolbar{display:grid;grid-template-columns:56px 1fr 56px;align-items:center;gap:12px;max-width:1500px;margin:0 auto 16px}.calendar-toolbar h1{text-align:center;margin:0;font-size:30px}
.round-button{width:52px;height:52px;border-radius:50%;background:var(--surface);box-shadow:7px 7px 14px var(--shadow-dark),-7px -7px 14px var(--shadow-light);font-size:30px}
.calendar-card{max-width:1500px;margin:0 auto;padding:14px;border-radius:28px;background:var(--surface);box-shadow:12px 12px 24px var(--shadow-dark),-12px -12px 24px var(--shadow-light)}
.weekday-row,.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr)}.weekday-row{height:46px;align-items:center;text-align:center;font-weight:850;color:var(--muted)}
.calendar-grid{border-top:1px solid var(--border);border-left:1px solid var(--border)}
.day-cell{position:relative;min-height:clamp(105px,11vh,150px);padding:12px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);background:rgba(255,255,255,.13);cursor:pointer;overflow:hidden;text-align:left}
.day-cell:hover{background:rgba(255,255,255,.28)}.day-cell.outside{color:#aeb2b9}.day-cell.today{box-shadow:inset 0 0 0 2px rgba(17,20,24,.35);border-radius:14px}
.day-number{position:absolute;top:10px;left:10px;font-size:18px;font-weight:850;line-height:1}.first-event{position:absolute;right:9px;bottom:9px;max-width:calc(100% - 18px);font-size:12px;font-weight:800;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:5px 8px;border-radius:10px;background:rgba(255,255,255,.48);border:1px solid var(--border)}
.more-events{position:absolute;left:10px;bottom:10px;color:var(--muted);font-size:11px;font-weight:800}.calendar-help{text-align:center;color:var(--muted);font-size:13px}
.modal{border:0;padding:0;background:transparent;max-width:min(760px,94vw);width:100%}.modal::backdrop{background:rgba(16,18,20,.35);backdrop-filter:blur(8px)}
.modal-card{border:1px solid var(--border);border-radius:28px;padding:24px;background:var(--bg);color:var(--text);box-shadow:20px 20px 50px rgba(0,0,0,.2);max-height:88vh;overflow:auto}
.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px}.modal-head h2{margin:0;font-size:28px}.eyebrow{margin:0 0 4px;color:var(--muted);font-size:12px;font-weight:850}
.close-btn{width:42px;height:42px;border-radius:50%;background:var(--surface);box-shadow:5px 5px 10px var(--shadow-dark),-5px -5px 10px var(--shadow-light);font-size:26px}
.modal-card label{display:grid;gap:7px;margin:12px 0;font-size:13px;font-weight:800;color:var(--muted)}.modal-card input{width:100%;padding:13px 14px;border:1px solid var(--border);border-radius:14px;background:rgba(255,255,255,.45);color:var(--text);outline:none}.modal-card input:focus{box-shadow:0 0 0 3px rgba(20,22,26,.08)}
.modal-actions,.inline-buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.primary-btn,.secondary-btn{padding:11px 16px;border-radius:14px;font-weight:850}.primary-btn{background:var(--text);color:var(--bg)}.secondary-btn{background:var(--surface);box-shadow:5px 5px 10px var(--shadow-dark),-5px -5px 10px var(--shadow-light)}
.date-event-manager{display:grid;gap:8px;margin-top:18px}.manage-row{display:grid;grid-template-columns:76px 1fr auto;gap:10px;align-items:center;border-top:1px solid var(--border);padding-top:10px}.manage-row button{border:0;background:transparent;color:#b33;cursor:pointer;font-weight:800}
.settings-section{padding:16px 0;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 12px}.theme-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.theme-choice{display:grid;grid-template-columns:110px 1fr;gap:14px;align-items:center;text-align:left;padding:14px;border-radius:20px;background:var(--surface);box-shadow:6px 6px 14px var(--shadow-dark),-6px -6px 14px var(--shadow-light)}.theme-choice.selected{outline:2px solid rgba(17,20,24,.45)}.theme-choice small{display:block;color:var(--muted);margin-top:4px}
.theme-preview{height:68px;border-radius:15px;display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:10px}.theme-preview i{display:block;border-radius:10px}.preview-white{background:#f4f5f7;box-shadow:inset 3px 3px 7px #d9dde4,inset -3px -3px 7px #fff}.preview-white i{background:#f4f5f7;box-shadow:3px 3px 6px #cfd4dc,-3px -3px 6px #fff}.preview-wood{background:#f3e9dc}.preview-wood i{background:linear-gradient(145deg,#edc896,#e3b577);box-shadow:2px 3px 6px rgba(104,61,22,.18)}
.form-row{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:10px}.settings-line{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:12px 0}.settings-line small{display:block;color:var(--muted);margin-top:4px}.status-pill{padding:7px 10px;border-radius:999px;background:rgba(26,174,91,.12);color:#138147;font-weight:850;font-size:12px}





/* 홈: 일요일/공휴일이면 큰 날짜 숫자만 빨간색 */
.date-number.holiday-date{
  color:#c62828;
}

.hero-holiday-name{
  margin-top:10px;
  color:#c62828;
  font-size:clamp(18px,2vw,28px);
  line-height:1.2;
  font-weight:900;
  letter-spacing:-.03em;
  text-align:center;
}

body[data-theme="wood"] .date-number.holiday-date,
body[data-theme="wood"] .hero-holiday-name{
  color:#b3261e;
}

/* 대한민국 일요일 / 공휴일 표시 */
.weekday-row span:first-child{
  color:#c62828;
}

.day-cell.sunday .day-number,
.day-cell.holiday .day-number{
  color:#c62828;
}

.day-cell.outside.sunday .day-number,
.day-cell.outside.holiday .day-number{
  color:#d56a6a;
}

.holiday-name{
  position:absolute;
  top:9px;
  right:9px;
  max-width:calc(100% - 46px);
  color:#c62828;
  font-size:11px;
  line-height:1.2;
  font-weight:850;
  text-align:right;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

body[data-theme="wood"] .day-cell.sunday .day-number,
body[data-theme="wood"] .day-cell.holiday .day-number,
body[data-theme="wood"] .holiday-name,
body[data-theme="wood"] .weekday-row span:first-child{
  color:#b3261e;
}

/* 하루 일정이 하나뿐이면 홈에서 크게 표시 */
.schedule-card{
  display:flex;
  flex-direction:column;
}

.single-event-list{
  flex:1;
  display:flex;
  align-items:stretch;
}

.single-event-list .event-row{
  flex:1;
  width:100%;
  min-height:118px;
  grid-template-columns:120px 1fr;
  padding:22px 24px;
  align-items:center;
  border-radius:22px;
}

.single-event-list .event-time{
  font-size:clamp(28px,3vw,42px);
  letter-spacing:-.03em;
}

.single-event-list .event-title{
  font-size:clamp(24px,2.6vw,38px);
  line-height:1.18;
  letter-spacing:-.035em;
}

.single-event-list .event-memo{
  font-size:clamp(14px,1.4vw,18px);
  margin-top:7px;
}

@media (orientation:landscape) and (max-height:850px){
  .single-event-list .event-row{
    min-height:92px;
    padding:14px 18px;
    grid-template-columns:105px 1fr;
  }
  .single-event-list .event-time{
    font-size:30px;
  }
  .single-event-list .event-title{
    font-size:26px;
  }
}

/* 모던 화이트 테마: 하단 홈/달력 버튼의 입체감과 구분감 강화 */
body[data-theme="white"] .bottom-nav{
  background:#f4f5f7;
  box-shadow:
    14px 14px 30px rgba(148,155,168,.46),
    -14px -14px 30px rgba(255,255,255,1);
}

body[data-theme="white"] .nav-btn{
  background:#f4f5f7;
  box-shadow:
    7px 7px 15px rgba(151,158,171,.34),
    -7px -7px 15px rgba(255,255,255,.98);
}

body[data-theme="white"] .nav-btn.active{
  background:#f7f8fa;
  box-shadow:
    inset 5px 5px 11px rgba(151,158,171,.34),
    inset -5px -5px 11px rgba(255,255,255,1),
    0 1px 2px rgba(20,24,30,.05);
}

body[data-theme="white"] .nav-btn:not(.active):hover{
  box-shadow:
    9px 9px 19px rgba(151,158,171,.4),
    -9px -9px 19px rgba(255,255,255,1);
}

/* 우드 베이지: 배경은 깔끔한 베이지, 카드/버튼만 우드 톤 */
body[data-theme="wood"]{
  --bg:#f3eadf;--surface:#e8bf8b;--surface-2:#f0d4b0;--text:#21170f;--muted:#705f4d;
  --border:rgba(111,72,36,.18);--shadow-dark:rgba(129,89,52,.27);--shadow-light:rgba(255,251,244,.9)
}
body[data-theme="wood"] .app-shell{
  background:linear-gradient(180deg,#f5ede2 0%,#f1e6d9 100%);
}
body[data-theme="wood"] .info-card,
body[data-theme="wood"] .wood-button,
body[data-theme="wood"] .round-button,
body[data-theme="wood"] .bottom-nav,
body[data-theme="wood"] .calendar-card,
body[data-theme="wood"] .secondary-btn,
body[data-theme="wood"] .close-btn{
  background:linear-gradient(145deg,#edc896,#e3b577);
  box-shadow:
    9px 11px 22px rgba(116,77,41,.25),
    -7px -7px 16px rgba(255,248,238,.78);
}
body[data-theme="wood"] .event-row,
body[data-theme="wood"] .nav-btn.active{background:#f1d3ad}
body[data-theme="wood"] .day-cell{background:rgba(255,250,242,.36)}
body[data-theme="wood"] .first-event{background:#e8bf8b}
body[data-theme="wood"] .theme-choice{background:#f3eadf}

@media (max-width:850px){
  .app-shell{padding:16px}.top-actions .icon-label span:last-child{display:none}.wood-button{padding:12px}
  .two-col{grid-template-columns:1fr;gap:14px}.schedule-grid{margin-top:14px}.date-number{font-size:128px}
  .weather-main{justify-content:flex-start}.calendar-card{padding:7px}.day-cell{min-height:92px;padding:8px}.first-event{font-size:10px;padding:4px 5px}.form-row,.theme-grid{grid-template-columns:1fr}
}
@media (orientation:landscape) and (max-height:850px){
  .date-hero{margin-bottom:12px}.date-number{font-size:116px}.weekday{font-size:34px}.year-month{font-size:22px}
  .info-card{padding:14px 18px;border-radius:22px}.weather-main{min-height:78px}.weather-icon{width:80px;height:66px}.temps strong{font-size:46px}.temps span{font-size:30px}
  .schedule-grid{margin-top:14px}.schedule-card{min-height:150px}.event-row{padding:8px 12px}.bottom-nav{margin-top:14px;min-height:48px}.nav-btn{min-height:44px}
}


@media (orientation:landscape) and (max-height:850px){
  .hero-holiday-name{
    margin-top:5px;
    font-size:18px;
  }
}


/* iPad 세로 화면 최적화:
   - 큰 날짜는 유지하되 높이를 압축
   - 오늘/내일 날씨를 좌우 2열
   - 오늘/내일 일정도 좌우 2열
   - 하단 홈/달력 버튼이 잘리지 않도록 전체 높이 안에 수납 */
@media (min-width:700px) and (max-width:1024px) and (orientation:portrait){
  .app-shell{
    padding:12px max(18px,env(safe-area-inset-right)) 10px max(18px,env(safe-area-inset-left));
    gap:8px;
  }

  .topbar{
    min-height:42px;
  }

  .wood-button{
    padding:10px 14px;
    border-radius:16px;
  }

  .date-hero{
    margin:4px auto 10px;
  }

  .year-month{
    font-size:18px;
    margin-bottom:0;
  }

  .date-number{
    font-size:118px;
    line-height:.82;
  }

  .weekday{
    font-size:28px;
    margin-top:4px;
  }

  .hero-holiday-name{
    margin-top:4px;
    font-size:16px;
  }

  .two-col{
    grid-template-columns:1fr 1fr !important;
    gap:12px;
    max-width:100%;
  }

  .info-card{
    padding:14px 16px;
    border-radius:22px;
  }

  .info-card h2{
    font-size:17px;
    margin-bottom:8px;
  }

  .weather-main{
    min-height:74px;
    gap:14px;
    justify-content:flex-start;
  }

  .weather-icon{
    width:58px;
    height:46px;
  }

  .temps{
    gap:10px;
  }

  .temps strong{
    font-size:38px;
  }

  .temps span{
    font-size:24px;
  }

  .weather-meta{
    gap:6px;
    font-size:13px;
    margin-top:2px;
    flex-wrap:wrap;
  }

  .schedule-grid{
    margin-top:12px;
  }

  .schedule-card{
    min-height:150px;
  }

  .event-list{
    gap:8px;
  }

  .event-row{
    grid-template-columns:70px 1fr;
    gap:9px;
    padding:9px 11px;
    border-radius:14px;
  }

  .event-time{
    font-size:17px;
  }

  .event-title{
    font-size:16px;
  }

  .event-memo{
    font-size:12px;
    margin-top:2px;
  }

  .single-event-list .event-row{
    min-height:82px;
    grid-template-columns:88px 1fr;
    padding:12px 14px;
    border-radius:18px;
  }

  .single-event-list .event-time{
    font-size:28px;
  }

  .single-event-list .event-title{
    font-size:22px;
  }

  .single-event-list .event-memo{
    font-size:13px;
    margin-top:4px;
  }

  .bottom-nav{
    width:min(520px,100%);
    gap:10px;
    padding:6px;
    margin:12px auto 4px;
    border-radius:20px;
  }

  .nav-btn{
    min-height:42px;
    font-size:15px;
    border-radius:14px;
  }

  footer{
    font-size:12px;
    margin-top:2px;
  }
}


/* v11: iPad 세로 홈을 무조건 2x2로 고정
   1행: 오늘 날씨 | 내일 날씨
   2행: 오늘 일정 | 내일 일정 */
@media (orientation:portrait) and (min-width:500px){
  #homeView .two-col{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:12px !important;
    width:100% !important;
    max-width:none !important;
  }

  #homeView .weather-card,
  #homeView .schedule-card{
    min-width:0 !important;
    width:auto !important;
  }

  #homeView .weather-main{
    min-width:0;
    gap:10px;
  }

  #homeView .weather-main > div:last-child{
    min-width:0;
  }

  #homeView .temps{
    gap:7px;
  }

  #homeView .temps strong{
    font-size:clamp(34px,5.4vw,48px);
  }

  #homeView .temps span{
    font-size:clamp(21px,3.6vw,30px);
  }

  #homeView .weather-meta{
    font-size:clamp(11px,1.7vw,13px);
  }

  #homeView .schedule-grid{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  }
}

/* 화면 폭이 비교적 좁아져도 iPad/태블릿에서는 2열 유지 */
@media (orientation:portrait) and (min-width:500px) and (max-width:699px){
  #homeView .info-card{
    padding:12px 12px;
  }

  #homeView .weather-icon{
    width:48px;
    height:42px;
  }

  #homeView .event-row{
    grid-template-columns:62px minmax(0,1fr);
    padding:8px 9px;
  }

  #homeView .single-event-list .event-row{
    grid-template-columns:76px minmax(0,1fr);
  }
}


/* v12: iPad 세로 홈 화면을 1화면에 정확히 맞춤
   - 날짜 숫자는 다시 크게
   - 날씨/일정 2x2 유지
   - 하단 홈/달력 버튼까지 화면 안에 고정 */
@media (orientation:portrait) and (min-width:700px) and (max-width:1100px){
  html, body{
    height:100%;
    overflow:hidden;
  }

  .app-shell{
    height:100svh;
    min-height:100svh;
    max-height:100svh;
    overflow:hidden;
    padding:
      max(10px,env(safe-area-inset-top))
      max(18px,env(safe-area-inset-right))
      max(8px,env(safe-area-inset-bottom))
      max(18px,env(safe-area-inset-left));
    display:grid;
    grid-template-rows:44px minmax(0,1fr) 52px 18px;
    gap:7px;
  }

  .topbar{
    min-height:44px;
    height:44px;
  }

  .top-actions{
    gap:9px;
  }

  .wood-button{
    min-height:38px;
    padding:8px 12px;
    border-radius:15px;
  }

  main{
    min-height:0;
    overflow:hidden;
    display:block;
  }

  #homeView.active{
    height:100%;
    min-height:0;
    display:grid !important;
    grid-template-rows:minmax(185px,1.15fr) minmax(132px,.82fr) minmax(150px,.95fr);
    gap:12px;
    align-content:stretch;
  }

  .date-hero{
    min-height:0;
    margin:0;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
  }

  .year-month{
    font-size:clamp(22px,3.1vw,30px);
    line-height:1.05;
    margin:0 0 4px;
  }

  .date-number{
    font-size:clamp(150px,22vw,205px);
    line-height:.76;
    letter-spacing:-.075em;
  }

  .weekday{
    font-size:clamp(32px,4.7vw,44px);
    line-height:1;
    margin-top:10px;
  }

  .hero-holiday-name{
    margin-top:6px;
    font-size:clamp(16px,2.4vw,22px);
    line-height:1.1;
  }

  #homeView .two-col{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:12px !important;
    max-width:none !important;
    width:100% !important;
    min-height:0;
    margin:0;
  }

  #homeView .info-card{
    min-width:0;
    min-height:0;
    height:100%;
    padding:13px 16px;
    border-radius:21px;
    overflow:hidden;
  }

  #homeView .info-card h2{
    font-size:18px;
    line-height:1.1;
    margin:0 0 7px;
  }

  #homeView .weather-main{
    min-height:0;
    height:calc(100% - 27px);
    display:grid;
    grid-template-columns:76px minmax(0,1fr);
    align-items:center;
    justify-content:initial;
    gap:14px;
  }

  #homeView .weather-icon{
    width:72px;
    height:58px;
  }

  #homeView .weather-main > div:last-child{
    min-width:0;
  }

  #homeView .temps{
    gap:9px;
  }

  #homeView .temps strong{
    font-size:clamp(42px,6.4vw,56px);
    line-height:1;
  }

  #homeView .temps span{
    font-size:clamp(25px,4vw,34px);
    line-height:1;
  }

  #homeView .weather-meta{
    margin-top:6px;
    gap:6px;
    font-size:clamp(12px,1.8vw,15px);
    line-height:1.15;
    white-space:normal;
  }

  #homeView .schedule-grid{
    margin:0;
    min-height:0;
  }

  #homeView .schedule-card{
    min-height:0;
    display:flex;
    flex-direction:column;
  }

  #homeView .event-list{
    min-height:0;
    flex:1;
    overflow:hidden;
    gap:6px;
  }

  #homeView .event-row{
    grid-template-columns:68px minmax(0,1fr);
    gap:8px;
    padding:8px 10px;
    border-radius:13px;
  }

  #homeView .event-time{
    font-size:16px;
    line-height:1;
  }

  #homeView .event-title{
    font-size:15px;
    line-height:1.1;
  }

  #homeView .event-memo{
    font-size:11px;
    line-height:1.1;
    margin-top:2px;
  }

  #homeView .single-event-list{
    min-height:0;
  }

  #homeView .single-event-list .event-row{
    min-height:0;
    height:100%;
    grid-template-columns:94px minmax(0,1fr);
    padding:14px 15px;
    border-radius:18px;
  }

  #homeView .single-event-list .event-time{
    font-size:clamp(27px,4.1vw,36px);
  }

  #homeView .single-event-list .event-title{
    font-size:clamp(22px,3.4vw,30px);
    line-height:1.08;
  }

  #homeView .single-event-list .event-memo{
    font-size:clamp(12px,1.8vw,15px);
    margin-top:5px;
  }

  .bottom-nav{
    align-self:stretch;
    width:min(560px,100%);
    height:52px;
    min-height:52px;
    margin:0 auto;
    padding:5px;
    border-radius:19px;
  }

  .nav-btn{
    min-height:42px;
    height:42px;
    border-radius:14px;
    font-size:16px;
  }

  footer{
    height:18px;
    min-height:18px;
    align-items:center;
    font-size:11px;
    line-height:18px;
  }

  /* 달력 화면은 필요하면 내부 스크롤 허용 */
  #calendarView.active{
    height:100%;
    overflow:auto;
    padding-bottom:4px;
  }
}

/* 구형 iPad처럼 CSS 뷰포트가 700px보다 조금 작은 경우도 같은 2x2 원칙 유지 */
@media (orientation:portrait) and (min-width:600px) and (max-width:699px){
  #homeView.active{
    display:grid !important;
  }

  #homeView .two-col{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  }

  .date-number{
    font-size:clamp(138px,23vw,165px) !important;
  }

  .bottom-nav{
    margin-bottom:max(2px,env(safe-area-inset-bottom));
  }
}


/* v13: iPad 세로 날짜 영역 간격 개선 + 카드 세로 높이 축소 */
@media (orientation:portrait) and (min-width:700px) and (max-width:1100px){
  #homeView.active{
    grid-template-rows:minmax(210px,1.28fr) minmax(118px,.70fr) minmax(136px,.82fr);
    gap:10px;
  }

  .date-hero{
    justify-content:center;
    padding-top:4px;
  }

  .year-month{
    margin-bottom:14px;
    line-height:1.1;
  }

  .date-number{
    line-height:.80;
    margin:0;
  }

  .weekday{
    margin-top:18px;
    line-height:1.05;
  }

  .hero-holiday-name{
    margin-top:10px;
  }

  #homeView .info-card{
    padding-top:10px;
    padding-bottom:10px;
  }

  #homeView .info-card h2{
    margin-bottom:5px;
  }

  #homeView .weather-main{
    height:calc(100% - 23px);
    grid-template-columns:68px minmax(0,1fr);
    gap:10px;
  }

  #homeView .weather-icon{
    width:62px;
    height:50px;
  }

  #homeView .temps strong{
    font-size:clamp(40px,6vw,52px);
  }

  #homeView .temps span{
    font-size:clamp(24px,3.7vw,32px);
  }

  #homeView .weather-meta{
    margin-top:4px;
    font-size:clamp(11px,1.7vw,14px);
  }

  #homeView .schedule-card{
    padding-top:10px;
    padding-bottom:10px;
  }

  #homeView .event-row{
    padding-top:7px;
    padding-bottom:7px;
  }

  #homeView .single-event-list .event-row{
    padding-top:10px;
    padding-bottom:10px;
  }
}
