/* Tablet view: keep the week readable and every daily action directly available. */
#dashboard.alternate-view {
  --bg: #e8eef2; --panel: #fff; --panel-strong: #fff; --text: #142c3c;
  --muted: #526b7b; --line: #c5d2db; --accent: #245e7b;
  --accent-soft: #e1edf5; --event: #e9f1f8; --garbage: #e3eee7;
  --shadow: none; --focus-ring: 3px solid #bc7629;
  display: flex; flex-direction: column; height: 100dvh; min-height: 0;
  padding: 8px; gap: 6px; overflow: hidden; background: var(--bg); color: var(--text);
}
#dashboard.alternate-view .information-panel { display: contents; }
#dashboard.alternate-view .studio-only,
#dashboard.alternate-view .studio-week-heading,
#dashboard.alternate-view .day-events-more { display: none; }

/* One compact header. Keep labels on controls that otherwise look alike. */
#dashboard.alternate-view .topbar {
  order: 0; flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1fr) auto auto;
  align-items: center; min-height: 64px; padding: 6px 12px; gap: 10px;
  border: 0; border-radius: 10px; background: #173b52; color: #fff; box-shadow: none;
}
#dashboard.alternate-view .topbar::before,
#dashboard.alternate-view .topbar::after { display: none; }
#dashboard.alternate-view .clock-block { display: flex; align-items: center; gap: 16px; min-width: 0; }
#dashboard.alternate-view .clock { color: #fff; font-family: 'Segoe UI',system-ui,sans-serif; font-size: 48px; font-weight: 650; line-height: 1; letter-spacing: -.05em; }
#dashboard.alternate-view .clock-date-details { align-self: auto; transform: none; gap: 3px; }
#dashboard.alternate-view .date-line { color: #fff; font-size: 14px; font-weight: 600; }
#dashboard.alternate-view .sun-times { color: #c7d9e4; font-size: 10px; gap: 10px; }
#dashboard.alternate-view .header-todos { position: static; display: flex; flex-wrap: nowrap; gap: 6px; }
#dashboard.alternate-view .header-todos > button,
#dashboard.alternate-view .header-weather-group > button {
  display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-width: 44px;
  height: 44px; min-height: 44px; padding: 3px; border: 1px solid #819cab;
  border-radius: 7px; background: #f7fafc; color: #173b52; box-shadow: none;
}
#dashboard.alternate-view #cookingTodos { display: grid; grid-template-columns: 1fr; gap: 0; }
#dashboard.alternate-view #cookingTodos > span:first-child { font-size: 23px; }
#dashboard.alternate-view #cookingTodos > span:last-child { display: none; }
#dashboard.alternate-view .shopping-cart-icon { font-size: 24px; }
#dashboard.alternate-view .shopping-cart-count { border-color: #f7fafc; background: #245e7b; color: #fff; }
#dashboard.alternate-view .header-weather-group { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
#dashboard.alternate-view .header-weather-group .current-weather { order: -1; flex: 0 0 auto; display: flex; gap: 6px; min-width: 0; margin: 0 5px 0 0; padding: 0 12px 0 0; border: 0; border-right: 1px solid #648396; color: #fff; }
#dashboard.alternate-view .current-weather-icon { font-size: 32px; }
#dashboard.alternate-view .current-weather-temp { color: #fff; font-size: 28px; font-weight: 650; }
#dashboard.alternate-view .current-weather-label { color: #d5e3eb; font-size: 11px; }
#dashboard.alternate-view .header-weather-group > .layout-toggle { background: #f0c88c; border-color: #f0c88c; color: #173b52; }
#dashboard.alternate-view #bookingOpen { flex-basis: 66px; width: 66px; font-size: 14px; font-weight: 600; }
#dashboard.alternate-view #babyMonitorOpen { font-size: 24px; }
#dashboard.alternate-view .header-weather-group > :is(#trainOpen,#typhoonOpen,#earthquakeOpen) { background: #fff0d1; border-color: #e1b268; color: #63400e; }
#dashboard.alternate-view .header-weather-group > .earthquake-open-severe { background: #a92f36; border-color: #ec9d9f; color: #fff; }
#dashboard.alternate-view .header-weather-group > .baby-crying { background: #ffe0df; border-color: #d6494c; color: #8e262d; }
#dashboard.alternate-view .earthquake-open { align-content: center; gap: 0; }
#dashboard.alternate-view .earthquake-open-icon { font-size: 18px; }
#dashboard.alternate-view .earthquake-open-label { font-size: 9px; }
#dashboard.alternate-view .notice-row { order: 0; flex: 0 0 auto; padding: 5px 10px; border-radius: 6px; font-size: 12px; }

