:root {
  --berry: #d6336c;
  --berry-dark: #a61e4d;
  --berry-soft: #ffe0ec;
  --leaf: #2f9e44;
  --leaf-soft: #d3f9d8;
  --warn: #e67700;
  --warn-soft: #fff4e0;
  --ink: #212529;
  --ink-soft: #495057;
  --line: #dee2e6;
  --bg: #fafaf8;
  --card: #ffffff;
  --chip: #f1f3f5;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.08);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic UI","Meiryo",sans-serif;
  color:var(--ink);background:var(--bg);line-height:1.6;font-size:15px;
}
.app-header{
  background:linear-gradient(135deg,var(--berry) 0%,var(--berry-dark) 100%);
  color:white;padding:14px 20px 10px;position:sticky;top:0;z-index:10;
  box-shadow:var(--shadow);
}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:980px;margin:0 auto;flex-wrap:wrap}
.title-block{display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}
.app-title{margin:0;font-size:20px;font-weight:700}
.scope-badges{display:flex;gap:6px;flex-wrap:wrap}
.scope-badge{font-size:11px;padding:3px 10px;background:rgba(255,255,255,0.22);color:white;border-radius:4px;font-weight:500;text-decoration:none}
.scope-badge.current-tab{background:white;color:var(--berry-dark);font-weight:700}
.nav-link:hover{background:rgba(255,255,255,0.45)}
.house-picker label{display:flex;flex-direction:column;color:white;font-size:11px;gap:2px}
.house-picker select{padding:6px 10px;border:0;border-radius:6px;font-size:14px;font-weight:700;color:var(--berry-dark);background:white;min-width:120px}
.main{max-width:980px;margin:0 auto;padding:16px 16px 40px}
.panel{background:var(--card);border-radius:12px;padding:18px 20px;margin-bottom:16px;box-shadow:var(--shadow)}
.panel-title{margin:0 0 14px;font-size:16px;font-weight:700;color:var(--ink);border-left:4px solid var(--berry);padding-left:10px}

.cal-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.sync-status{font-size:11px;color:var(--ink-soft);background:var(--chip);padding:3px 8px;border-radius:3px}

/* Timeline */
.timeline{display:flex;flex-direction:column;border-left:3px solid var(--berry-soft);margin-left:6px}
.cal-day{
  display:grid;grid-template-columns:60px 100px 1fr;gap:10px;
  padding:12px 14px 12px 20px;border-bottom:1px solid var(--line);background:white;position:relative;
}
.cal-day.is-past{background:#fafafa}
.cal-day.is-today{background:#fff4e0;border-left:4px solid var(--warn);padding-left:16px}
.cal-day.is-weekend-sun{color:#c92a2a}
.cal-day.is-weekend-sat{color:#1971c2}
.cal-day::before{content:"";position:absolute;left:-7px;top:20px;width:11px;height:11px;border-radius:50%;background:var(--line);border:2px solid white}
.cal-day.is-today::before{background:var(--warn)}
.cal-day.has-record::before{background:var(--berry)}
.cal-day.has-event::before{background:var(--leaf)}
.cal-date{font-size:19px;font-weight:700}
.cal-date .dow{display:block;font-size:11px;font-weight:600;color:var(--ink-soft);margin-top:2px}
.cal-day.is-weekend-sun .dow{color:#c92a2a}
.cal-day.is-weekend-sat .dow{color:#1971c2}
.cal-weather{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--ink-soft);border-right:1px dashed var(--line);padding-right:8px}
.cal-weather .ico{font-size:22px;line-height:1}
.cal-weather .temps{font-weight:700;color:var(--ink);font-size:13px}
.cal-weather .temps .tmax{color:#e03131}
.cal-weather .temps .tmin{color:#1971c2}
.cal-weather .pop{font-size:11px}
.cal-weather .pop-high{color:#1971c2;font-weight:700}
.cal-weather .rh{font-size:10px;color:var(--ink-soft)}
.cal-weather .rh-low{color:#c92a2a;font-weight:700}
.cal-entries{display:flex;flex-direction:column;gap:4px;min-width:0}
.cal-entry{font-size:13px;padding:5px 9px;border-radius:4px;background:var(--chip)}
.cal-entry.event{background:var(--leaf-soft);border-left:3px solid var(--leaf)}
.cal-entry.app{background:var(--berry-soft);border-left:3px solid var(--berry)}
.cal-entry .name{font-weight:700;color:var(--ink)}
.cal-entry .tag{display:inline-block;font-size:10px;padding:1px 5px;margin-left:4px;border-radius:3px;background:white;color:var(--ink-soft);font-weight:500}
.cal-entry .tag.irac{background:#e7f5ff;color:#1971c2}
.cal-entry .tag.frac{background:#fff3bf;color:#8a6d00}
.cal-entry .tag.house{background:#e3fafc;color:#0b7285}
.cal-entry .meta{font-size:11px;color:var(--ink-soft);margin-top:2px}

/* Priority panel */
.priority-panel{border-left:4px solid var(--warn);background:#fffbea}
.priority-card{background:white;border-radius:8px;padding:10px 12px;margin-bottom:6px;border-left:3px solid var(--warn)}
.priority-card:last-child{margin-bottom:0}
.priority-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.priority-title{font-size:14px;font-weight:700;color:var(--warn)}
.priority-range{font-size:11px;background:#ffe0b2;color:#8a4500;padding:2px 8px;border-radius:3px;font-weight:600}
.priority-body{font-size:13px;line-height:1.6;color:var(--ink)}

.biz-row{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:4px;align-items:center}
.biz-badge{font-size:10px;padding:1px 6px;border-radius:3px;font-weight:600;letter-spacing:.02em}
.biz-open{background:var(--leaf-soft);color:var(--leaf)}
.biz-closed{background:#f1f3f5;color:#868e96;text-decoration:line-through}
.biz-partial{background:#fff3bf;color:#8a6d00}
.biz-all-closed{font-size:11px;font-weight:700;background:#1971c2;color:white;padding:2px 9px;border-radius:4px;margin-left:auto;white-space:nowrap}
.cal-day.spray-ok{background:#e7f5ff}
.cal-day.spray-ok.is-today{background:linear-gradient(90deg,#fff4e0 0%,#e7f5ff 100%)}

.app-footer{text-align:center;padding:16px;color:#868e96;font-size:11px}

@media (max-width:600px){
  .app-title{font-size:17px}
  .cal-day{grid-template-columns:50px 80px 1fr;gap:8px;padding:10px 10px 10px 16px}
  .cal-date{font-size:16px}
  .cal-weather .ico{font-size:18px}
  .cal-weather .temps{font-size:12px}
}
