:root{
  --bg:#f5f7fa; --card:#ffffff; --ink:#1f2933; --sub:#66727f;
  --accent:#ff8c42; --accent2:#2e8bc0; --line:#e7ebf0;
}
*{box-sizing:border-box;margin:0;padding:0;}
body{
  font-family:'Apple SD Gothic Neo','Malgun Gothic',system-ui,sans-serif;
  background:var(--bg); color:var(--ink); line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:720px; margin:0 auto; padding:0 16px 60px;}

/* Hero */
header{
  background:linear-gradient(135deg,#ff8c42 0%,#ffb56b 50%,#2e8bc0 100%);
  color:#fff; padding:48px 20px 36px; text-align:center;
  position:relative;
}
header .back-home{
  position:absolute; left:14px; top:14px;
  color:#fff; text-decoration:none; font-size:13px; font-weight:600;
  background:rgba(255,255,255,.22); padding:6px 12px 6px 10px; border-radius:20px;
  backdrop-filter:blur(4px); transition:background .15s;
}
header .back-home:hover{background:rgba(255,255,255,.36);}
header .emoji{font-size:42px;}
header h1{font-size:28px; margin:6px 0 4px; letter-spacing:-.5px;}
header p{opacity:.95; font-size:14px;}
header .dates{
  display:inline-block; margin-top:12px; padding:6px 16px;
  background:rgba(255,255,255,.22); border-radius:30px; font-size:13px;
  backdrop-filter:blur(4px);
}

/* Tab nav (페이지 이동) */
nav.tabs{
  position:sticky; top:0; z-index:10; background:rgba(245,247,250,.94);
  backdrop-filter:blur(8px); border-bottom:1px solid var(--line);
  display:flex; gap:8px; overflow-x:auto; padding:12px 16px; justify-content:safe center;
}
nav.tabs a{
  flex:0 0 auto; text-decoration:none; color:var(--sub);
  font-size:14px; font-weight:600; padding:8px 16px; border-radius:20px;
  background:#fff; border:1px solid var(--line); white-space:nowrap;
}
nav.tabs a:hover{color:var(--accent); border-color:var(--accent);}
nav.tabs a.active{background:var(--accent); color:#fff; border-color:var(--accent);}

/* Weather widget (마쓰야마 실시간 날씨) */
.weather{
  margin-top:20px;
  background:linear-gradient(135deg,#2e8bc0 0%,#5ea9d6 55%,#ff8c42 130%);
  color:#fff; border-radius:16px; padding:18px 20px;
  box-shadow:0 6px 18px rgba(46,139,192,.25);
}
.weather .wx-top{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.weather .wx-left{display:flex; align-items:center; gap:14px; min-width:0;}
.weather .wx-icon{font-size:46px; line-height:1;}
.weather .wx-temp{font-size:38px; font-weight:800; letter-spacing:-1px;}
.weather .wx-meta{min-width:0;}
.weather .wx-place{font-size:13px; opacity:.9; font-weight:600;}
.weather .wx-cond{font-size:15px; font-weight:700; margin-top:2px;}
.weather .wx-stats{
  display:flex; flex-wrap:wrap; gap:8px 18px; margin-top:14px;
  padding-top:12px; border-top:1px solid rgba(255,255,255,.25);
  font-size:13px;
}
.weather .wx-stats b{font-weight:700;}
.weather .wx-stats span{opacity:.85;}
.weather .wx-week{
  display:flex; gap:7px; margin-top:14px; padding-top:14px;
  border-top:1px solid rgba(255,255,255,.25);
  overflow-x:auto; -webkit-overflow-scrolling:touch;
}
.weather .wx-day{
  flex:0 0 auto; min-width:60px; text-align:center;
  background:rgba(255,255,255,.14); border-radius:11px; padding:9px 6px;
}
.weather .wx-day.wknd .wd-name{color:#ffe0c2;}
.weather .wx-day .wd-name{font-size:12.5px; font-weight:700;}
.weather .wx-day .wd-date{font-size:10.5px; opacity:.75; margin-top:1px;}
.weather .wx-day .wd-icon{font-size:23px; margin:5px 0 3px;}
.weather .wx-day .wd-pop{font-size:10.5px; opacity:.85; min-height:14px;}
.weather .wx-day .wd-temp{font-size:12px; margin-top:3px;}
.weather .wx-day .wd-temp b{font-weight:800;}
.weather .wx-day .wd-temp span{opacity:.7; margin-left:3px;}

.weather .wx-foot{
  margin-top:10px; font-size:11px; opacity:.7; text-align:right;
}
.weather.wx-error{
  background:#fff; color:var(--sub); border:1px solid var(--line);
  box-shadow:none; font-size:13.5px;
}

section{margin-top:34px;}
.sec-head{display:flex; align-items:center; gap:10px; margin-bottom:14px;}
.sec-badge{
  background:var(--accent); color:#fff; font-weight:700; font-size:12px;
  padding:4px 11px; border-radius:8px; letter-spacing:.5px;
}
.sec-badge.blue{background:var(--accent2);}
.sec-badge.red{background:#e03131;}
.sec-head h2{font-size:20px;}
.sec-note{font-size:13px; color:var(--sub); margin:-6px 0 14px;}

/* Cards */
.grid{display:grid; gap:12px;}
.card{
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:13px 15px;
}
.card .name{font-weight:700; font-size:15px;}
.card .desc{font-size:13.5px; color:var(--sub); margin-top:3px;}
.card a.maplink{
  display:inline-block; margin-top:9px; font-size:13px; color:var(--accent2);
  text-decoration:none; font-weight:600;
}
.card a.maplink + a.maplink{margin-left:14px;}
/* 클릭 툴팁 카드 */
.card.has-tip{cursor:pointer; position:relative; transition:border-color .15s, box-shadow .15s;}
.card.has-tip:hover{border-color:var(--accent); box-shadow:0 2px 10px rgba(255,140,66,.12);}
.card.has-tip.open{border-color:var(--accent); box-shadow:0 2px 10px rgba(255,140,66,.18);}
.tip-hint{
  font-size:11px; font-weight:700; color:var(--accent); background:#fff2e8;
  padding:1px 7px; border-radius:20px; margin-left:4px; vertical-align:middle;
}
.tooltip{
  display:none; margin-top:11px; padding:13px 14px;
  background:#fffaf5; border:1px solid #ffd9bf; border-radius:10px;
  font-size:13px; color:var(--ink); line-height:1.55;
  animation:tipIn .16s ease;
}
.card.has-tip.open .tooltip{display:block;}
@keyframes tipIn{from{opacity:0; transform:translateY(-4px);} to{opacity:1; transform:translateY(0);}}
.tip-title{font-weight:700; font-size:14px; margin-bottom:8px; color:#e8590c;}
.tip-sec{font-weight:700; font-size:12.5px; margin:11px 0 6px; color:var(--accent2);}
.tip-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px;}
.tip-list li{padding-left:2px;}
.tip-sub{color:var(--sub); font-size:12px; font-weight:400;}
.tip-note{
  margin-top:11px; padding:8px 10px; font-size:12px; line-height:1.5;
  background:#fff0e6; border-radius:8px; color:#c2410c;
}

.tag{
  display:inline-block; font-size:11px; padding:2px 8px; border-radius:6px;
  background:#fff2e8; color:var(--accent); margin-right:6px; font-weight:600;
  vertical-align:middle;
}
.tag.want{background:#ffe3e3; color:#e8590c;}
.tag.time{background:#e7f5ff; color:var(--accent2);}
.tag.rest{background:#e6f7ee; color:#1e8a4c;}

/* SOS / 긴급 연락처 */
.sos-card{
  background:#fff5f5; border:1px solid #ffc9c9; border-radius:12px;
  padding:13px 15px; border-left:4px solid #e03131;
}
.sos-name{font-weight:700; font-size:15px; color:#c92a2a;}
.sos-name .sos-sub{
  display:block; font-weight:500; font-size:12px; color:var(--sub); margin-top:2px;
}
.sos-tel{
  display:block; margin-top:9px; text-decoration:none; color:var(--ink);
  font-size:13.5px; padding:7px 11px; background:#fff; border:1px solid #ffd8d8;
  border-radius:8px;
}
.sos-tel b{color:#c92a2a; font-weight:700;}
.sos-tel.big{text-align:center; padding:11px;}
.sos-tel.big b{font-size:24px; letter-spacing:1px;}
.sos-tel:hover{background:#fff0f0; border-color:#ffb3b3;}

/* Checklist */
.check-group{margin-bottom:18px;}
.check-group h3{font-size:15px; margin-bottom:8px;}
.check-item{
  display:flex; align-items:center; gap:10px; background:var(--card);
  border:1px solid var(--line); border-radius:10px; padding:11px 14px;
  margin-bottom:8px; cursor:pointer; user-select:none; transition:.15s;
}
.check-item input{width:18px; height:18px; accent-color:var(--accent); cursor:pointer;}
.check-item label{flex:1; cursor:pointer; font-size:15px;}
.check-item.done{opacity:.5;}
.check-item.done label{text-decoration:line-through;}
.check-item .del{
  background:none; border:0; color:#b0b8c1; font-size:13px;
  cursor:pointer; padding:4px 6px;
}
.check-item .del:hover{color:#d9480f;}

.sync-status{
  display:inline-block; font-size:11.5px; padding:2px 9px; border-radius:10px;
  margin-left:8px; font-weight:600;
}
.sync-status.ok{background:#e6fcf5; color:#0ca678;}
.sync-status.busy{background:#fff2e8; color:var(--accent);}
.sync-status.err{background:#fff0f0; color:#d9480f;}

.add-item{display:flex; gap:8px; margin-top:14px; flex-wrap:wrap;}
.add-item select, .add-item input{
  border:1px solid var(--line); border-radius:10px; padding:9px 12px;
  font:inherit; background:#fff;
}
.add-item input{flex:1; min-width:140px;}
.add-item button{
  background:var(--accent); color:#fff; border:0; border-radius:10px;
  padding:9px 16px; font-weight:700; cursor:pointer; font:inherit;
}

.empty{color:var(--sub); font-size:14px; padding:12px 0;}

/* Day timeline (PLAN 섹션의 하위 단계) */
.day-block{margin-bottom:22px; padding-left:12px; border-left:3px solid #ffe1cc;}
.day-title{
  display:flex; align-items:center; gap:8px; margin-bottom:10px;
}
.day-title .dnum{
  background:#fff2e8; color:var(--accent); font-weight:700; font-size:11px;
  padding:2px 9px; border-radius:6px; border:1px solid #ffd8bd; letter-spacing:.3px;
}
.day-title h3{font-size:17px;}
.day-title .ddate{color:var(--sub); font-size:12.5px; margin-left:auto;}
.timeline{border-left:2px dashed var(--line); margin-left:8px; padding-left:22px;}
.tl-item{position:relative; margin-bottom:14px;}
.tl-item::before{
  content:''; position:absolute; left:-30px; top:7px;
  width:11px; height:11px; border-radius:50%;
  background:var(--accent2); border:2px solid #fff; box-shadow:0 0 0 2px var(--accent2);
}
.tl-item .time{font-size:12.5px; font-weight:700; color:var(--accent2);}

/* Photo placeholder */
.photos{display:grid; grid-template-columns:repeat(3,1fr); gap:8px;}
.photos .ph{
  aspect-ratio:1; background:#eef1f5; border:1px dashed var(--line);
  border-radius:10px; display:flex; align-items:center; justify-content:center;
  color:#b6c0cc; font-size:24px;
}

footer{text-align:center; color:var(--sub); font-size:13px; margin-top:48px;}

/* Sub tabs (페이지 내 지역 필터) */
nav.sub-tabs{
  position:sticky; z-index:9; background:rgba(245,247,250,.94);
  backdrop-filter:blur(8px); border-bottom:1px solid var(--line);
  display:flex; gap:6px; overflow-x:auto; padding:8px 16px; justify-content:safe center;
  -webkit-overflow-scrolling:touch;
}
nav.sub-tabs button{
  flex:0 0 auto; font:inherit; font-size:13px; font-weight:600; color:var(--sub);
  background:#fff; border:1px solid var(--line); border-radius:16px; padding:5px 12px;
  cursor:pointer; white-space:nowrap; display:inline-flex; align-items:center; gap:5px;
}
nav.sub-tabs button:hover{color:var(--accent2); border-color:var(--accent2);}
nav.sub-tabs button.active{background:var(--accent2); color:#fff; border-color:var(--accent2);}
nav.sub-tabs button:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
nav.sub-tabs .cnt{
  font-size:11px; padding:0 6px; border-radius:9px; background:#f1f3f5; color:var(--sub);
}
nav.sub-tabs button.active .cnt{background:rgba(255,255,255,.28); color:#fff;}
[hidden]{display:none!important;}