/* The calendar gets all remaining height; no title, captions or detail-button row. */
#dashboard.alternate-view .week-grid {
  order: 1; flex: 1 1 0; display: grid; grid-template-columns: repeat(7,minmax(0,1fr));
  grid-template-rows: minmax(0,1fr); min-height: 0; height: auto; gap: 0; padding: 0;
  border: 1px solid #bacbd7; border-radius: 10px; background: #fff; overflow: hidden;
}
#dashboard.alternate-view .day-card {
  position: relative; display: flex; flex-direction: column; align-items: stretch;
  height: 100%; min-height: 0; min-width: 0; padding: 6px; gap: 4px;
  border: 0; border-right: 1px solid #c8d5df; border-radius: 0;
  background: #fff; color: #142c3c; box-shadow: none; overflow: hidden;
}
#dashboard.alternate-view .day-card:last-child { border-right: 0; }
#dashboard.alternate-view .day-card.today { margin: 0; padding: 6px; border: 0; border-right: 1px solid #d9b875; border-radius: 0; background: #fff5df; box-shadow: inset 0 4px #bc7629; }
#dashboard.alternate-view .day-card.today::after { display: none; }
#dashboard.alternate-view .day-head { order: 0; display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; min-height: 34px; padding: 3px 0 5px; gap: 5px; border: 0; border-bottom: 1px solid #d4dfe6; background: transparent; }
#dashboard.alternate-view .day-date { color: #173b52; font-size: clamp(23px,2.25vw,34px); font-weight: 700; letter-spacing: -.04em; line-height: 1.1; white-space: nowrap; }
#dashboard.alternate-view .day-date::before { display: none; }
#dashboard.alternate-view .day-labels { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; gap: 2px; }
#dashboard.alternate-view .day-name { color: #314f63; font-size: 14px; font-weight: 700; }
#dashboard.alternate-view .holiday-name { min-height: 0; margin: 0; color: #a13437; font-size: 9px; line-height: 1.2; overflow-wrap: anywhere; }
#dashboard.alternate-view .day-card.sat :is(.day-name,.day-date) { color: #1f6598; }
#dashboard.alternate-view .day-card:is(.sun,.holiday) :is(.day-name,.day-date) { color: #a13437; }
#dashboard.alternate-view .day-card.today .day-name::after { content: ' 今日'; color: #945717; font-size: 11px; }
#dashboard.alternate-view .weather-block { order: 1; display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-start; min-height: 40px; padding: 0 0 4px; gap: 5px; border: 0; border-bottom: 1px solid #d4dfe6; border-radius: 0; }
#dashboard.alternate-view .weather-icon { font-size: clamp(25px,2.5vw,36px); }
#dashboard.alternate-view .weather-temps { font-size: 14px; font-weight: 700; }
#dashboard.alternate-view .weather-max { color: #a44230; }
#dashboard.alternate-view .weather-min { color: #225e92; }
#dashboard.alternate-view .weather-pop { margin-top: 1px; color: #425f73; font-size: 11px; }
#dashboard.alternate-view .day-details { display: contents; }
#dashboard.alternate-view .day-card .day-events { order: 2; display: flex; flex-direction: column; flex: 1 1 0; min-height: 60px; gap: 3px; grid-template-columns: none; grid-template-rows: none; }
#dashboard.alternate-view .day-events > .day-section-title { display: none; }
#dashboard.alternate-view .event-list { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; gap: 4px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #7291a7 #e8eff4; }
#dashboard.alternate-view .event-chip,
#dashboard.alternate-view .event-chip.studio-extra-event {
  display: block; flex: 0 0 auto; width: 100%; min-height: 38px; padding: 4px 5px;
  border: 1px solid #cedee9; border-left: 3px solid #39769b; border-radius: 5px;
  background: #e9f1f8; color: #153e59; text-align: left;
  font-size: clamp(14px,1.15vw,18px); font-weight: 600; line-height: 1.25;
}
#dashboard.alternate-view .event-chip-content { display: block; overflow: hidden; }
#dashboard.alternate-view .event-time { display: block; margin: 0 0 2px; color: #295b7b; font-size: 12px; font-weight: 650; }
#dashboard.alternate-view .event-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; font-weight: 600; }
#dashboard.alternate-view .event-chip.multi-day { background: #eeeaf7; color: #4f3d72; border-color: #c7b9de; }
#dashboard.alternate-view .event-chip.is-ongoing { background: #fff0b6; border-color: #b77a1f; box-shadow: inset 0 0 0 1px #b77a1f; }
#dashboard.alternate-view .calendar-todos { order: 3; display: grid; flex: 0 0 auto; gap: 3px; min-width: 0; }
#dashboard.alternate-view .calendar-todos > .day-section-title { display: none; }
#dashboard.alternate-view :is(.calendar-todo-chip,.calendar-todo-more) { min-height: 30px; padding: 4px 5px; border: 1px solid #d4c694; border-radius: 5px; background: #fff3c9; color: #59461a; font-size: 12px; line-height: 1.3; }
#dashboard.alternate-view .day-garbage { order: 4; display: block; flex: 0 0 auto; min-height: 0; margin: 0; }
#dashboard.alternate-view .day-garbage:not(:has(.garbage-chip)),
#dashboard.alternate-view .day-garbage > .day-section-title { display: none; }
#dashboard.alternate-view .garbage-list { display: flex; flex-direction: column; gap: 3px; overflow: visible; }
#dashboard.alternate-view .garbage-chip { padding: 4px 5px; border: 1px solid #c7dbce; border-radius: 5px; background: #e3eee7; color: #284f37; font-size: 12px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; overflow: visible; }
#dashboard.alternate-view .garbage-symbol { display: none; }
#dashboard.alternate-view .school-lunch-button { order: 5; display: block; flex: 0 0 auto; align-self: stretch; width: 100%; min-height: 32px; margin: 0; padding: 5px; border: 1px solid #d8be8a; border-radius: 5px; background: #fff1d4; color: #684917; box-shadow: none; font-size: 13px; font-weight: 650; }
#dashboard.alternate-view .empty-text { padding: 5px 2px; color: #526b7b; font-size: 13px; }

