/* Share the existing elements and their listeners in both layouts. */
.information-panel { display: contents; }
.dashboard > .week-grid { order: 1; }
.information-panel > .todo-panel { order: 2; }
.information-panel > .footer-row { order: 3; }
/* An icon in the existing shortcut row; no additional header track. */
.layout-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--header-control-radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.layout-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.layout-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.layout-toggle:focus-visible { outline: var(--focus-ring); }
@media (orientation: portrait) and (max-width: 560px) {
  .layout-toggle { flex-basis: 34px; width: 34px; height: 34px; min-height: 34px; padding: 6px; border-radius: 9px; }
  .layout-toggle svg { width: 20px; height: 20px; }
}

/* Alternate layout only. Hidden presentation elements never affect the standard view. */
.studio-only { display: none; }
.event-chip.studio-extra-event { display: none; }
.studio-icon { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 1024px) and (min-height: 600px) and (orientation: landscape), (max-width: 560px) and (orientation: portrait) {
  .dashboard:is(.two-column, .phone-studio) {
    --text: #e9eee4; --muted: #a2b4a7; --panel: #19382f; --panel-strong: #244338;
    --line: #3e5949; --accent: #cfe3a2; --accent-soft: #344d37; --warning: #493c25;
    --shadow: none; --focus-ring: 3px solid #cfe3a2;
    display: grid; grid-template-columns: minmax(310px, 31%) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh; min-height: 0; gap: 0 clamp(18px, 2.1vw, 40px); padding: clamp(14px, 2.2vh, 28px);
    overflow: hidden; color: var(--text);
    background: radial-gradient(ellipse at 0% 0%, #304c3c, transparent 65%), #13291f;
  }
  :is(.two-column, .phone-studio) .studio-only { display: block; }
  :is(.two-column, .phone-studio) .studio-icon { display: inline-block; }
  :is(.two-column, .phone-studio) .information-panel {
    grid-row: 1 / 3; display: flex; flex-direction: column; gap: clamp(12px, 1.7vh, 20px);
    min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #60785c transparent;
  }
  :is(.two-column, .phone-studio) .topbar {
    position: relative; flex: 0 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: 44px auto 44px; align-content: space-between; min-height: 29vh;
    gap: 15px 8px; padding: clamp(14px,1.6vw,24px); border: 0; border-radius: 0;
    background: transparent; box-shadow: none;
    isolation: isolate;
  }
  :is(.two-column, .phone-studio) .topbar::before { content: 'HOME / 毎日のこと'; grid-row: 1; grid-column: 1 / 5; align-self: center; color: #b8cba0; font-size: 10px; font-weight: 500; letter-spacing: .16em; }
  :is(.two-column, .phone-studio) .topbar::after { content: ''; position: absolute; pointer-events: none; left: 24px; right: 24px; bottom: 0; height: 1px; background: linear-gradient(90deg,#b7c99855,transparent); }
  :is(.two-column, .phone-studio) .clock-block { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
  :is(.two-column, .phone-studio) .clock { color: #f4f3df; font-family: 'Segoe UI', system-ui, sans-serif; font-size: clamp(70px, 7vw, 132px); font-weight: 300; letter-spacing: -.065em; line-height: .95; }
  :is(.two-column, .phone-studio) .clock-date-details { align-self: flex-start; transform: none; gap: 8px; }
  :is(.two-column, .phone-studio) .date-line { color: #e0e7d5; font-size: clamp(14px, 1.3vw, 21px); letter-spacing: .02em; }
  :is(.two-column, .phone-studio) .sun-times { gap: 14px; font-size: clamp(10px, .85vw, 13px); color: #9cb39e; }
  :is(.two-column, .phone-studio) .sun-times > span:first-child::before { content: '↗'; margin-right: 5px; color: #cedbb2; }
  :is(.two-column, .phone-studio) .sun-times > span:last-child::before { content: '↘'; margin-right: 5px; color: #cedbb2; }
  :is(.two-column, .phone-studio) .header-todos { grid-column: 5 / -1; grid-row: 1; justify-self: end; flex-wrap: nowrap; gap: 7px; }
  :is(.two-column, .phone-studio) .header-todos button { display: grid; place-items: center; min-width: 44px; width: 44px; min-height: 44px; height: 44px; padding: 0; border: 1px solid #627453; border-radius: 50%; background: #304936; color: #dfebc9; }
  :is(.two-column, .phone-studio) #cookingTodos > span:last-child { display: none; }
  :is(.two-column, .phone-studio) #cookingTodos > span:first-child { display: grid; font-size: 0; }
  :is(.two-column, .phone-studio) .header-todos .shopping-cart-icon { display: grid; font-size: 0; }
  :is(.two-column, .phone-studio) .header-todos .shopping-cart-count { top: -3px; right: -3px; min-width: 18px; height: 18px; border-color: #254232; background: #d5dda9; color: #263f2c; font-size: 10px; }
  :is(.two-column, .phone-studio) .header-weather-group { display: contents; }
  :is(.two-column, .phone-studio) .header-weather-group > button { grid-row: 3; display: grid; place-items: center; width: 100%; min-width: 0; height: 44px; min-height: 44px; padding: 0; border: 1px solid #6b7f5759; border-radius: 12px; color: #c8d7bd; background: #ffffff04; }
  :is(.two-column, .phone-studio) .topbar:not(:has(#trainOpen:not([hidden]), #typhoonOpen:not([hidden]))) .header-weather-group > button { grid-column: span 2; }
  :is(.two-column, .phone-studio) .layout-toggle[aria-pressed='true'] { background: #cfe3a2; color: #243b29; border-color: #cfe3a2; }
  :is(.two-column, .phone-studio) #bookingOpen { display: flex; justify-content: center; gap: 5px; padding: 0 5px; font-size: 0; background: #ffffff05; border-color: #48634f; color: #c8d7bd; }
  :is(.two-column, .phone-studio) #bookingOpen::after { content: '予約'; font-size: 11px; }
  :is(.two-column, .phone-studio) #bookingOpen .studio-icon { width: 18px; }
  :is(.two-column, .phone-studio) #babyMonitorOpen > span:first-of-type,
  :is(.two-column, .phone-studio) :is(.train-count-icon, .typhoon-count-icon) { display: grid; font-size: 0; }
  :is(.two-column, .phone-studio) .baby-monitor-dot { right: 6px; bottom: 4px; }
  :is(.two-column, .phone-studio) .baby-monitor-icon.baby-crying { background: #79362e; border-color: #f2a492; }
  :is(.two-column, .phone-studio) .current-weather { grid-column: 5 / -1; grid-row: 2; justify-self: end; align-self: start; display: grid; grid-template-columns: auto auto; margin: 8px 0 0; min-width: 0; max-width: 100%; gap: 4px; padding: 0; border: 0; }
  :is(.two-column, .phone-studio) .current-weather-icon { grid-column: 1; grid-row: 1; font-size: clamp(26px,2.5vw,40px); line-height: 1; }
  :is(.two-column, .phone-studio) .current-weather > div:last-child { display: contents; }
  :is(.two-column, .phone-studio) .current-weather-temp { grid-column: 2; grid-row: 1; font-size: clamp(26px,2.5vw,40px); font-weight: 400; letter-spacing: -.04em; }
  :is(.two-column, .phone-studio) .current-weather-label { grid-column: 1 / -1; grid-row: 2; margin: 0; color: #a4b89b; font-size: clamp(10px,.85vw,13px); text-align: right; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  :is(.two-column, .phone-studio) .forecast-icon[data-weather-combined='false'] { color: #bf9447; }
  :is(.two-column, .phone-studio) .forecast-icon[data-weather-combined='false'] > path:first-of-type { fill: transparent; }
  :is(.two-column, .phone-studio) .forecast-icon[data-weather-combined='false'] :is([fill='white'], [fill='white'][stroke='white']) { fill: currentColor; }
  :is(.two-column, .phone-studio) .forecast-icon[data-weather-combined='false'] [stroke='white'] { stroke: currentColor; }
  :is(.two-column, .phone-studio) .forecast-icon[data-weather-type='cloud'] { color: #80938a; }
  :is(.two-column, .phone-studio) .forecast-icon[data-weather-type='rain'] { color: #658d9d; }
  :is(.two-column, .phone-studio) .current-weather .forecast-icon { color: #e1c977; }
  :is(.two-column, .phone-studio) .current-weather .forecast-icon[data-weather-type='cloud'] { color: #bbd0bf; }
  :is(.two-column, .phone-studio) .current-weather .forecast-icon[data-weather-type='rain'] { color: #a6cad3; }

  :is(.two-column, .phone-studio) .todo-panel { flex: 0 0 auto; display: block; padding: clamp(12px, 1.6vw, 24px); border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  :is(.two-column, .phone-studio) .todo-panel .todo-open { min-height: 44px; padding: 0; border: 0; background: transparent; gap: 9px; }
  :is(.two-column, .phone-studio) .todo-open #todoTitle { font-size: clamp(18px, 1.5vw, 24px); font-weight: 500; letter-spacing: .01em; }
  :is(.two-column, .phone-studio) .todo-open #todoCount { padding: 4px 8px; color: #d2dfbf; background: #3d5138; font-size: 11px; }
  :is(.two-column, .phone-studio) .todo-open > span:last-child { margin-left: auto; color: #a5b89d; font-size: 11px; }
  :is(.two-column, .phone-studio) .todo-panel .todo-open:is(.todo-due,.todo-due-soon) { animation: none; background: transparent; }
  :is(.two-column, .phone-studio) .todo-open.todo-due-soon #todoCount { background: #e4d5a3; color: #514120; }
  :is(.two-column, .phone-studio) .todo-open.todo-due #todoCount { background: #e5afa1; color: #642f2a; }
  :is(.two-column, .phone-studio) .todo-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 12px; }
  :is(.two-column, .phone-studio) .todo-form :is(.todo-choice-field,.todo-note-field) { grid-column: auto; font-size: 0; gap: 0; }
  :is(.two-column, .phone-studio) .todo-form :is(select,input) { min-height: clamp(44px,4.9vh,54px); padding: 8px 10px; border: 1px solid #52654c; border-radius: 10px; background: #ffffff06; color: #e5ebdb; font-size: clamp(12px,1vw,15px); color-scheme: dark; }
  :is(.two-column, .phone-studio) .todo-form input::placeholder { color: #a3b49c; }
  :is(.two-column, .phone-studio) .todo-form button[type='submit'] { justify-self: stretch; min-height: clamp(44px,4.9vh,54px); border: 1px solid #cfe3a2; border-radius: 10px; background: #d4e7a5; color: #243b29; font-size: 14px; font-weight: 650; }
  :is(.two-column, .phone-studio) .todo-form button[type='submit']::before { content: '+'; margin-right: 8px; font-size: 19px; font-weight: 400; }
  :is(.two-column, .phone-studio) .todo-form .todo-date-field { width: 100%; }
  :is(.two-column, .phone-studio) .todo-date-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  :is(.two-column, .phone-studio) .footer-row { flex: 1 1 180px; min-height: 180px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(82px,1fr) minmax(86px,.65fr); align-self: stretch; align-items: stretch; gap: 10px; margin: 0; }
  :is(.two-column, .phone-studio) .summary-card { min-width: 0; }
  :is(.two-column, .phone-studio) .footer-row .summary-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(12px,1.5vw,24px); border: 0; border-top: 1px solid #a8bb8840; border-radius: 0; background: transparent; }
  :is(.two-column, .phone-studio) .summary-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: #aabfa0; font-size: clamp(11px,.95vw,14px); font-weight: 450; letter-spacing: .03em; }
  :is(.two-column, .phone-studio) .summary-label .studio-icon { order: -1; width: 18px; height: 18px; }
  :is(.two-column, .phone-studio) .footer-row > .summary-card:nth-child(2) { border-left: 1px solid #a8bb8826; }
  :is(.two-column, .phone-studio) .studio-next-when { display: block; margin-bottom: 5px; color: #c9d8a8; font-size: clamp(15px,1.45vw,23px); font-weight: 350; letter-spacing: -.02em; }
  :is(.two-column, .phone-studio) #nextEventSummary { display: block; }
  :is(.two-column, .phone-studio) .studio-next-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 400; }
  :is(.two-column, .phone-studio) .summary-main { color: #e4ebd9; font-size: clamp(13px,1.2vw,19px); font-weight: 500; line-height: 1.55; -webkit-line-clamp: 3; }
  :is(.two-column, .phone-studio) .garbage-summary-row { flex-wrap: wrap; gap: 6px; }
  :is(.two-column, .phone-studio) .garbage-done-button { min-height: 44px; background: #cfe3a2; color: #243b29; border-color: #cfe3a2; }
  :is(.two-column, .phone-studio) .footer-row:has(.garbage-done-button:not([hidden])) { min-height: 246px; grid-template-rows: minmax(150px,1fr) minmax(86px,.85fr); }
  :is(.two-column, .phone-studio) .footer-row .energy-card { position: relative; grid-column: 1 / -1; justify-content: center; padding-right: 44px; border: 1px solid #c4d0a6; border-radius: 18px; overflow: hidden; background: radial-gradient(ellipse at 100% 0%,#f0ebc5,transparent 70%),#cbd8ae; color: #2a412d; box-shadow: inset 0 1px #ffffff50; }
  :is(.two-column, .phone-studio) .energy-card::before { content: ''; position: absolute; pointer-events: none; width: 150px; height: 150px; right: -65px; bottom: -75px; border: 1px solid #71804d26; border-radius: 50%; box-shadow: 0 0 0 18px #71804d0b,0 0 0 36px #71804d07; }
  :is(.two-column, .phone-studio) .energy-card::after { content: '↗'; position: absolute; right: 18px; top: 16px; font-size: 25px; color: #506a40; }
  :is(.two-column, .phone-studio) .energy-card .summary-label { color: #526442; }
  :is(.two-column, .phone-studio) .energy-card-main { color: #243c29; font-size: clamp(22px,2.1vw,34px); font-weight: 450; letter-spacing: -.04em; }
  :is(.two-column, .phone-studio) .energy-card-breakdown { color: #5a6a4a; font-size: clamp(10px,.85vw,13px); line-height: 1.4; }
  :is(.two-column, .phone-studio) .footer-row .garbage-reminder-active { animation: none; border-color: #d1dfa7; background: #3c5034; }
  :is(.two-column, .phone-studio) .notice-row { flex-shrink: 0; padding: 8px 10px; font-size: 12px; color: #f1d9a7; border: 1px solid #79613d; border-radius: 10px; }

  /* The agenda and its heading form one continuous paper surface. */
  :is(.two-column, .phone-studio) .studio-week-heading { position: relative; isolation: isolate; overflow: hidden; grid-column: 2; grid-row: 1; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: clamp(22px,3.4vh,40px) clamp(22px,2.8vw,44px); border-radius: 24px 24px 0 0; background: #f3f3e9; color: #273c2c; box-shadow: inset 0 1px #ffffffbb; }
  :is(.two-column, .phone-studio) .studio-week-heading::before { content: attr(data-month); position: absolute; z-index: -1; right: 18px; bottom: -30px; color: #45563808; font-family: Georgia,serif; font-size: clamp(130px,14vw,220px); line-height: 1; letter-spacing: -.07em; }
  :is(.two-column, .phone-studio) .studio-eyebrow { display: flex; align-items: center; gap: 14px; color: #73806a; font-size: 10px; font-weight: 600; letter-spacing: .2em; }
  :is(.two-column, .phone-studio) .studio-week-count { border-left: 1px solid #c9d2bc; padding-left: 12px; font-size: 10px; font-weight: 400; letter-spacing: .03em; color: #617251; }
  :is(.two-column, .phone-studio) .studio-week-heading h1 { margin: 8px 0 0; font-family: 'Yu Mincho','Hiragino Mincho ProN',serif; font-size: clamp(30px,3.2vw,50px); font-weight: 500; line-height: 1.3; letter-spacing: -.06em; }
  :is(.two-column, .phone-studio) .studio-week-heading h1 > span { color: #789652; }
  :is(.two-column, .phone-studio) .studio-week-range { display: grid; gap: 8px; text-align: right; white-space: nowrap; }
  :is(.two-column, .phone-studio) .studio-week-range > span { color: #7c886f; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
  :is(.two-column, .phone-studio) .studio-week-range strong { color: #495c3f; font-size: clamp(15px,1.4vw,22px); font-weight: 500; font-variant-numeric: tabular-nums; }
  :is(.two-column, .phone-studio) > .week-grid {
    --text: #293d2e; --muted: #77846c; --panel: #f8f9f2; --panel-strong: #fff; --line: #dce2d0; --accent: #52703d; --accent-soft: #e4ead6; --focus-ring: 3px solid #5b7b3d;
    grid-column: 2; grid-row: 2; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(112px,1.65fr) repeat(6,minmax(66px,1fr));
    height: 100%; min-height: 0; gap: 0; padding: 0 clamp(14px,1.8vw,28px) 14px; border: 0; border-radius: 0 0 24px 24px; background: #f3f3e9; color: var(--text);
    overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c3cdb5 transparent;
  }
  :is(.two-column, .phone-studio) .day-card { display: grid; grid-template-columns: 70px minmax(0,1fr) 112px 44px; grid-template-rows: minmax(0,1fr); align-items: center; gap: clamp(10px,1.2vw,20px); min-height: 0; height: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid #dbe1d1; border-radius: 0; background: transparent; box-shadow: none; overflow: hidden; }
  :is(.two-column, .phone-studio) .day-card:last-child { border-bottom: 0; }
  :is(.two-column, .phone-studio) .day-card.today { padding-inline: 14px; border: 1px solid #405a3c; border-left: 3px solid #d5e6a8; border-radius: 14px; background: radial-gradient(ellipse at 100% 0%,#486345,transparent 80%),#1c382c; box-shadow: inset 0 1px #d7e3bf20,0 5px 16px #182c1f18; color: #e7edce; }
  :is(.two-column, .phone-studio) .day-head { align-self: stretch; justify-content: center; border-right: 1px solid #dbe1d1; padding-right: 9px; grid-column: 1; grid-row: 1; display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
  :is(.two-column, .phone-studio) .today .day-head { border-right-color: #c8d6a32b; }
  :is(.two-column, .phone-studio) .day-labels { display: flex; align-items: center; gap: 4px; }
  :is(.two-column, .phone-studio) .day-date { color: #35452e; font-size: 0; line-height: 1; font-weight: 400; }
  :is(.two-column, .phone-studio) .day-date::before { content: attr(data-studio-day); font-size: clamp(29px,2.7vw,44px); font-weight: 400; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
  :is(.two-column, .phone-studio) .day-card.today .day-date::before { font-size: clamp(36px,3.2vw,52px); }
  :is(.two-column, .phone-studio) .day-card.today .day-head::after { content: 'TODAY'; padding: 3px 7px; border: 1px solid #9fb88250; border-radius: 5px; color: #d0dfa9; font-size: 8px; font-weight: 600; letter-spacing: .14em; }
  :is(.two-column, .phone-studio) .day-name { font-size: 11px; font-weight: 500; color: #77856a; }
  :is(.two-column, .phone-studio) .day-card.sat .day-date { color: #5b7b8d; }
  :is(.two-column, .phone-studio) .day-card:is(.sun,.holiday) .day-date { color: #a56d55; }
  :is(.two-column, .phone-studio) .day-card.today .day-date { color: #e0eabe; }
  :is(.two-column, .phone-studio) .day-card.today .day-name { color: #bacbaa; }
  :is(.two-column, .phone-studio) .day-card.today:is(.sun,.holiday) :is(.day-date,.day-name,.holiday-name) { color: #ecc7aa; }
  :is(.two-column, .phone-studio) .day-card.today.sat:not(.holiday) :is(.day-date,.day-name) { color: #bdd2db; }
  :is(.two-column, .phone-studio) .holiday-name { max-width: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; font-size: 9px; }
  :is(.two-column, .phone-studio) .weather-block { grid-column: 3; grid-row: 1; min-height: 44px; padding: 0; border: 0; border-radius: 8px; gap: 4px; cursor: pointer; }
  :is(.two-column, .phone-studio) .weather-icon { font-size: 31px; }
  :is(.two-column, .phone-studio) .weather-temps { font-size: clamp(12px,1.1vw,16px); font-weight: 500; }
  :is(.two-column, .phone-studio) .weather-max { color: #8b6346; }
  :is(.two-column, .phone-studio) .weather-min { color: #6a8491; }
  :is(.two-column, .phone-studio) .weather-pop { color: #8b947f; font-size: 10px; }
  :is(.two-column, .phone-studio) .day-details { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; min-height: 0; max-height: 100%; overflow: hidden; }
  :is(.two-column, .phone-studio) .day-card .day-events { flex: 0 0 auto; min-height: 0; }
  :is(.two-column, .phone-studio) .event-list { overflow: visible; gap: 0; }
  :is(.two-column, .phone-studio) .event-chip { display: block; min-height: 44px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #30402c; text-align: left; font-size: clamp(13px,1.22vw,19px); line-height: 1.4; cursor: pointer; }
  :is(.two-column, .phone-studio) .event-chip ~ .event-chip { display: none; }
  :is(.two-column, .phone-studio) .event-chip-content { display: flex; align-items: baseline; gap: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  :is(.two-column, .phone-studio) .event-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
  :is(.two-column, .phone-studio) .event-time { flex-shrink: 0; color: #708361; font-weight: 500; margin-right: 0; font-size: .85em; font-variant-numeric: tabular-nums; }
  :is(.two-column, .phone-studio) .event-span-label { flex-shrink: 0; }
  :is(.two-column, .phone-studio) .event-chip.multi-day { background: #ebe7f1; border-color: #aa9dbb; color: #60536d; }
  :is(.two-column, .phone-studio) .event-chip.span-middle { border-inline: 2px solid #aa9dbb; }
  :is(.two-column, .phone-studio) .event-chip.span-end { border-right: 2px solid #aa9dbb; }
  :is(.two-column, .phone-studio) :is(.day-section-title,.day-garbage,.calendar-todos,.school-lunch-button) { display: none; }
  :is(.two-column, .phone-studio) .studio-day-caption { display: flex; gap: 5px; overflow: hidden; white-space: nowrap; padding-left: 10px; font-size: clamp(10px,.85vw,12px); line-height: 1.5; color: #6b795c; }
  :is(.two-column, .phone-studio) .studio-day-caption > span { flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; border-radius: 4px; background: #e5e9d9; }
  :is(.two-column, .phone-studio) .studio-day-caption:empty { display: none; }
  :is(.two-column, .phone-studio) .empty-text { padding: 5px 10px; color: #8e9783; font-size: clamp(12px,1vw,15px); }
  :is(.two-column, .phone-studio) .studio-day-more { grid-column: 4; grid-row: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: #7a8c64; cursor: pointer; }
  :is(.two-column, .phone-studio) .studio-day-more .studio-icon { width: 19px; height: 19px; }
  :is(.two-column, .phone-studio) .today .studio-day-more { background: #d0e2a4; color: #30452b; border-color: #d0e2a4; box-shadow: 0 3px 10px #0d241d33; }
  :is(.two-column, .phone-studio) .today .event-chip { color: #f0f1dc; background: transparent; padding-block: 5px; font-size: clamp(16px,1.6vw,25px); }
  :is(.two-column, .phone-studio) .today .event-chip-content { flex-wrap: wrap; gap: 2px 10px; }
  :is(.two-column, .phone-studio) .today .event-time { flex: 0 0 100%; color: #c4d6a1; font-size: 12px; letter-spacing: .04em; }
  :is(.two-column, .phone-studio) .today .event-title { font-weight: 450; }
  :is(.two-column, .phone-studio) .today .studio-day-caption > span { color: #c6d6b2; background: #ffffff0b; }
  :is(.two-column, .phone-studio) .today .empty-text { color: #b8c9a5; }
  :is(.two-column, .phone-studio) .today .weather-max { color: #dfcca0; }
  :is(.two-column, .phone-studio) .today .weather-min { color: #a7c4c8; }
  :is(.two-column, .phone-studio) .today .weather-pop { color: #a4b69c; }
  :is(.two-column, .phone-studio) .today .forecast-icon[data-weather-combined='false'] { color: #c9d5b3; }
  :is(.two-column, .phone-studio) .today .forecast-icon[data-weather-type='sun'] { color: #dfc983; }
  :is(.two-column, .phone-studio) :is(button,[role='button'],input,select):focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
}

/* Detail sheet owns its palette; shared dialogs and the original screen are untouched. */
.studio-day-dialog { width: min(620px,calc(100vw - 32px)); max-height: 88dvh; padding: 28px; border: 1px solid #d3dcc5; border-radius: 22px; background: #f2f3e9; color: #293d2e; box-shadow: 0 24px 100px #041c1aaa; }
.studio-day-dialog::backdrop { background: #0c211cc9; backdrop-filter: blur(7px); }
.studio-day-dialog > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.studio-day-dialog .studio-eyebrow { color: #7c886f; font-size: 10px; letter-spacing: .18em; }
.studio-day-dialog h2 { margin: 8px 0 0; font-size: 30px; font-weight: 500; }
.studio-day-dialog .studio-day-holiday { margin: 8px 0 0; color: #9b684b; font-size: 13px; }
.studio-day-dialog > header button { width: 44px; height: 44px; border: 1px solid #cdd7bf; border-radius: 50%; background: transparent; color: #425938; font-size: 25px; cursor: pointer; }
.studio-day-content { display: grid; gap: 20px; margin-top: 24px; }
.studio-day-content h3 { color: #7b886c; font-size: 12px; font-weight: 500; margin: 0 0 8px; }
.studio-day-content .day-section-title { display: none; }
.studio-day-content :is(.event-list,.calendar-todos) { display: grid; gap: 8px; max-height: none; overflow: visible; }
.studio-day-content :is(.event-chip,.calendar-todo-chip,.calendar-todo-more,.school-lunch-button) { display: block; min-height: 48px; width: 100%; padding: 12px; border: 1px solid #d5dfc9; border-radius: 9px; background: #ffffffa3; color: #33472d; text-align: left; font-size: 15px; line-height: 1.6; white-space: normal; cursor: pointer; }
.studio-day-content .event-chip-content { display: block; overflow: visible; }
.studio-day-content .event-chip.studio-extra-event { display: block; }
.studio-day-content .school-lunch-button { display: flex; align-items: center; gap: 10px; }
.studio-day-content .studio-icon { display: inline-block; }
.studio-day-content .garbage-chip { padding: 10px 12px; background: #e1e9d2; color: #4f6342; font-size: 14px; }
.studio-day-dialog button:focus-visible { outline: 3px solid #5b7b3d; outline-offset: 2px; }

@media (min-width:1024px) and (max-width:1280px) and (min-height:600px) and (orientation:landscape) {
  .dashboard.two-column { padding: 14px; gap: 0 16px; }
  .two-column .day-card { grid-template-columns: 52px minmax(0,1fr) 90px 44px; gap: 8px; padding-inline: 6px; }
  .two-column .day-card.today { padding-inline: 8px; }
  .two-column .weather-icon { font-size: 26px; }
  .two-column .studio-week-heading { padding-inline: 20px; }
  .two-column .header-weather-group > button { border-radius: 9px; }
  .two-column .topbar:has(#trainOpen:not([hidden]), #typhoonOpen:not([hidden])) #bookingOpen::after { display: none; }
  .two-column #bookingOpen .studio-icon { width: 22px; }
}
@media (min-width:1024px) and (min-height:741px) and (max-height:850px) and (orientation:landscape) {
  .two-column .topbar { grid-template-rows: 44px auto 44px; gap: 12px 8px; padding: 16px; }
  .two-column .clock { font-size: 90px; }
  .two-column .current-weather-temp { font-size: 28px; }
  .two-column .todo-panel { padding: 14px; }
  .two-column .todo-form { margin-top: 8px; }
}
@media (min-width:1024px) and (min-height:600px) and (max-height:740px) and (orientation:landscape) {
  .two-column .information-panel { gap: 9px; }
  .two-column .topbar { min-height: 0; gap: 9px 7px; padding: 10px 12px; grid-template-rows: 44px auto 44px; border-radius: 18px; }
  .two-column .header-todos { transform: none; }
  .two-column .header-todos button { min-height: 44px; height: 44px; width: 44px; min-width: 44px; }
  .two-column .clock { font-size: 68px; }
  .two-column .clock-block { gap: 7px; }
  .two-column .clock-date-details { gap: 4px; }
  .two-column .date-line { font-size: 13px; }
  .two-column .sun-times { font-size: 10px; }
  .two-column .current-weather { margin-top: 4px; padding: 0; gap: 4px; }
  .two-column .current-weather-icon { font-size: 27px; }
  .two-column .current-weather-temp { font-size: 25px; }
  .two-column .current-weather-label { font-size: 11px; }
  .two-column .todo-panel { padding: 9px 12px; }
  .two-column .todo-form { gap: 6px; margin-top: 4px; }
  .two-column .footer-row { flex-basis: 156px; min-height: 156px; grid-template-rows: minmax(72px,1fr) minmax(76px,.9fr); gap: 8px; }
  .two-column .footer-row:has(.garbage-done-button:not([hidden])) { min-height: 214px; grid-template-rows: minmax(130px,1fr) minmax(76px,.9fr); }
  .two-column .footer-row .summary-card { padding: 9px 11px; }
  .two-column .summary-label { margin-bottom: 5px; gap: 5px; }
  .two-column .summary-main { font-size: 12px; line-height: 1.4; -webkit-line-clamp: 2; }
  .two-column .studio-next-when { margin-bottom: 2px; font-size: 12px; line-height: 1.2; }
  .two-column .summary-label .studio-icon { width: 14px; height: 14px; }
  .two-column .energy-card-main { font-size: 21px; }
  .two-column .energy-card-breakdown { font-size: 10px; margin-top: 3px; }
  .two-column .studio-week-heading { padding-block: 15px; }
  .two-column .studio-week-heading h1 { margin-top: 5px; font-size: 29px; }
  .two-column .studio-week-range { gap: 5px; }
  .two-column > .week-grid { grid-template-rows: minmax(90px,1.45fr) repeat(6,minmax(64px,1fr)); padding-bottom: 10px; }
  .two-column .day-card { padding-block: 3px; }
  .two-column .day-date::before { font-size: 30px; }
  .two-column .today .day-date::before { font-size: 36px; }
  .two-column .day-details { gap: 1px; }
  .two-column .event-chip { min-height: 40px; padding-block: 7px; font-size: 13px; }
  .two-column .studio-day-caption { font-size: 10px; line-height: 1.4; }
  .two-column .today .event-chip { font-size: 16px; }
  .two-column .today .event-time { font-size: 11px; }
}
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) {
  .two-column .header-weather-group > button:hover { background: #3d563c; border-color: #b5ca8a; color: #edf2df; }
  .two-column .event-chip:hover { background: #e5ebd7; }
  .two-column .today .event-chip:hover { background: #ffffff0b; }
  .two-column .studio-day-more:hover { background: #52703d; color: #fff; border-color: #52703d; }
  .two-column .energy-card:hover { background: #dce7c4; border-color: #e5efce; }
}
@media (prefers-reduced-motion:no-preference) {
  .two-column .studio-day-more { transition: background .18s, color .18s; }
  .two-column .event-chip { transition: background .18s; }
}

/* Phone portrait uses the same paper agenda, in the normal page scroll. */
@media (max-width: 560px) and (orientation: portrait) {
  body { background: #13291f; }
  .dashboard.phone-studio {
    display: flex; flex-direction: column; height: auto;
    min-height: calc(100dvh - 72px - env(safe-area-inset-bottom));
    gap: 0; padding: 12px 12px 20px; overflow: visible;
  }
  .phone-studio .information-panel { display: contents; }
  .phone-studio .topbar {
    order: 0; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto;
    min-height: 0; gap: 14px 8px; padding: 10px 6px 22px;
  }
  .phone-studio .topbar::before { grid-column: 1 / -1; grid-row: 1; font-size: 9px; letter-spacing: .18em; }
  .phone-studio .topbar::after { display: none; }
  .phone-studio .clock { display: none; }
  .phone-studio .clock-block { grid-column: 1; grid-row: 2; min-height: 0; padding: 0; gap: 0; align-self: center; }
  .phone-studio .clock-date-details { gap: 7px; }
  .phone-studio .date-line { margin: 0; font-size: clamp(12px, 3.65vw, 18px); font-weight: 500; line-height: 1.5; letter-spacing: 0; }
  .phone-studio .sun-times { gap: 8px; font-size: 9px; }
  .phone-studio .sun-times > span::before { margin-right: 3px; }
  .phone-studio .header-weather-group { display: flex; grid-column: 1; grid-row: 3; gap: 8px; flex-wrap: wrap; width: auto; justify-content: flex-start; justify-self: start; }
  .phone-studio .header-weather-group > button { flex: 0 0 44px; width: 44px; min-width: 44px; border-radius: 13px; }
  .phone-studio #bookingOpen { display: none; }
  .phone-studio .header-weather-group .current-weather {
    position: absolute; top: 37px; right: 6px; grid-column: auto; grid-row: auto; display: grid; margin: 0;
    max-width: 78px; gap: 3px; pointer-events: auto;
  }
  .phone-studio .current-weather-icon, .phone-studio .current-weather-temp { font-size: 24px; }
  .phone-studio .current-weather-label { font-size: 10px; white-space: normal; line-height: 1.4; }
  .phone-studio .clock-block { margin-right: 6px; }
  .phone-studio .topbar { grid-template-columns: minmax(0, 1fr) 88px; }
  .phone-studio .header-todos { grid-column: 2; grid-row: 3; gap: 7px; align-self: start; }
  .phone-studio .header-todos button { flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; padding: 0; }
  .phone-studio .header-todos .shopping-cart-icon { transform: none; }
  .phone-studio .header-todos button > span:first-child { width: auto; height: auto; }
  .phone-studio .header-todos .shopping-cart-count { align-self: auto; }
  .phone-studio .baby-monitor-dot { width: 12px; height: 12px; right: 4px; bottom: 4px; }
  .phone-studio :is(.typhoon-count-badge,.train-count-badge) { top: -3px; right: -3px; background: #d5dda9; color: #263f2c; border-color: #254232; }
  .phone-studio .notice-row { order: 0; margin: 0 0 12px; }

  .phone-studio .studio-week-heading {
    order: 1; flex: 0 0 auto; align-items: center; gap: 6px;
    padding: 16px 18px; border-radius: 22px 22px 0 0;
  }
  .phone-studio .studio-week-heading::before { font-size: 132px; right: 6px; bottom: -24px; }
  .phone-studio .studio-eyebrow { gap: 8px; font-size: 8px; letter-spacing: .15em; }
  .phone-studio .studio-week-count { font-size: 9px; padding-left: 8px; }
  .phone-studio .studio-week-heading h1 { display: none; }
  .phone-studio .studio-week-range { align-self: end; gap: 5px; padding-bottom: 3px; }
  .phone-studio .studio-week-range > span { font-size: 8px; letter-spacing: .02em; }
  .phone-studio .studio-week-range strong { font-size: 11px; }
  .phone-studio > .week-grid {
    order: 2; flex: 0 0 auto; height: auto; grid-template-rows: none; grid-auto-rows: auto;
    gap: 0; padding: 0 10px 10px; border-radius: 0 0 22px 22px; overflow: visible;
  }
  .phone-studio .day-card {
    grid-template-columns: 42px minmax(0, 1fr) 64px; grid-template-rows: auto auto;
    min-height: 104px; height: auto; padding: 12px 4px; gap: 2px 7px;
  }
  .phone-studio .day-card.today {
    min-height: 128px; padding: 12px 6px;
    border: 1px solid #405a3c; box-shadow: 0 5px 16px #182c1f18;
  }
  .phone-studio .day-card.today::before { display: none; }
  .phone-studio .day-head, .phone-studio .day-card.today .day-head { grid-row: 1 / 3; padding: 0 6px 0 0; gap: 6px; }
  .phone-studio .day-labels { flex-direction: column; gap: 3px; }
  .phone-studio .day-date::before { font-size: 30px; }
  .phone-studio .day-card.today .day-date::before { font-size: 36px; }
  .phone-studio .day-card.today .day-head::after { font-size: 7px; padding: 3px 4px; letter-spacing: .08em; }
  .phone-studio .day-name { font-size: 10px; }
  .phone-studio .holiday-name { max-width: 34px; font-size: 8px; }
  .phone-studio .day-details, .phone-studio .day-card.today .day-details { grid-column: 2; grid-row: 1 / 3; gap: 7px; max-height: none; overflow: visible; }
  .phone-studio .event-chip, .phone-studio .today .event-chip { padding: 4px 0; font-size: 13px; min-height: 44px; line-height: 1.5; border-radius: 6px; }
  .phone-studio .today .event-chip { font-size: 16px; }
  .phone-studio .event-chip-content, .phone-studio .today .event-chip-content { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; white-space: normal; }
  .phone-studio .event-time, .phone-studio .today .event-time { flex: 0 0 auto; font-size: 10px; }
  .phone-studio .event-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
  .phone-studio .event-chip.multi-day { padding-inline: 6px; }
  .phone-studio .studio-day-caption { flex-wrap: wrap; gap: 3px; padding: 0; font-size: 9px; white-space: normal; }
  .phone-studio .studio-day-caption > span { padding: 2px 4px; }
  .phone-studio .empty-text { padding: 4px 0; font-size: 12px; }
  .phone-studio .weather-block, .phone-studio .day-card.today .weather-block { grid-column: 3; grid-row: 1; justify-content: center; align-self: end; flex-direction: column; gap: 2px; min-height: 44px; }
  .phone-studio .weather-icon { font-size: 24px; }
  .phone-studio .weather-temps { font-size: 11px; text-align: center; white-space: nowrap; }
  .phone-studio .weather-pop { margin-top: 2px; font-size: 9px; text-align: center; }
  .phone-studio .studio-day-more { grid-column: 3; grid-row: 2; justify-self: center; align-self: start; width: 44px; height: 44px; }
  .phone-studio .today .studio-day-more { width: 44px; height: 44px; }

  .phone-studio .footer-row, .phone-studio .footer-row:has(.garbage-done-button:not([hidden])) {
    order: 3; flex: 0 0 auto; min-height: 0; grid-template-rows: auto auto; gap: 12px 0; margin-top: 22px;
  }
  .phone-studio .footer-row .summary-card { padding: 14px 12px; justify-content: flex-start; }
  .phone-studio .summary-label { font-size: 11px; margin-bottom: 10px; }
  .phone-studio .summary-main { font-size: 13px; }
  .phone-studio .studio-next-when { font-size: 15px; }
  .phone-studio .studio-next-title { white-space: normal; overflow-wrap: anywhere; }
  .phone-studio .footer-row .energy-card { padding: 18px 44px 18px 18px; border-radius: 18px; }
  .phone-studio .energy-card-main { font-size: 25px; }
  .phone-studio .energy-card-breakdown { font-size: 11px; }
  .phone-studio .todo-panel:not(.mobile-sheet-open) { display: none; }
  .phone-studio .todo-panel.mobile-sheet-open {
    padding: 22px 16px 14px; border: 1px solid #60785c; border-radius: 22px;
    background: #19382f; box-shadow: 0 24px 80px #041c1a88;
  }
  .phone-studio .todo-panel.mobile-sheet-open .todo-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .phone-studio .todo-panel.mobile-sheet-open .todo-form :is(.todo-choice-field,.todo-note-field) {
    grid-column: 1;
    min-width: 0;
  }
  .phone-studio .todo-panel.mobile-sheet-open .todo-form :is(select,input) { font-size: 16px; }
  /* Native date controls must shrink within the available row, including
     when the clear button is visible. Avoid intrinsic grid track sizing. */
  .phone-studio .todo-panel.mobile-sheet-open .todo-date-field {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    grid-column: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .phone-studio .todo-panel.mobile-sheet-open .todo-date-field label {
    position: static;
    flex: 0 0 100%;
    width: auto;
    height: auto;
    clip-path: none;
  }
  .phone-studio .todo-panel.mobile-sheet-open .todo-date-field input {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: block;
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
  }
  .phone-studio .todo-panel.mobile-sheet-open #todoDateClear {
    flex: 0 0 40px;
  }
  .phone-studio .todo-panel.mobile-sheet-open .todo-form > button[type='submit'] {
    grid-column: 1;
    justify-self: end;
    width: 90px;
    min-width: 90px;
  }
  .phone-studio .todo-panel .todo-add-close { background: #344d37; }
  .mobile-action-bar { border-top-color: #61794c66; background: #142e24f5; box-shadow: 0 -8px 28px #0c211c33; }
  .mobile-action-bar button { color: #bbcbb0; font-weight: 500; }
  .mobile-action-bar svg { width: 23px; height: 23px; stroke-width: 1.6; }
  .mobile-action-bar button:active, .mobile-action-bar button.is-active { background: #344d37; color: #e4edc9; }
  .mobile-action-bar button[data-mobile-action='todo-add'] { background: #d4e7a5; color: #243b29; }
  .studio-day-dialog { padding: 20px 16px; border-radius: 20px; }
  .studio-day-dialog h2 { font-size: 25px; }
}
