:root {
  --bg: #f4efe7;
  --panel: #fffdf9;
  --panel-strong: #ffffff;
  --text: #2f2c28;
  --muted: #777066;
  --line: #ded6ca;
  --accent: #876d57;
  --accent-soft: #eee4d8;
  --today: #f7e8cb;
  --event: #ece9ff;
  --garbage: #e4f1e5;
  --warning: #fff0d6;
  --error: #fde7e7;
  --shadow: 0 12px 36px rgb(71 57 43 / 0.08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100svh;
  overflow-x: hidden;
}

button, input { font: inherit; }

a { color: inherit; }

[hidden] {
  display: none !important;
}

.dashboard {
  width: 100%;
  min-height: 100svh;
  padding: clamp(10px, 1.2vw, 18px);
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 8px;
  align-content: start;
}

.topbar {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1fr;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(14px, 1.8vw, 22px) clamp(16px, 2vw, 28px);
  box-shadow: var(--shadow);
}

.clock {
  font-size: clamp(38px, 5.6vw, 74px);
  font-weight: 720;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.date-line {
  margin-top: 7px;
  color: var(--muted);
  font-size: clamp(13px, 1.45vw, 19px);
}

.title-block { text-align: center; }

.title-block h1 {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 32px);
  letter-spacing: 0.04em;
}

.update-line {
  color: var(--muted);
  margin-top: 7px;
  font-size: clamp(12px, 1.2vw, 15px);
}

.current-weather {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 155px;
}

.current-weather-icon { font-size: clamp(40px, 5vw, 64px); }
.current-weather-temp { font-size: clamp(27px, 3.3vw, 44px); font-weight: 700; line-height: 1; }
.current-weather-label { color: var(--muted); margin-top: 5px; font-size: clamp(12px, 1.2vw, 15px); }

.notice-row {
  min-height: 0;
  padding: 6px 12px;
  border-radius: 15px;
  background: var(--warning);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.notice-action {
  flex: 0 0 auto;
  text-decoration: none;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 650;
}

.week-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(7px, 0.8vw, 12px);
}

.day-card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(10px, 1.1vw, 16px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-card.today {
  background: linear-gradient(180deg, var(--today), var(--panel) 34%);
  border-color: #d9bb85;
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.day-name { font-size: clamp(13px, 1.35vw, 18px); font-weight: 700; }
.day-date { font-size: clamp(20px, 2.35vw, 31px); font-weight: 750; font-variant-numeric: tabular-nums; }
.day-card.sat .day-name { color: #426a9b; }
.day-card.sun .day-name { color: #a95757; }

.weather-block {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.weather-icon { font-size: clamp(30px, 3.5vw, 46px); }
.weather-temps { font-weight: 700; font-size: clamp(14px, 1.4vw, 18px); white-space: nowrap; }
.weather-min { color: #54729b; }
.weather-max { color: #a45252; }
.weather-pop { color: var(--muted); font-size: clamp(11px, 1.1vw, 14px); margin-top: 4px; }

.day-section-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-list, .garbage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-chip, .garbage-chip {
  border-radius: 10px;
  padding: 7px 8px;
  font-size: clamp(11px, 1.12vw, 14px);
  line-height: 1.35;
  overflow: hidden;
}

.event-chip { background: var(--event); }
.garbage-chip { background: var(--garbage); }
.event-time { font-weight: 800; margin-right: 5px; font-variant-numeric: tabular-nums; }
.event-title { overflow-wrap: anywhere; }
.empty-text { color: #aaa299; font-size: 12px; padding: 4px 1px; }

.footer-row {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1fr;
  gap: clamp(8px, 1vw, 14px);
  align-items: start;
  align-self: start;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 14px;
  min-height: 60px;
  box-shadow: var(--shadow);
}

.summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}

.summary-main {
  font-weight: 700;
  font-size: clamp(14px, 1.45vw, 19px);
  overflow-wrap: anywhere;
}

.status-list { display: flex; gap: 7px; flex-wrap: wrap; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--accent-soft);
  font-size: 11px;
}
.status-pill.ok::before { content: "●"; color: #5b8f65; }
.status-pill.warn::before { content: "●"; color: #c79b44; }
.status-pill.error::before { content: "●"; color: #b85b5b; }

.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgb(244 239 231 / 0.94);
  backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.lock-overlay[hidden] { display: none; }

.lock-card {
  width: min(460px, 100%);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 80px rgb(52 42 34 / 0.16);
}

.lock-icon { font-size: 46px; }
.lock-card h2 { margin: 8px 0; }
.lock-card p { color: var(--muted); line-height: 1.6; }
.lock-card label { display: block; font-size: 13px; font-weight: 700; margin: 18px 0 7px; }
.lock-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fff;
}
.lock-card button {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.form-error { color: #b04949; min-height: 1.4em; margin-top: 10px; font-size: 13px; }

@media (max-width: 900px) {
  .dashboard { padding: 10px; }
  .topbar { grid-template-columns: 1fr auto; }
  .title-block { display: none; }
  .week-grid { overflow-x: auto; grid-template-columns: repeat(7, minmax(145px, 1fr)); padding-bottom: 3px; }
  .footer-row { grid-template-columns: 1fr 1fr; }
  .status-card { grid-column: 1 / -1; }
}

@media (orientation: portrait) and (max-width: 800px) {
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .footer-row { grid-template-columns: 1fr; }
  .status-card { grid-column: auto; }
}

/* === TABLET_LAYOUT_FILL_START === */
/*
 * Tablet layout fill patch
 * - ヘッダーと下部サマリーは必要最小限
 * - 余った縦スペースは7日間カードに割り当てる
 * - notice-row が hidden のときでもレイアウトがずれないよう Grid ではなく Flex で縦配分
 */
.dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  gap: 8px;
}

.topbar,
.footer-row,
.notice-row:not([hidden]) {
  flex: 0 0 auto;
}

.week-grid {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.day-card {
  height: 100%;
}

.footer-row {
  width: 100%;
  align-items: stretch;
}

.summary-card {
  min-height: 58px;
  padding: 9px 13px;
}
/* === TABLET_LAYOUT_FILL_END === */