/* Direct task entry and a compact utility bar stay below the calendar. */
#dashboard.alternate-view .todo-panel { order: 2; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; margin: 0; padding: 4px 8px; border: 1px solid #c5d2db; border-radius: 7px; background: #fff; box-shadow: none; }
#dashboard.alternate-view .todo-open { min-height: 44px; padding: 0; border: 0; background: transparent; gap: 7px; }
#dashboard.alternate-view .todo-open #todoTitle { color: #173b52; font-size: 16px; font-weight: 700; }
#dashboard.alternate-view .todo-open #todoCount { padding: 4px 7px; background: #e1edf5; color: #245e7b; font-size: 12px; }
#dashboard.alternate-view .todo-open > span:last-child { display: none; }
#dashboard.alternate-view .todo-open:is(.todo-due,.todo-due-soon) { animation: none; background: transparent; }
#dashboard.alternate-view .todo-open.todo-due-soon #todoCount { background: #ffe2a4; color: #6b4608; }
#dashboard.alternate-view .todo-open.todo-due #todoCount { background: #ffd0c5; color: #842d26; }
#dashboard.alternate-view .todo-form { flex: 1; display: grid; grid-template-columns: minmax(120px,1fr) minmax(120px,1.4fr) 150px 76px; gap: 8px; margin: 0; }
#dashboard.alternate-view .todo-form :is(.todo-choice-field,.todo-note-field) { display: block; min-width: 0; font-size: 0; }
#dashboard.alternate-view .todo-form :is(input,select) { min-height: 42px; padding: 8px; border: 1px solid #b5c7d3; border-radius: 5px; background: #fff; color: #173b52; font-size: 14px; color-scheme: light; }
#dashboard.alternate-view .todo-form input::placeholder { color: #536e80; }
#dashboard.alternate-view .todo-date-field { width: 100%; }
#dashboard.alternate-view .todo-date-field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#dashboard.alternate-view .todo-form button[type='submit'] { min-height: 42px; min-width: 0; border: 1px solid #245e7b; border-radius: 5px; background: #245e7b; color: #fff; font-size: 14px; font-weight: 650; }
#dashboard.alternate-view .footer-row { order: 3; flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1.5fr) 264px; align-items: stretch; height: 44px; min-height: 44px; gap: 8px; margin: 0; }
#dashboard.alternate-view .footer-row .summary-card { display: flex; align-items: center; min-width: 0; min-height: 0; padding: 3px 8px; gap: 6px; border: 1px solid #c5d2db; border-radius: 7px; background: #fff; color: #173b52; box-shadow: none; }
#dashboard.alternate-view .summary-label { flex: 0 0 auto; margin: 0; color: #526b7b; font-size: 11px; font-weight: 600; }
#dashboard.alternate-view .summary-main { color: #173b52; font-size: 13px; font-weight: 600; line-height: 1.3; -webkit-line-clamp: 2; }
#dashboard.alternate-view .garbage-summary-row { display: flex; align-items: center; flex: 1; gap: 6px; flex-wrap: nowrap; min-width: 0; }
#dashboard.alternate-view .garbage-done-button { flex: 0 0 auto; min-height: 36px; padding: 4px 7px; border: 1px solid #367a53; border-radius: 5px; background: #367a53; color: #fff; font-size: 12px; }
#dashboard.alternate-view .footer-row .garbage-reminder-active { animation: none; border-color: #367a53; background: #e3eee7; }
#dashboard.alternate-view .next-event-card { gap: 5px; }
#dashboard.alternate-view .next-event-open { display: flex; align-items: center; flex: 1; min-width: 0; min-height: 36px; gap: 6px; }
#dashboard.alternate-view #nextEventSummary { display: flex; flex: 1; align-items: baseline; gap: 5px; min-width: 0; }
#dashboard.alternate-view .studio-next-when { flex: 0 0 auto; color: #245e7b; font-size: 12px; font-weight: 650; }
#dashboard.alternate-view .studio-next-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#dashboard.alternate-view .transit-open { flex: 0 0 auto; min-height: 36px; padding: 4px 6px; border-radius: 5px; font-size: 11px; }
#dashboard.alternate-view .energy-radio-group { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); height: 44px; min-width: 0; gap: 5px; }
#dashboard.alternate-view .energy-radio-group > .energy-card,
#dashboard.alternate-view .footer-row :is(.tablet-radio-toggle,.tbs-news-open) { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 44px; min-height: 44px; padding: 2px; gap: 1px; border: 1px solid #b8cad6; border-radius: 7px; background: #fff; color: #245e7b; font-size: 11px; font-weight: 600; }
#dashboard.alternate-view .energy-radio-group > .energy-card > :is(.summary-label,.energy-card-main,.energy-card-breakdown) { display: none; }
#dashboard.alternate-view .energy-radio-group .energy-shortcut { position: static; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; line-height: 1.1; color: inherit; }
#dashboard.alternate-view :is(.energy-shortcut-icon,.tbs-news-open svg) { width: 21px; height: 21px; }
#dashboard.alternate-view .tablet-radio-control { position: relative; display: flex; min-width: 0; }
#dashboard.alternate-view .tablet-radio-toggle .radio-icon { width: 22px; height: 22px; }
#dashboard.alternate-view .radio-station { font-size: 10px; opacity: 1; }
#dashboard.alternate-view .footer-row .tablet-radio-toggle[aria-pressed='true'] { background: #245e7b; border-color: #245e7b; color: #fff; }
#dashboard.alternate-view .radio-stations:not([hidden]),
#dashboard.alternate-view .tablet-radio-status:not([hidden]) { top: auto; bottom: calc(100% + 6px); }
#dashboard.alternate-view :is(button,[role='button'],input,select):focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
@media (max-width: 1150px) {
  #dashboard.alternate-view .topbar:has(:is(#earthquakeOpen,#trainOpen,#typhoonOpen):not([hidden])) .clock { font-size: 42px; }
  #dashboard.alternate-view .topbar:has(:is(#earthquakeOpen,#trainOpen,#typhoonOpen):not([hidden])) .clock-block { gap: 9px; }
  #dashboard.alternate-view .topbar:has(:is(#earthquakeOpen,#trainOpen,#typhoonOpen):not([hidden])) .date-line { font-size: 12px; }
}
@media (min-height: 800px) {
  #dashboard.alternate-view .event-chip { padding: 6px; font-size: clamp(15px,1.2vw,19px); }
  #dashboard.alternate-view .weather-block { min-height: 46px; }
}
@media (hover: hover) {
  #dashboard.alternate-view :is(.event-chip,.calendar-todo-chip,.school-lunch-button):hover { filter: brightness(.96); }
}
