/* Folio v0.5.5 — 基準画像へ寄せた高密度の見開きと家族予定 */
:root {
  --folio-paper-card: rgba(255, 250, 236, .76);
}

button { touch-action: manipulation; }
.category-filters[hidden] { display: none !important; }
.category-tag.self { background: #c66f52; }
.category-tag.kanako { background: #d48a50; }
.category-tag.yuto { background: #4d7fa8; }
.category-tag.minazuki { background: #b69446; }
.category-tag.maru { background: #6f7d56; }

.folio-menu-trigger {
  z-index: 120;
  top: max(9px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  bottom: auto;
  width: 54px;
  min-height: 45px;
  grid-template-columns: 17px 1fr;
  gap: 4px;
  padding: 7px 8px;
  border: 1px solid rgba(62, 38, 22, .38);
  border-radius: 3px 3px 3px 9px;
  background: linear-gradient(145deg, #79583e, #493021);
  box-shadow: -2px 4px 9px rgba(35, 20, 12, .24);
}
.folio-menu-trigger span {
  writing-mode: horizontal-tb;
  font: 12px var(--display);
  letter-spacing: .02em;
  white-space: nowrap;
}
.folio-menu-trigger svg { width: 17px; height: 17px; }

.paper-card { background: var(--folio-paper-card); }
.news-card .section-heading::after {
  content: "";
  flex: 1;
  margin-left: 13px;
  border-top: 1px solid rgba(77, 58, 38, .25);
}
.section-heading > span { font-size: 22px; }
.section-heading small,
.text-button,
.completed-toggle { font-size: 11px; }

.family-name {
  display: inline-grid;
  place-items: center;
  min-width: 45px;
  min-height: 23px;
  padding: 2px 6px;
  color: #fffaf0;
  background: var(--person);
  border-radius: 2px;
  font: 11px var(--utility);
  white-space: nowrap;
}
.family-today-panel { position: relative; }
.family-today-panel .section-heading > small { color: var(--ink-soft); font-family: var(--utility); }
.family-schedule-row,
.family-upcoming-row {
  min-width: 0;
  display: grid;
  align-items: center;
  border-bottom: 1px dotted rgba(76, 59, 38, .25);
}
.family-schedule-row time,
.family-upcoming-row time { color: var(--ink-soft); font: 11px var(--utility); white-space: nowrap; }
.family-schedule-row button,
.family-upcoming-row button {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: 14px var(--display);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.family-empty { color: rgba(78, 67, 53, .65); font: 11px var(--utility); }

.family-upcoming-panel { margin-top: 12px; padding: 7px 9px 9px; background: rgba(255, 250, 236, .5); border-top: 1px solid rgba(90, 69, 42, .24); }
.family-upcoming-body { position: relative; min-height: 174px; padding-right: 132px; }
.family-upcoming-row { grid-template-columns: 50px 100px minmax(0, 1fr); gap: 8px; min-height: 34px; }
.family-upcoming-row button { font-size: 15px; }
.family-upcoming-panel .bottom-photo { position: absolute; right: 3px; bottom: 3px; }

@media (min-width: 840px) {
  .left-page > .music-player {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    padding-right: 148px;
  }
  .book {
    width: calc(100vw - 6px);
    height: calc(100dvh - 6px);
    min-height: 720px;
    margin: 3px auto;
    padding: 4px 5px 5px;
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
    border-radius: 8px;
  }
  .paper-page { padding: 13px 17px 15px; }
  .page-rule { inset: 5px; }

  .left-sticker-plant {
    display: block;
    width: 132px;
    height: 147px;
    top: 22px;
    right: 20px;
    padding: 7px 7px 20px;
  }
  .weather-card {
    width: calc(100% - 148px);
    height: 104px;
    grid-template-columns: minmax(130px, 1.25fr) minmax(118px, .82fr) minmax(102px, .7fr);
  }
  .weather-main { padding: 8px 11px; }
  .weather-main strong { font-size: 46px; }
  .weather-main .eyebrow { font-size: 10px; }
  .weather-main > span:last-child { font-size: 15px; }
  .weather-stats { padding: 7px 9px; font-size: 12px; }
  .weather-stats small { font-size: 8px; }

  .news-card,
  .today-card { width: calc(100% - 2px); margin-top: 9px; padding: 7px 10px 8px; }
  .news-card { min-height: 105px; }
  .section-heading { min-height: 29px; }
  .section-heading > span { font-size: 20px; }
  .news-item { min-height: 23px; grid-template-columns: 62px minmax(0,1fr); gap: 7px; }
  .news-item b { font-size: 13px; }
  .news-item small { font-size: 10px; }
  .today-card { min-height: 172px; }
  .task-row { min-height: 33px; grid-template-columns: 25px 52px minmax(0,1fr) auto; gap: 7px; }
  .task-check { width: 18px; height: 18px; }
  .task-time { font-size: 11px; }
  .task-open { font-size: 15px; }
  .category-tag { font-size: 10px; }
  .cover-upcoming .agenda-row time,
  .cover-upcoming .agenda-row button { font-size: 11px; }

  .favorites {
    width: 58%;
    margin-top: 10px;
    padding: 21px 4px 0;
    gap: 8px 5px;
  }
  .favorites::before { font-size: 14px; }
  .favorites small { font-size: 9px; }
  body[data-app-size="standard"] .favorites { grid-template-columns: repeat(6, minmax(0,1fr)); }
  body[data-app-size="large"] .favorites { grid-template-columns: repeat(5, minmax(0,1fr)); }
  body[data-app-size="xlarge"] .favorites { grid-template-columns: repeat(4, minmax(0,1fr)); }
  body[data-app-size="standard"] .app-tile { width: 42px; height: 42px; }
  body[data-app-size="large"] .app-tile { width: 52px; height: 52px; }
  body[data-app-size="xlarge"] .app-tile { width: 64px; height: 64px; }

  .family-today-panel {
    position: absolute;
    right: 18px;
    bottom: 22px;
    width: 37%;
    min-height: 157px;
    padding: 6px 8px 7px;
    transform: rotate(.16deg);
  }
  .family-today-panel .section-heading { min-height: 25px; }
  .family-today-panel .section-heading > span { font-size: 16px; }
  .family-today-panel .section-heading > small { display: none; }
  .family-schedule-row { grid-template-columns: 46px 42px minmax(0, 1fr); gap: 5px; min-height: 25px; }
  .family-schedule-row button { font-size: 12px; }
  .family-schedule-row .family-empty { grid-column: 2 / -1; }

  .cover-scraps {
    display: block;
    right: auto;
    left: 16px;
    bottom: 16px;
    width: 135px;
    height: 130px;
    pointer-events: none;
    opacity: 0;
  }

  .right-header { min-height: 63px; padding: 0 66px 0 2px; }
  .right-header h1 { font-size: 35px; }
  .right-header .eyebrow { font-size: 10px; }
  .calendar-card { padding: 8px 10px 10px; }
  .calendar-controls { height: 38px; font-size: 20px; }
  .week-row { height: 27px; font-size: 10px; }
  .calendar-day { height: 41px; font-size: 13px; }
  .day-dots i { width: 5px; height: 5px; }
  .family-upcoming-panel .section-heading > span { font-size: 21px; }
  .family-upcoming-body { min-height: 176px; padding-right: 138px; }
  .family-upcoming-row { min-height: 34px; }
  .bottom-photo { width: 122px; height: 119px; }

  .page-fold-actions { right: 15px; bottom: 12px; }
}

/* v0.6.6 — 日付索引メモ、場所を直接選ぶアプリ配置、ゆとりある家族欄 */
.memo-studio {
  grid-template-columns: 154px minmax(0,1fr);
  gap: 13px;
  align-items: start;
}
.memo-archive {
  padding: 12px 9px;
  text-align: left;
}
.memo-archive .section-heading { align-items: flex-start; }
.memo-archive .section-heading small { font-size: 7px; }
.memo-history-tabs { gap: 2px; margin: 8px 0 5px; }
.memo-history-tabs button { padding: 8px 2px; }
.memo-history-list { padding-right: 3px; }
.memo-history-item {
  grid-template-columns: minmax(0,1fr) 30px;
  border-left: 3px solid transparent;
  transition: background .18s ease, border-color .18s ease;
}
.memo-history-item.is-selected {
  border-left-color: #657c6b;
  background: rgba(93,119,99,.14);
}
.memo-history-item > button:first-child { padding: 11px 3px 11px 7px; }
.memo-history-item time {
  margin: 0;
  color: var(--folio-ink);
  font: 500 10px var(--utility);
  letter-spacing: .02em;
  text-align: left;
}
.memo-history-item.is-selected time { color: #385343; }
.memo-history-delete { padding: 8px 2px; font-size: 7px; }
.memo-workspace { position: relative; gap: 13px; }
.memo-workspace .text-memo {
  min-height: 445px;
  padding: 8px 10px 10px;
  overflow: visible;
}
.memo-workspace .text-memo textarea {
  width: 100%;
  height: 380px;
  padding: 7px clamp(170px,28%,245px) 10px 7px;
  vertical-align: top;
}
.memo-text-footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(63,74,64,.14);
}
.memo-text-footer .memo-type-controls { margin: 0; }
.memo-photo {
  position: absolute;
  z-index: 5;
  top: 20px;
  right: 18px;
  width: clamp(150px,22%,215px);
  height: 245px;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0,1fr) 24px;
  padding: 7px 7px 18px;
  box-shadow: 0 8px 19px rgba(48,35,23,.18);
  transform: rotate(1.15deg);
}
.memo-photo::before {
  content: "";
  position: absolute;
  width: 62px;
  height: 13px;
  top: -7px;
  left: calc(50% - 31px);
  background: rgba(204,183,133,.52);
  transform: rotate(-2deg);
}
.memo-photo img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.memo-photo span { padding-top: 5px; font-size: 8px; }

.favorite-page-switch {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  margin-top: 12px;
  padding: 3px;
  border: 1px solid rgba(63,76,66,.19);
  background: rgba(226,217,195,.32);
}
.favorite-page-switch button {
  min-height: 38px;
  border: 0;
  color: var(--folio-ink-soft);
  background: transparent;
  font: 10px var(--display);
}
.favorite-page-switch button.is-active {
  color: #fffaf0;
  background: #526a5a;
  box-shadow: 0 3px 9px rgba(48,60,51,.2);
}
.favorite-shelf-grid {
  grid-template-columns: repeat(var(--placement-cols,5),minmax(0,1fr));
  gap: 6px;
  margin-top: 10px;
}
.favorite-position {
  position: relative;
  min-width: 0;
  min-height: 92px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 11px 4px 7px;
  border: 1px solid rgba(66,78,68,.16);
  color: var(--folio-ink-soft);
  background: rgba(255,253,246,.34);
  box-shadow: none;
}
.favorite-position.is-selected {
  border-color: #58705f;
  background: rgba(91,116,97,.15);
  box-shadow: inset 0 0 0 2px rgba(88,112,95,.28);
}
.favorite-position em {
  position: absolute;
  top: 4px;
  left: 6px;
  color: var(--folio-ink-soft);
  font: normal 7px var(--utility);
}
.favorite-position > span:not(.app-tile) { font: 20px/1 var(--display); }
.favorite-position .app-tile { width: 44px !important; height: 44px !important; }
.favorite-position b {
  width: 100%;
  overflow: hidden;
  font: 8px var(--body);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clear-favorite-slot {
  align-self: flex-start;
  margin-top: 9px;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid rgba(155,77,61,.38);
  color: #914d40;
  background: transparent;
  font: 8px var(--utility);
}
.clear-favorite-slot:disabled { opacity: .35; }

@media (min-width: 840px) {
  .home-view .right-page {
    grid-template-rows: 7.5% minmax(0,54.5%) minmax(0,35.3%);
  }
  .home-view .right-page .family-today-panel {
    padding-top: 9px;
    padding-bottom: 10px;
  }
  .home-view .right-page .family-schedule-row {
    min-height: 31px;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile {
    width: clamp(58px,4.6vw,68px) !important;
    height: clamp(58px,4.6vw,68px) !important;
  }
  .home-view .left-page > .favorites small { font-size: 8px; }
  .home-view .right-apps-grid .app-tile {
    width: clamp(58px,4.6vw,68px) !important;
    height: clamp(58px,4.6vw,68px) !important;
  }
}
@media (max-width: 839px) {
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile {
    width: 52px !important;
    height: 52px !important;
  }
}
@media (max-width: 390px) {
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile {
    width: 47px !important;
    height: 47px !important;
  }
}

/* v0.6.8 — 天気と写真を主役にした左ページ、写真の向き・位置調整 */
[data-photo-slot] { overflow: hidden; }
[data-photo-slot] img,
#photoEditorImage {
  transform: translate3d(var(--photo-x, 0), var(--photo-y, 0), 0) rotate(var(--photo-rotation, 0deg)) scale(var(--photo-scale, 1));
  transform-origin: center;
  will-change: transform;
}

.photo-page-guide {
  margin: -8px 0 12px;
  color: var(--folio-ink-soft);
  font: 10px/1.6 var(--body);
  letter-spacing: .03em;
}

.photo-editor-dialog {
  width: min(760px, calc(100vw - 24px));
  max-width: none;
  padding: 0;
  border: 0;
  color: var(--folio-ink);
  background: transparent;
}
.photo-editor-dialog::backdrop { background: rgba(25,18,12,.58); }
.photo-editor-paper {
  padding: 22px;
  border: 1px solid rgba(75,60,38,.34);
  color: #29332d;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(76,70,56,.045) 31px 32px),
    #f1ead8;
  box-shadow: 0 24px 65px rgba(24,16,10,.4);
}
.photo-editor-paper .eyebrow { color: #9b583e; }
.photo-editor-paper h2,
.photo-editor-paper button,
.photo-editor-paper label { color: #29332d; }
.photo-editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.photo-editor-header h2 { margin: 2px 0 0; font: 500 27px var(--display); }
.photo-editor-header > button { width: 42px; height: 42px; border: 1px solid rgba(60,73,64,.24); border-radius: 50%; color: var(--folio-ink); background: rgba(255,252,243,.54); font-size: 22px; }
.photo-editor-stage {
  position: relative;
  height: min(50dvh, 430px);
  margin-top: 16px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  border: 9px solid #f8f2e4;
  border-bottom-width: 28px;
  background: #cfc7b8;
  box-shadow: 0 10px 25px rgba(51,39,26,.17);
}
.photo-editor-stage:active { cursor: grabbing; }
.photo-editor-stage img { width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; pointer-events: none; }
.photo-editor-stage > span { position: absolute; right: 8px; bottom: -22px; color: #6f675c; font: 8px var(--utility); letter-spacing: .08em; }
.photo-editor-controls { margin-top: 14px; display: grid; grid-template-columns: auto auto auto minmax(180px,1fr) auto; align-items: center; gap: 8px; }
.photo-editor-controls button,
.photo-editor-actions button { min-height: 42px; padding: 0 14px; border: 1px solid rgba(62,75,65,.25); color: var(--folio-ink); background: rgba(255,252,243,.52); font: 10px var(--body); }
.photo-editor-controls label { min-height: 42px; display: grid; grid-template-columns: auto minmax(100px,1fr); align-items: center; gap: 10px; padding: 0 12px; border: 1px solid rgba(62,75,65,.18); background: rgba(255,252,243,.35); font: 10px var(--body); }
.photo-editor-controls input { width: 100%; accent-color: #536b5b; }
.photo-editor-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }
.photo-editor-actions .primary { color: #f8f1df; background: #43594c; }
.photo-page-grid .large-polaroid span { color: #394139; }

@media (min-width: 840px) {
  .home-view .left-page {
    grid-template-rows: 34% 31% minmax(0,1fr) !important;
    gap: 1.45% !important;
  }
  .home-view .left-page > .weather-card {
    width: 64% !important;
    height: 100% !important;
    margin-left: 0 !important;
    grid-template-columns: 43% 31% 26%;
  }
  .home-view .left-sticker-plant {
    top: 1.5% !important;
    right: 1.5% !important;
    width: 32.5% !important;
    height: 32.5% !important;
    padding: 0 !important;
  }
  .home-view .left-page > .today-card,
  .home-view .left-page > .favorites { margin-top: 0 !important; }
}

@media (max-width: 839px) {
  .photo-editor-paper { padding: 16px 12px 13px; }
  .photo-editor-stage { height: min(46dvh, 360px); }
  .photo-editor-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .photo-editor-controls label { grid-column: 1 / -1; }
  .photo-editor-controls button:first-child { grid-column: 1 / -1; }
  .photo-editor-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  [data-photo-slot] img,
  #photoEditorImage { will-change: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .contents-backdrop,
  .more-sheet[data-origin] { animation: none !important; }
}

/* v0.6.7 — 操作レスポンスと全ページ共通スワイプ */
.views,
.view { touch-action: pan-y; }

.view.is-active,
.turn-left .view.is-active,
.turn-right .view.is-active,
.turn-index .view.is-active { animation: none !important; }

.contents-backdrop {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  animation: folio-fast-fade .14s ease-out both !important;
}

.more-sheet,
.more-sheet[data-origin="left"],
.more-sheet[data-origin="right"] {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background-color: rgba(246, 239, 219, .97);
  animation-duration: .18s !important;
  will-change: transform, opacity;
}

.more-sheet[data-origin="right"] { animation-name: folio-fast-index-right !important; }
.more-sheet[data-origin="left"] { animation-name: folio-fast-index-left !important; }

@keyframes folio-fast-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes folio-fast-index-right {
  from { opacity: 0; transform: translate3d(7%, -50%, 0); }
  to { opacity: 1; transform: translate3d(0, -50%, 0); }
}
@keyframes folio-fast-index-left {
  from { opacity: 0; transform: translate3d(-7%, -50%, 0); }
  to { opacity: 1; transform: translate3d(0, -50%, 0); }
}

body.portal-fullscreen .portal-view.is-active {
  position: fixed;
  z-index: 60;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #fff;
}
body.portal-fullscreen .portal-paper { height: 100dvh; display: block; background: #fff; }
body.portal-fullscreen .portal-frame-wrap {
  position: fixed;
  z-index: 61;
  inset: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.portal-fullscreen .portal-toolbar {
  position: fixed;
  z-index: 64;
  top: max(10px,env(safe-area-inset-top));
  right: max(10px,env(safe-area-inset-right));
  min-height: 0;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.portal-fullscreen .portal-toolbar > :not(.portal-toolbar-actions),
body.portal-fullscreen #portalReloadButton { display: none; }
body.portal-fullscreen #portalFullscreenButton {
  min-height: 44px;
  padding: 0 15px;
  color: #fffdf5;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: rgba(39,52,45,.88);
  box-shadow: 0 5px 16px rgba(24,27,24,.27);
  backdrop-filter: blur(7px);
}
body.portal-fullscreen .more-sheet { z-index: 90; }
body.portal-fullscreen .contents-backdrop { z-index: 89; }
body.portal-fullscreen .folio-menu-trigger { display: none !important; }

@media (max-width: 839px) {
  .memo-studio { grid-template-columns: 122px minmax(0,1fr); }
  .memo-archive { position: sticky; top: 7px; }
  .memo-history-list { max-height: calc(100dvh - 205px); }
  .memo-workspace .text-memo { min-height: 410px; }
  .memo-workspace .text-memo textarea {
    height: 342px;
    padding-right: clamp(112px,42%,165px);
  }
  .memo-text-footer { align-items: flex-start; flex-direction: column; }
  .memo-photo {
    position: absolute;
    top: 18px;
    right: 12px;
    width: clamp(105px,38%,150px);
    height: 190px;
    min-height: 0;
  }
  .favorite-position { min-height: 78px; }
  .favorite-position .app-tile { width: 35px !important; height: 35px !important; }
}

@media (max-width: 520px) {
  .memo-studio { grid-template-columns: 92px minmax(0,1fr); gap: 7px; }
  .memo-archive .section-heading small { display: none; }
  .memo-history-tabs { grid-template-columns: 1fr; }
  .memo-history-item { grid-template-columns: minmax(0,1fr) 25px; }
  .memo-history-item time { font-size: 8px; }
  .memo-workspace .text-memo textarea { padding-right: 100px; }
  .memo-photo { width: 92px; height: 145px; right: 9px; }
  .memo-photo span { display: none; }
  .favorite-page-switch button { font-size: 9px; }
  .favorite-shelf-grid { gap: 3px; }
  .favorite-position { min-height: 69px; padding-right: 2px; padding-left: 2px; }
  .favorite-position .app-tile { width: 29px !important; height: 29px !important; }
  .favorite-position b { font-size: 6px; }
}

@media (max-width: 839px) {
  .book { height: 100dvh; min-height: 0; padding: 2px; overflow: hidden; }
  .paper-page { height: calc(100dvh - 4px); min-height: 0; padding: 6px 7px 13px; overflow: hidden; }
  .page-rule { inset: 3px; }
  .folio-menu-trigger {
    top: max(6px, env(safe-area-inset-top));
    right: max(5px, env(safe-area-inset-right));
    width: 47px;
    min-height: 40px;
    grid-template-columns: 15px 1fr;
    padding: 5px 6px;
  }
  .folio-menu-trigger span { font-size: 10px; }

  .weather-card {
    width: calc(100% - 43px);
    height: 96px;
    grid-template-columns: 42% 29% 29%;
  }
  .weather-main strong { font-size: 47px; }
  .weather-main > span:last-child { font-size: 14px; }
  .weather-stats { font-size: 11px; }
  .news-card { min-height: 76px; padding-top: 3px; padding-bottom: 4px; }
  .news-list .news-item:nth-child(n+3) { display: none; }
  .today-card { min-height: 122px; padding-top: 3px; padding-bottom: 4px; }
  .news-item b { font-size: 11px; }
  .task-time { font-size: 10px; }
  .task-open { font-size: 14px; }
  .category-tag { font-size: 9px; }
  .task-row { min-height: 27px; }
  .today-list.is-cover-todo {
    max-height: 88px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
  }
  .today-list.is-cover-todo .task-row { min-height: 21px; }
  .today-list.is-cover-todo .task-row:nth-child(n+4) { display: grid; }
  .today-list.is-cover-todo .task-open { padding-top: 3px; padding-bottom: 3px; }
  .today-list.is-cover-todo::-webkit-scrollbar { display: none; }
  .today-list.is-cover-todo .task-row.is-overdue .task-time { color: #b04f3b; font-weight: 700; }
  .upcoming-toggle,
  .cover-upcoming { display: none !important; }

  .favorites {
    min-height: 69px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 7px;
    padding-top: 20px;
    overflow-x: auto;
  }
  .favorites button { flex: 0 0 58px; width: 58px; }
  body[data-app-size="standard"] .app-tile { width: 38px; height: 38px; }
  body[data-app-size="large"] .app-tile { width: 47px; height: 47px; }
  body[data-app-size="xlarge"] .app-tile { width: 57px; height: 57px; }
  .favorites small { font-size: 9px; }

  .family-today-panel { min-height: 116px; margin-top: 7px; padding: 3px 7px; }
  .family-today-panel .section-heading > span { font-size: 17px; }
  .family-today-panel .section-heading > small { font-size: 8px; }
  .family-schedule-row { grid-template-columns: 49px 41px minmax(0, 1fr); gap: 5px; min-height: 18px; }
  .family-schedule-row button { font-size: 12px; }
  .family-name { min-height: 19px; font-size: 9px; }
  .family-schedule-row .family-empty { grid-column: 2 / -1; }
  .cover-scraps { display: none; }

  .more-sheet { bottom: 10px; }
}

@media (max-width: 390px) {
  .weather-card { height: 94px; grid-template-columns: 41% 31% 28%; }
  .weather-main strong { font-size: 42px; }
  .weather-main .eyebrow { font-size: 8px; }
  .weather-main > span:last-child { font-size: 12px; }
  .weather-stats { padding: 6px; font-size: 9px; }
  .news-card { min-height: 74px; }
  .news-item { grid-template-columns: 45px minmax(0,1fr); }
  .news-item b { font-size: 10px; }
  .today-card { min-height: 120px; }
  .task-row { grid-template-columns: 22px 39px minmax(0,1fr) auto; gap: 4px; }
  .task-open { font-size: 13px; }
  .category-tag { max-width: 42px; overflow: hidden; font-size: 8px; }
}

/* v0.5.5 studio refinement — 和モダンの紙面設計とページめくり */
:root {
  --folio-ink: #252e2a;
  --folio-ink-soft: #59635d;
  --folio-paper: #f0ead9;
  --folio-paper-light: #fbf7eb;
  --folio-moss: #536c5c;
  --folio-russet: #9b5c42;
  --folio-brass: #ad9364;
  --folio-hairline: rgba(48, 57, 51, .18);
  --folio-shadow-soft: 0 8px 22px rgba(49, 37, 24, .12);
  --display: "Yu Mincho", "Hiragino Mincho ProN", serif;
  --body: "Hiragino Mincho ProN", "Yu Mincho", serif;
  --utility: "Hiragino Sans", "Yu Gothic", sans-serif;
  --ink: var(--folio-ink);
  --ink-soft: var(--folio-ink-soft);
  --paper: var(--folio-paper);
  --paper-light: var(--folio-paper-light);
  --terracotta: var(--folio-russet);
  --olive: var(--folio-moss);
}

html,
body { color: var(--folio-ink); }
body::after { z-index: 1000; pointer-events: none; }
.app-shell { position: relative; z-index: auto; }
.views { touch-action: pan-y; }
.view.is-active { animation: folio-index-open .38s cubic-bezier(.2,.72,.24,1) both; }
.turn-left .view.is-active { animation-name: folio-turn-left; }
.turn-right .view.is-active { animation-name: folio-turn-right; }
@keyframes folio-index-open {
  from { opacity: .2; transform: perspective(1200px) rotateX(.8deg) translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes folio-turn-left {
  from { opacity: .35; transform: perspective(1500px) translateX(7%) rotateY(-5deg); transform-origin: left center; }
  to { opacity: 1; transform: none; }
}
@keyframes folio-turn-right {
  from { opacity: .35; transform: perspective(1500px) translateX(-7%) rotateY(5deg); transform-origin: right center; }
  to { opacity: 1; transform: none; }
}

.book {
  border-color: #21140e;
  background:
    linear-gradient(90deg, rgba(255,255,255,.055), transparent 9%, rgba(20,10,6,.18) 49%, rgba(255,255,255,.05) 51%, transparent 91%),
    repeating-linear-gradient(4deg, rgba(255,255,255,.014) 0 1px, rgba(23,11,6,.025) 1px 4px),
    #4f3022;
  box-shadow: inset 0 0 0 2px rgba(224,195,145,.08), inset 0 0 28px rgba(17,8,4,.35), 0 15px 40px rgba(16,8,5,.42);
}
.paper-page,
.detail-paper {
  color: var(--folio-ink);
  background-color: var(--folio-paper);
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.15), transparent 14%, transparent 88%, rgba(72,47,25,.05)),
    radial-gradient(circle at 16% 12%, rgba(69,62,47,.055) 0 1px, transparent 1.3px),
    radial-gradient(circle at 76% 66%, rgba(69,62,47,.035) 0 1px, transparent 1.4px),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(68,74,67,.042) 28px 29px);
  background-size: auto, 9px 9px, 12px 12px, auto;
}
.left-page,
.right-page { transform: none; }
.paper-page::before,
.detail-paper::before { border-color: rgba(86, 72, 48, .12); box-shadow: inset 0 0 15px rgba(78, 54, 30, .05); }
.page-rule { border-color: rgba(77, 68, 50, .11); }
.book-spine {
  background: linear-gradient(90deg, rgba(18,9,5,.45), rgba(237,221,188,.29) 47%, rgba(27,13,7,.48));
  box-shadow: inset 3px 0 7px rgba(0,0,0,.22), inset -3px 0 7px rgba(0,0,0,.2);
}

.paper-card {
  border: 0;
  border-top: 1px solid var(--folio-hairline);
  border-bottom: 1px solid rgba(48,57,51,.13);
  border-radius: 0;
  background: rgba(251, 247, 235, .68);
  box-shadow: 0 4px 13px rgba(49, 37, 24, .065);
}
.section-heading {
  border-bottom-color: rgba(52,61,55,.2);
  letter-spacing: .01em;
}
.section-heading > span { font-family: var(--display); font-weight: 500; }
.section-heading svg { color: var(--folio-russet); stroke-width: 1.35; }
.eyebrow { color: var(--folio-russet); font-family: var(--utility); font-weight: 600; letter-spacing: .18em; }
.text-button { color: var(--folio-russet); text-decoration: none; border-bottom: 1px solid currentColor; }

.weather-card {
  isolation: isolate;
  border: 1px solid rgba(49,64,56,.25);
  border-radius: 0;
  background: url("media/weather-washi-v054.png") center 54% / cover no-repeat;
  box-shadow: 0 7px 16px rgba(43, 50, 43, .17);
}
.weather-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, transparent 0 39%, rgba(246,242,226,.79) 44%, rgba(246,242,226,.91) 100%);
  pointer-events: none;
}
.weather-card::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255,255,255,.32);
  pointer-events: none;
}
.weather-visual { background: transparent !important; }
.weather-visual .sun,
.weather-visual .cloud { display: none !important; }
.weather-main {
  background: rgba(245,241,225,.64);
  border-right-color: rgba(48,60,53,.18);
  backdrop-filter: blur(1.8px);
}
.weather-main strong { color: #24342d; font-family: var(--utility); font-weight: 300; letter-spacing: -.08em; }
.weather-main > span:last-child { color: #33483d; }
.weather-stats {
  color: #2e3a34;
  background: rgba(247,243,229,.76);
  backdrop-filter: blur(2.5px);
}
.weather-stats small { color: #657169; }
.lift-card:active,
.lift-card:focus { transform: translateY(-2px); box-shadow: 0 11px 23px rgba(43, 50, 43, .2); }

.left-sticker-plant {
  transform: none;
  border: 0;
  background: #f8f3e6;
  box-shadow: 0 8px 14px rgba(42,30,18,.18);
}
.news-card,
.today-card,
.family-today-panel { transform: none; }
.news-card::before {
  height: 14px;
  top: -7px;
  background: rgba(211,190,143,.42);
  box-shadow: none;
}
.news-card .section-heading::after { border-top-color: rgba(63,68,57,.2); }
.news-item { border-bottom-color: rgba(58,65,57,.19); }
.news-item small { color: var(--folio-russet); }
.news-item b,
.task-open,
.family-schedule-row button,
.family-upcoming-row button { font-family: var(--body); font-weight: 500; }
.completed-toggle {
  border: 0;
  border-bottom: 1px solid rgba(50,58,52,.32);
  border-radius: 0;
  background: transparent;
}
.task-row { border-bottom-color: rgba(54,63,56,.13); }
.task-check { border-radius: 2px; border-width: 1px; }
.category-tag,
.family-name { border-radius: 1px; letter-spacing: .03em; }
.favorites::before { color: var(--folio-ink-soft); font-family: var(--display); letter-spacing: .07em; }
.app-tile {
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 11px;
  box-shadow: 0 5px 10px rgba(43,44,36,.14);
}
.favorites button:active .app-tile { transform: scale(.96); }

.right-header h1,
.calendar-controls,
.detail-header h1 { font-family: var(--display); font-weight: 500; }
.calendar-card {
  border: 1px solid rgba(53,61,55,.13);
  background: rgba(250,246,234,.62);
  box-shadow: 0 5px 17px rgba(50,38,25,.07);
}
.calendar-controls { border-bottom-color: rgba(54,62,56,.17); }
.calendar-controls button { color: var(--folio-russet); }
.week-row { color: var(--folio-ink-soft); font-family: var(--utility); letter-spacing: .08em; }
.calendar-day { border-color: rgba(55,64,57,.09); }
.calendar-day.is-today::after { border-color: var(--folio-russet); }
.family-upcoming-panel {
  border-top: 1px solid rgba(53,62,55,.2);
  background: rgba(251,247,235,.49);
}
.family-upcoming-row,
.family-schedule-row { border-bottom-color: rgba(58,65,57,.18); }

.folio-menu-trigger {
  position: fixed !important;
  z-index: 500;
  pointer-events: auto;
  isolation: isolate;
  width: 62px;
  min-height: 48px;
  grid-template-columns: 18px 1fr;
  border: 1px solid rgba(255,236,196,.25);
  border-radius: 2px 2px 2px 10px;
  color: #fff9ec;
  background: linear-gradient(150deg, #654735, #39251b);
  box-shadow: 0 6px 16px rgba(24,13,8,.3), inset 0 0 0 1px rgba(255,255,255,.04);
}
.folio-menu-trigger span { font: 500 12px var(--display); letter-spacing: .08em; }
.folio-menu-trigger svg { stroke-width: 1.25; }
.folio-menu-trigger:active { transform: translateY(1px); }

.more-sheet {
  z-index: 490;
  top: max(66px, calc(env(safe-area-inset-top) + 58px));
  right: max(10px, env(safe-area-inset-right));
  bottom: auto;
  left: auto;
  width: min(450px, calc(100vw - 20px));
  padding: 16px;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1px;
  transform: none;
  border: 1px solid rgba(63,48,29,.28);
  border-radius: 2px 2px 2px 12px;
  color: var(--folio-ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(77,66,47,.04) 0 1px, transparent 1.4px) 0 0 / 9px 9px,
    #f4edda;
  box-shadow: 0 18px 40px rgba(24,14,8,.32);
}
.more-sheet:not([hidden]) { display: grid !important; }
.contents-heading {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 1px 10px;
  padding: 2px 4px 14px;
  border-bottom: 1px solid rgba(54,61,55,.22);
}
.contents-heading small { grid-column: 1 / -1; color: var(--folio-russet); font: 600 8px var(--utility); letter-spacing: .2em; }
.contents-heading b { font: 500 26px var(--display); }
.contents-heading span { padding-bottom: 3px; color: var(--folio-ink-soft); font: 10px var(--utility); }
.more-sheet button {
  min-height: 74px;
  display: grid;
  place-items: center;
  gap: 6px;
  border-right: 1px solid rgba(55,62,55,.11);
  border-bottom: 1px solid rgba(55,62,55,.11);
  color: var(--folio-ink);
  background: rgba(255,252,242,.2);
}
.more-sheet button:active { background: rgba(83,108,92,.12); }
.more-sheet svg { width: 22px; height: 22px; color: var(--folio-moss); stroke-width: 1.3; }
.more-sheet span { font: 500 11px var(--display); }

.page-turn-tab {
  position: fixed;
  z-index: 390;
  top: 50%;
  width: 31px;
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 4px;
  border: 1px solid rgba(54,37,24,.35);
  color: #f8f0dc;
  background: linear-gradient(180deg, #6a4a35, #412a1e);
  box-shadow: 0 5px 12px rgba(31,17,10,.22);
  transform: translateY(-50%);
}
.page-turn-tab[hidden] { display: none !important; }
.page-turn-tab span,
.page-turn-tab b { writing-mode: vertical-rl; }
.page-turn-tab span { opacity: .65; font: 7px var(--utility); letter-spacing: .14em; }
.page-turn-tab b { overflow: hidden; max-height: 52px; font: 500 10px var(--display); letter-spacing: .08em; white-space: nowrap; text-overflow: ellipsis; }
.page-turn-left { left: max(2px, env(safe-area-inset-left)); border-radius: 0 7px 7px 0; }
.page-turn-right { right: max(2px, env(safe-area-inset-right)); border-radius: 7px 0 0 7px; }

.detail-paper { min-height: 100dvh; }
.detail-header { border-bottom: 1px solid rgba(52,61,55,.2); }
.detail-header h1 { letter-spacing: .03em; }
.back-button {
  border-radius: 2px;
  border-color: rgba(51,60,54,.22);
  background: rgba(251,247,235,.55);
}
.settings-list {
  max-width: 980px;
  padding: 4px 18px;
  border: 1px solid rgba(53,61,55,.14);
  background: rgba(251,247,235,.58);
}
.settings-list > button,
.settings-list > label,
.settings-choice { border-bottom-color: rgba(53,61,55,.14); }
.settings-list select,
.settings-list input[type="text"] {
  min-height: 38px;
  border: 1px solid rgba(54,62,56,.23);
  border-radius: 1px;
  color: var(--folio-ink);
  background: rgba(255,252,243,.76);
  padding: 7px 9px;
  font: 12px var(--utility);
}
.page-settings {
  margin: 12px -4px;
  padding: 14px 16px 4px;
  border-left: 3px solid var(--folio-moss);
  background: rgba(83,108,92,.065);
}
.page-settings-title { margin-bottom: 6px; }
.page-settings-title h2 { margin: 3px 0 2px; font: 500 20px var(--display); }
.page-settings-title p { margin: 0; color: var(--folio-ink-soft); font: 10px var(--utility); }
.page-settings > label {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(53,61,55,.12);
}
.page-settings b,
.page-settings small { display: block; }
.page-settings b { font: 500 14px var(--body); }
.page-settings small { margin-top: 3px; color: var(--folio-ink-soft); font: 9px var(--utility); }

.lock-preview {
  border-color: #4d3527;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), var(--folio-shadow-soft);
}
.lock-card {
  border: 1px solid rgba(255,255,255,.38);
  background: rgba(246,241,225,.82);
  box-shadow: 0 9px 25px rgba(20,20,16,.16);
}

body.dark {
  --folio-ink: #e5e2d8;
  --folio-ink-soft: #b9beb7;
  --folio-paper: #202723;
  --folio-paper-light: #29312c;
  --folio-hairline: rgba(230,227,215,.17);
}
body.dark .weather-main,
body.dark .weather-stats { color: #26362e; }
body.dark .paper-card,
body.dark .settings-list,
body.dark .calendar-card,
body.dark .family-upcoming-panel { background: rgba(35,44,39,.74); }
body.dark .more-sheet { color: #e9e4d8; background: #252d28; }
body.dark .more-sheet button { color: #e9e4d8; }
body.dark .settings-list select,
body.dark .settings-list input[type="text"] { color: #ece8dd; background: #303a34; }
body.dark .family-empty { color: rgba(229, 226, 216, .68); }

@media (min-width: 840px) {
  .weather-card::before { background: linear-gradient(90deg, transparent 0 37%, rgba(246,242,226,.74) 43%, rgba(246,242,226,.9) 100%); }
  .page-turn-left { left: max(3px, env(safe-area-inset-left)); }
  .page-turn-right { right: max(3px, env(safe-area-inset-right)); }
}

@media (min-width: 840px) and (max-aspect-ratio: 1 / 1) {
  .favorites {
    width: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
  .family-today-panel {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    min-height: 154px;
    margin-top: 16px;
  }
  .family-today-panel .section-heading > small { display: block; }
  .family-upcoming-body { min-height: clamp(230px, 30vh, 340px); }
}

/* v0.6.3 — 画面いっぱいの革手帳と、拡大して読む週間天気 */
:root {
  --weather-ink: #26352f;
  --weather-ink-soft: #68746d;
  --weather-sky: #9dc8cf;
  --weather-celadon: #789489;
  --weather-brass: #c0a15c;
  --weather-paper: #f3efdf;
}

.weather-card { cursor: pointer; isolation: isolate; }
.weather-card .weather-expand-hint {
  position: absolute;
  z-index: 4;
  right: 7px;
  bottom: 5px;
  padding: 3px 7px 2px;
  color: var(--weather-ink);
  border: 1px solid rgba(54,76,67,.2);
  background: rgba(247,243,228,.7);
  font: 7px var(--utility);
  letter-spacing: .08em;
}
.weather-card .weather-expand-hint::after { content: "  ↗"; font-size: 9px; }

.weather-forecast-dialog {
  width: min(930px, calc(100vw - 34px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: visible;
  color: var(--weather-ink);
  border: 0;
  background: transparent;
  transform-origin: 18% 16%;
  animation: weather-card-expand .34s cubic-bezier(.18,.78,.2,1) both;
}
.weather-forecast-dialog::backdrop {
  background: rgba(29,20,13,.58);
  backdrop-filter: blur(4px) saturate(.8);
}
@keyframes weather-card-expand {
  from { opacity: .2; transform: translate(-25vw,-24vh) scale(.34) rotate(-1.2deg); }
  to { opacity: 1; transform: none; }
}
.weather-forecast-paper {
  position: relative;
  padding: 27px 29px 19px;
  overflow: hidden;
  border: 1px solid rgba(72,69,50,.3);
  border-radius: 2px;
  background:
    linear-gradient(105deg, rgba(255,255,255,.32), transparent 30%, rgba(113,143,135,.07)),
    radial-gradient(circle at 17% 22%, rgba(104,118,99,.08) 0 1px, transparent 1.5px) 0 0 / 11px 11px,
    var(--weather-paper);
  box-shadow: 0 24px 60px rgba(21,14,9,.42), inset 0 0 22px rgba(90,70,43,.07);
}
.weather-dialog-tape {
  position: absolute;
  z-index: 3;
  width: 128px;
  height: 24px;
  top: -9px;
  left: calc(50% - 64px);
  background: rgba(198,178,126,.58);
  box-shadow: inset 0 0 8px rgba(111,86,48,.08);
  transform: rotate(-1.2deg);
}
.weather-forecast-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(53,73,64,.2); }
.weather-forecast-header h2 { margin: 3px 0 1px; font: 500 clamp(27px,3vw,38px)/1.1 var(--display); letter-spacing: .035em; }
.weather-forecast-header p { margin: 4px 0 0; color: var(--weather-ink-soft); font: 9px var(--utility); letter-spacing: .08em; }
.weather-forecast-header button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--weather-ink);
  border: 1px solid rgba(53,73,64,.22);
  border-radius: 50%;
  background: rgba(255,253,245,.42);
  transform: rotate(90deg);
}
.weather-forecast-header button svg { width: 20px; height: 20px; }
.weather-forecast-hero {
  min-height: 150px;
  display: grid;
  grid-template-columns: 180px minmax(150px,1fr) minmax(270px,1.15fr);
  align-items: center;
  gap: 19px;
  padding: 14px 10px 13px;
}
.weather-hero-art { position: relative; width: 160px; height: 105px; }
.weather-hero-art i { position: absolute; width: 67px; height: 67px; top: 4px; left: 18px; border-radius: 50%; background: var(--weather-brass); box-shadow: 0 0 0 12px rgba(192,161,92,.13); }
.weather-hero-art span { position: absolute; width: 104px; height: 30px; right: 5px; bottom: 15px; border-radius: 28px; background: #f1f0e6; box-shadow: 28px -20px 0 -2px #f1f0e6, 55px -8px 0 -7px #f1f0e6, 0 8px 14px rgba(64,83,75,.12); }
.weather-forecast-hero > div:nth-child(2) { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 9px; }
.weather-forecast-hero > div:nth-child(2) small { grid-column: 1 / -1; color: var(--weather-ink-soft); font: 9px var(--utility); letter-spacing: .18em; }
.weather-forecast-hero strong { font: 500 clamp(48px,7vw,76px)/.95 var(--utility); letter-spacing: -.07em; }
.weather-forecast-hero b { padding-bottom: 8px; font: 500 18px var(--display); }
.weather-forecast-hero dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; border-left: 1px solid rgba(54,75,66,.18); }
.weather-forecast-hero dl div { padding: 13px 16px; border-right: 1px solid rgba(54,75,66,.14); }
.weather-forecast-hero dt { color: var(--weather-ink-soft); font: 8px var(--utility); letter-spacing: .12em; }
.weather-forecast-hero dd { margin: 5px 0 0; font: 500 24px var(--utility); }
.weather-forecast-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border-top: 1px solid rgba(54,75,66,.2); border-bottom: 1px solid rgba(54,75,66,.2); }
.weather-forecast-day { min-width: 0; display: grid; justify-items: center; gap: 5px; padding: 13px 5px 11px; border-right: 1px solid rgba(54,75,66,.13); }
.weather-forecast-day:last-child { border-right: 0; }
.weather-forecast-day.is-today { background: rgba(120,148,137,.12); box-shadow: inset 0 3px var(--weather-celadon); }
.forecast-day-name { color: var(--weather-ink); font: 600 11px var(--utility); text-align: center; }
.forecast-day-name small { display: block; margin-top: 2px; color: var(--weather-ink-soft); font-size: 7px; }
.forecast-mark { position: relative; width: 46px; height: 37px; display: block; margin: 1px auto; }
.forecast-mark::before { content: ""; position: absolute; width: 24px; height: 24px; top: 0; left: 4px; border-radius: 50%; background: var(--weather-brass); box-shadow: 0 0 0 5px rgba(192,161,92,.12); }
.forecast-mark::after { content: ""; position: absolute; width: 30px; height: 12px; right: 2px; bottom: 3px; border-radius: 12px; background: #dce6df; box-shadow: 9px -8px 0 -1px #dce6df, -7px 1px 0 -2px #dce6df; }
.kind-sun::after { display: none; }
.kind-cloud::before, .kind-rain::before, .kind-snow::before, .kind-storm::before { width: 29px; height: 15px; top: 11px; left: 8px; border-radius: 15px; background: #aebeb8; box-shadow: 9px -8px 0 -1px #aebeb8, -7px 1px 0 -2px #aebeb8; }
.kind-cloud::after { display: none; }
.kind-rain::after, .kind-storm::after { width: 3px; height: 9px; right: 11px; bottom: 0; border-radius: 0; background: var(--weather-sky); box-shadow: -10px 2px var(--weather-sky), -20px 0 var(--weather-sky); transform: rotate(12deg); }
.kind-snow::after { width: 4px; height: 4px; right: 10px; bottom: 1px; border-radius: 50%; background: var(--weather-sky); box-shadow: -10px 2px var(--weather-sky), -20px 0 var(--weather-sky); }
.forecast-mark + b { overflow: hidden; max-width: 100%; color: var(--weather-ink); font: 500 11px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.forecast-temperature { display: flex; align-items: baseline; gap: 4px; font-family: var(--utility); }
.forecast-temperature strong { color: #a65f4b; font-size: 15px; }
.forecast-temperature small { color: #527991; font-size: 11px; }
.forecast-rain { color: #557a88; font: 8px var(--utility); }
.weather-forecast-paper footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; color: var(--weather-ink-soft); font: 7px var(--utility); letter-spacing: .08em; }

@media (min-width: 840px) {
  .home-view .book {
    padding: 1.4dvh 1.55vw 1.6dvh;
    grid-template-columns: minmax(0,1fr) .55vw minmax(0,1fr);
    background-image: var(--folio-book-background, url("media/folio-open-bg-ai-v062.png"));
  }
  .home-view .paper-page { padding: 12px 22px 14px; }
  .home-view .left-sticker-plant { top: 7%; height: 27%; }
  .home-view .left-page > .weather-card { border-color: rgba(55,80,69,.18); box-shadow: 0 7px 17px rgba(45,35,23,.17); transform: rotate(-.18deg); }
  .home-view .left-page > .weather-card::after {
    content: "";
    position: absolute;
    z-index: 5;
    width: 70px;
    height: 14px;
    top: -7px;
    left: 43%;
    background: rgba(202,182,132,.48);
    transform: rotate(1.5deg);
  }
}

/* v0.6.3 最終上書き — 旧レイアウトより後で指定画像の寸法を確定 */
@media (min-width: 840px) {
  .home-view .book {
    padding: 1.4dvh 1.55vw 1.6dvh;
    grid-template-columns: minmax(0,1fr) .55vw minmax(0,1fr);
    background-image: var(--folio-book-background, url("media/folio-open-bg-ai-v062.png"));
    background-size: 100% 100%;
  }
  .home-view .paper-page { padding: 12px 22px 14px; }
  .home-view .left-sticker-plant { top: 7%; height: 27%; }
  .home-view .left-page > .weather-card {
    border-color: rgba(55,80,69,.18);
    box-shadow: 0 7px 17px rgba(45,35,23,.17);
    transform: rotate(-.18deg);
  }
  .home-view .left-page > .weather-card::after {
    content: "";
    position: absolute;
    z-index: 5;
    width: 70px;
    height: 14px;
    top: -7px;
    left: 43%;
    background: rgba(202,182,132,.48);
    transform: rotate(1.5deg);
  }
}

@media (min-width: 840px) and (max-aspect-ratio: 1 / 1) {
  .home-view .book {
    padding: 1.4dvh 1.5vw 1.7dvh;
    grid-template-columns: minmax(0,1fr) .7vw minmax(0,1fr);
    background-size: 100% 100%;
  }
  .home-view .paper-page { padding-right: 14px; padding-left: 14px; }
}

/* v0.6.5 最終確定 — 後段の実写手帳指定よりも優先 */
@media (min-width: 840px) {
  .home-view .left-page > .favorites,
  body[data-app-size="standard"] .home-view .left-page > .favorites,
  body[data-app-size="large"] .home-view .left-page > .favorites,
  body[data-app-size="xlarge"] .home-view .left-page > .favorites {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid !important;
    grid-template-columns: repeat(5,minmax(0,1fr)) !important;
    grid-template-rows: repeat(2,minmax(0,1fr));
    gap: 5px 8px;
    padding: 21px 7px 4px;
    overflow: hidden;
  }
  .home-view .left-page > .favorites button { width: 100% !important; min-width: 0; }
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile {
    width: clamp(30px,3.1vw,43px) !important;
    height: clamp(30px,3.1vw,43px) !important;
  }
}

/* v0.6.4 — 半透明の和紙を差し込むスワイプ目次 */
.contents-backdrop {
  position: fixed;
  z-index: 680;
  inset: 0;
  border: 0;
  background: rgba(29, 20, 13, .32);
  -webkit-backdrop-filter: blur(2px) saturate(.82);
  backdrop-filter: blur(2px) saturate(.82);
  animation: contents-backdrop-in .24s ease-out both;
}
.contents-backdrop[hidden] { display: none !important; }

.more-sheet {
  --index-paper: rgba(246, 239, 219, .88);
  --index-line: rgba(74, 67, 50, .18);
  position: fixed;
  z-index: 700;
  inset: 50% 9vw auto auto;
  width: min(78vw, 980px);
  height: min(68dvh, 760px);
  max-height: none;
  padding: clamp(20px, 2.4vw, 34px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: auto repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden auto;
  transform: none;
  transform-origin: right center;
  border: 1px solid rgba(72, 57, 35, .38);
  border-radius: 2px 5px 4px 2px;
  color: #30352f;
  background:
    linear-gradient(100deg, rgba(255,255,255,.34), transparent 14%, transparent 82%, rgba(88,61,36,.08)),
    radial-gradient(circle at 18% 27%, rgba(77,66,47,.055) 0 1px, transparent 1.5px) 0 0 / 10px 10px,
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(74,69,56,.038) 31px 32px),
    var(--index-paper);
  box-shadow: -18px 22px 58px rgba(29, 19, 11, .32), inset 18px 0 26px rgba(255,255,255,.24);
  -webkit-backdrop-filter: blur(10px) saturate(.76);
  backdrop-filter: blur(10px) saturate(.76);
  clip-path: polygon(.35% .5%, 99.4% 0, 100% 99.1%, .6% 100%, 0 56%);
}
.more-sheet:focus { outline: none; }
.more-sheet[data-origin="right"] { animation: contents-paper-from-right .46s cubic-bezier(.2,.78,.22,1) both; }
.more-sheet[data-origin="left"] {
  right: auto;
  left: 9vw;
  transform-origin: left center;
  box-shadow: 18px 22px 58px rgba(29, 19, 11, .32), inset -18px 0 26px rgba(255,255,255,.24);
  animation: contents-paper-from-left .46s cubic-bezier(.2,.78,.22,1) both;
}
.more-sheet::before,
.more-sheet::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 88px;
  height: 18px;
  pointer-events: none;
  background: rgba(198, 174, 119, .48);
  box-shadow: inset 0 0 7px rgba(112,83,45,.1);
}
.more-sheet::before { top: -5px; left: 15%; transform: rotate(-1.8deg); }
.more-sheet::after { right: 9%; bottom: -5px; transform: rotate(1.2deg); }

.contents-heading {
  position: relative;
  z-index: 3;
  grid-column: 1 / -1;
  min-height: 84px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: end;
  gap: 3px 16px;
  padding: 3px 8px 20px;
  border-bottom: 1px solid rgba(62,68,60,.28);
}
.contents-heading small { grid-column: 1 / -1; color: #8d5a3f; font-size: 9px; letter-spacing: .24em; }
.contents-heading b { font-size: clamp(28px, 3vw, 42px); font-weight: 400; letter-spacing: .08em; }
.contents-heading span { align-self: end; padding: 0 0 7px; font-size: 11px; letter-spacing: .08em; }
.contents-heading .contents-close {
  width: 42px;
  min-height: 42px;
  align-self: center;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(59,68,59,.25);
  border-radius: 50%;
  background: rgba(255,252,242,.34);
}
.contents-heading .contents-close svg { width: 18px; height: 18px; }

.more-sheet > button[data-nav] {
  position: relative;
  z-index: 1;
  min-height: 106px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  place-items: center start;
  gap: 13px;
  padding: 18px clamp(10px, 1.5vw, 22px);
  border: 0;
  border-right: 1px solid var(--index-line);
  border-bottom: 1px solid var(--index-line);
  color: #30352f;
  background: rgba(255,253,246,.12);
  transition: background-color .18s ease, transform .18s ease;
}
.more-sheet > button[data-nav]:nth-of-type(4n) { border-right: 0; }
.more-sheet > button[data-nav]:nth-last-of-type(-n+4) { border-bottom: 0; }
.more-sheet > button[data-nav]::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color .18s ease;
}
.more-sheet > button[data-nav]:active { transform: scale(.985); background: rgba(80,105,88,.13); }
.more-sheet > button[data-nav]:focus-visible { outline: 2px solid #7a5943; outline-offset: -5px; }
.more-sheet > button[data-nav]:focus-visible::after { border-color: rgba(122,89,67,.32); }
.more-sheet > button[data-nav] svg { width: 28px; height: 28px; color: #526b5a; stroke-width: 1.25; }
.more-sheet > button[data-nav] span { font: 500 clamp(13px, 1.35vw, 18px) var(--display); letter-spacing: .06em; }

.page-turn-tab { min-height: 86px; }
.page-turn-tab b { max-height: 68px; font-size: 11px; }

@keyframes contents-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes contents-paper-from-right {
  from { opacity: 0; transform: translate(18%, -50%) rotateY(-5deg); filter: blur(2px); }
  to { opacity: 1; transform: translate(0, -50%) rotateY(0); filter: blur(0); }
}
@keyframes contents-paper-from-left {
  from { opacity: 0; transform: translate(-18%, -50%) rotateY(5deg); filter: blur(2px); }
  to { opacity: 1; transform: translate(0, -50%) rotateY(0); filter: blur(0); }
}

body.dark .more-sheet,
body.dark .more-sheet > button[data-nav] { color: #30352f; }
body.dark .more-sheet {
  background:
    linear-gradient(100deg, rgba(255,255,255,.34), transparent 14%, transparent 82%, rgba(88,61,36,.08)),
    radial-gradient(circle at 18% 27%, rgba(77,66,47,.055) 0 1px, transparent 1.5px) 0 0 / 10px 10px,
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(74,69,56,.038) 31px 32px),
    var(--index-paper);
}

@media (max-width: 839px) {
  .folio-menu-trigger { display: none !important; }
  .more-sheet,
  .more-sheet[data-origin="left"] {
    inset: max(9px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    width: auto;
    height: auto;
    max-height: none;
    padding: 17px 14px 14px;
    grid-template-columns: repeat(2, minmax(0,1fr));
    grid-template-rows: auto repeat(4, minmax(60px,1fr));
    border-radius: 3px;
    box-shadow: 0 18px 48px rgba(29,19,11,.38);
  }
  .contents-heading { min-height: 70px; padding: 0 5px 12px; gap: 1px 8px; }
  .contents-heading small { font-size: 7px; }
  .contents-heading b { font-size: 25px; }
  .contents-heading span { padding-bottom: 3px; font-size: 8px; }
  .contents-heading .contents-close { width: 36px; min-height: 36px; }
  .more-sheet > button[data-nav] {
    min-height: 60px;
    grid-template-columns: 25px minmax(0,1fr);
    gap: 8px;
    padding: 8px 11px;
  }
  .more-sheet > button[data-nav]:nth-of-type(4n) { border-right: 1px solid var(--index-line); }
  .more-sheet > button[data-nav]:nth-of-type(2n) { border-right: 0; }
  .more-sheet > button[data-nav]:nth-last-of-type(-n+4) { border-bottom: 1px solid var(--index-line); }
  .more-sheet > button[data-nav]:nth-last-of-type(-n+2) { border-bottom: 0; }
  .more-sheet > button[data-nav] svg { width: 22px; height: 22px; }
  .more-sheet > button[data-nav] span { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .contents-backdrop,
  .more-sheet[data-origin] { animation: none; }
  .more-sheet > button[data-nav] { transition: none; }
}

/* v0.6.5 — 10個のアプリ面、家族予定台帳、保存できるメモ帳 */
.detail-view.is-active {
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail-view .detail-paper { min-height: 100%; padding-bottom: max(46px, calc(28px + env(safe-area-inset-bottom))); }

/* 左ページとカバー画面で同じ、横5×縦2のアプリ配置 */
.home-view .left-page > .favorites,
body[data-app-size="standard"] .home-view .left-page > .favorites,
body[data-app-size="large"] .home-view .left-page > .favorites,
body[data-app-size="xlarge"] .home-view .left-page > .favorites {
  width: 100%;
  min-height: 0;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-content: stretch;
  justify-content: stretch;
  gap: 5px 8px;
  padding: 21px 7px 4px;
  overflow: hidden;
}
.home-view .left-page > .favorites button {
  width: 100% !important;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
}
.home-view .left-page > .favorites .app-tile,
body[data-app-size="standard"] .home-view .left-page > .favorites .app-tile,
body[data-app-size="large"] .home-view .left-page > .favorites .app-tile,
body[data-app-size="xlarge"] .home-view .left-page > .favorites .app-tile {
  width: clamp(30px, 3.1vw, 43px) !important;
  height: clamp(30px, 3.1vw, 43px) !important;
}
.home-view .left-page > .favorites small { max-width: 100%; font-size: clamp(6px, .65vw, 8px); }

/* 右ページ：予定とアプリ面を、手帳の小さな切替札で交換 */
.right-page-mode-switch {
  position: absolute;
  z-index: 24;
  top: 12px;
  right: 79px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  padding: 2px;
  border: 1px solid rgba(63,65,54,.22);
  background: rgba(247,240,220,.72);
  box-shadow: 0 3px 9px rgba(55,40,25,.1);
}
.right-page-mode-switch button {
  min-width: 48px;
  padding: 6px 9px;
  color: var(--folio-ink-soft);
  border: 0;
  background: transparent;
  font: 10px var(--display);
}
.right-page-mode-switch button.is-active { color: #fffaf0; background: var(--folio-moss); }
.right-apps-panel {
  position: absolute;
  inset: 58px 20px 18px;
  z-index: 16;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  gap: 10px;
  padding: 18px 19px;
  border: 1px solid rgba(66,66,54,.18);
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(66,73,62,.05) 31px 32px),
    rgba(249,244,229,.78);
  box-shadow: 0 8px 22px rgba(49,38,25,.11);
  backdrop-filter: blur(2px);
}
.right-apps-panel[hidden] { display: none !important; }
.right-apps-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; padding-bottom: 10px; border-bottom: 1px solid rgba(64,70,60,.2); }
.right-apps-heading .eyebrow { grid-column: 1 / -1; }
.right-apps-heading h2 { margin: 3px 0 0; font: 500 23px var(--display); }
.right-apps-heading button { padding: 6px 10px; border: 1px solid rgba(63,79,66,.23); color: var(--folio-moss); background: rgba(255,252,242,.4); font: 9px var(--utility); }
.right-apps-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--app-cols, 4), minmax(0,1fr));
  grid-template-rows: repeat(var(--app-rows, 4), minmax(0,1fr));
  gap: clamp(5px, 1vw, 12px);
}
.right-apps-grid button { min-width: 0; display: grid; place-items: center; align-content: center; gap: 6px; padding: 4px; border: 0; color: var(--folio-ink); background: rgba(255,252,242,.18); }
.right-apps-grid .app-tile { width: clamp(34px, 4vw, 57px) !important; height: clamp(34px, 4vw, 57px) !important; }
.right-apps-grid button > span:last-child { overflow: hidden; max-width: 100%; font: 9px var(--body); text-overflow: ellipsis; white-space: nowrap; }
.right-apps-grid .right-app-empty { color: var(--folio-ink-soft); border: 1px dashed rgba(67,76,66,.17); }
.right-apps-grid .right-app-empty > span { font: 300 25px var(--utility); }
.right-apps-grid .right-app-empty small { font: 7px var(--utility); }

/* お気に入り図書室：登録と左右への割り当てを分ける */
.favorite-shelf-grid { grid-template-columns: 1fr; max-height: min(58dvh, 650px); overflow-y: auto; }
.favorite-assignment {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 2px;
  border-bottom: 1px solid rgba(66,73,65,.15);
}
.favorite-assignment .app-tile { width: 40px !important; height: 40px !important; }
.favorite-assignment b,
.favorite-assignment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-assignment b { font: 500 12px var(--body); }
.favorite-assignment small { margin-top: 2px; color: var(--folio-ink-soft); font: 7px var(--utility); }
.favorite-assignment > div { display: flex; gap: 4px; }
.favorite-assignment > div button { min-width: 34px; padding: 7px 5px; color: var(--folio-ink-soft); border: 1px solid rgba(62,75,65,.22); background: rgba(255,253,245,.34); font: 9px var(--display); }
.favorite-assignment > div button.is-active { color: #fffaf0; border-color: var(--folio-moss); background: var(--folio-moss); }
.right-grid-settings { display: flex; align-items: center; gap: 8px; margin-top: 15px; padding-top: 12px; border-top: 1px solid rgba(65,73,64,.15); font: 10px var(--body); }
.right-grid-settings > span { margin-right: auto; }
.right-grid-settings label { display: flex; align-items: center; gap: 4px; }
.right-grid-settings select { min-width: 50px; padding: 6px; border: 1px solid rgba(63,76,66,.22); background: rgba(255,253,245,.55); font: 10px var(--utility); }

/* 家族の予定：本日を横長に、期間一覧を日付単位で読む */
.family-journal-paper { display: flex; flex-direction: column; }
.family-today-detail,
.family-ledger { padding: 15px 18px; border: 1px solid rgba(66,72,62,.16); background: rgba(250,246,234,.63); }
.family-today-detail { margin-top: 16px; }
#familyTodayDetail { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; border-top: 1px solid rgba(65,73,63,.15); }
.family-person-today { min-width: 0; padding: 12px 11px; border-right: 1px solid rgba(65,73,63,.15); }
.family-person-today:last-child { border-right: 0; }
.family-person-today > div { display: grid; gap: 5px; margin-top: 8px; }
.family-person-today button { min-width: 0; display: grid; grid-template-columns: 43px minmax(0,1fr); gap: 6px; padding: 7px 2px; border: 0; border-bottom: 1px solid rgba(68,75,65,.11); color: var(--folio-ink); background: transparent; text-align: left; }
.family-person-today time { color: var(--folio-ink-soft); font: 9px var(--utility); }
.family-person-today b { overflow: hidden; font: 500 11px var(--body); text-overflow: ellipsis; white-space: nowrap; }
.family-ledger { min-height: 0; margin-top: 14px; display: flex; flex: 1; flex-direction: column; }
.family-ledger-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.family-view-switch { display: flex; border-bottom: 1px solid rgba(61,70,60,.22); }
.family-view-switch button { min-width: 104px; padding: 9px 12px; border: 0; color: var(--folio-ink-soft); background: transparent; font: 11px var(--display); }
.family-view-switch button.is-active { color: var(--folio-moss); box-shadow: inset 0 -3px var(--folio-moss); }
.family-ledger-toolbar label { display: flex; align-items: center; gap: 7px; color: var(--folio-ink-soft); font: 9px var(--utility); }
.family-ledger-toolbar select { min-width: 88px; padding: 7px 9px; border: 1px solid rgba(61,73,63,.23); background: rgba(255,253,245,.58); font: 10px var(--body); }
.family-ledger-heading { display: flex; align-items: baseline; gap: 10px; margin-top: 13px; padding: 0 4px 8px; border-bottom: 1px solid rgba(65,73,63,.18); }
.family-ledger-heading span { font: 500 19px var(--display); }
.family-ledger-heading small { color: var(--folio-ink-soft); font: 8px var(--utility); }
.family-ledger-list { min-height: 160px; max-height: calc(100dvh - 380px); overflow-y: auto; padding-right: 5px; scrollbar-color: rgba(73,88,75,.36) transparent; }
.family-date-group { display: grid; grid-template-columns: 116px minmax(0,1fr); border-bottom: 1px solid rgba(65,73,63,.16); }
.family-date-label { padding: 12px 8px; border-right: 1px solid rgba(65,73,63,.13); }
.family-date-label time { display: block; font: 500 12px var(--display); }
.family-date-label span { color: var(--folio-ink-soft); font: 8px var(--utility); }
.family-ledger-row { min-width: 0; display: grid; grid-template-columns: 58px 48px minmax(0,1fr) 30px; align-items: center; gap: 7px; padding: 10px 9px; border: 0; border-bottom: 1px solid rgba(65,73,63,.1); color: var(--folio-ink); background: transparent; text-align: left; }
.family-ledger-row:last-child { border-bottom: 0; }
.family-ledger-row time,
.family-ledger-row small { color: var(--folio-ink-soft); font: 8px var(--utility); }
.family-ledger-row b { overflow: hidden; font: 500 12px var(--body); text-overflow: ellipsis; white-space: nowrap; }

/* メモ帳：履歴・編集・大きな貼り写真の三面構成 */
.memo-studio { display: grid; grid-template-columns: minmax(180px,.55fr) minmax(390px,1.35fr) minmax(240px,.8fr); gap: 15px; align-items: start; margin-top: 16px; }
.memo-archive,
.memo-workspace > section { border: 1px solid rgba(65,72,63,.16); background: rgba(250,246,234,.64); }
.memo-archive { position: sticky; top: 10px; padding: 14px; }
.memo-history-tabs { display: grid; grid-template-columns: repeat(2,1fr); margin: 9px 0; border-bottom: 1px solid rgba(65,73,63,.17); }
.memo-history-tabs button { padding: 8px 4px; border: 0; color: var(--folio-ink-soft); background: transparent; font: 10px var(--display); }
.memo-history-tabs button.is-active { color: var(--folio-moss); box-shadow: inset 0 -2px var(--folio-moss); }
.memo-history-list { max-height: calc(100dvh - 230px); overflow-y: auto; }
.memo-history-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border-bottom: 1px solid rgba(65,73,63,.13); }
.memo-history-item > button:first-child { min-width: 0; display: block; padding: 10px 4px; border: 0; color: var(--folio-ink); background: transparent; text-align: left; }
.memo-history-item b,
.memo-history-item time { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-history-item b { font: 500 10px var(--body); }
.memo-history-item time { margin-top: 3px; color: var(--folio-ink-soft); font: 7px var(--utility); }
.memo-history-delete { padding: 5px; border: 0; color: #9a493b; background: transparent; font: 7px var(--utility); }
.memo-workspace { display: grid; gap: 14px; }
.memo-workspace .text-memo,
.memo-workspace .drawing-memo { padding: 14px; }
.memo-heading-actions { display: flex; gap: 6px; }
.memo-save-button { padding: 7px 11px; color: #fffaf0; border: 0; background: var(--folio-moss); font: 9px var(--display); }
.memo-type-controls { display: flex; align-items: center; gap: 4px; margin: 7px 0 5px; }
.memo-type-controls span { margin: 0 3px 0 7px; color: var(--folio-ink-soft); font: 7px var(--utility); }
.memo-type-controls span:first-child { margin-left: 0; }
.memo-type-controls button { min-width: 28px; padding: 5px 4px; border: 1px solid rgba(62,74,64,.19); color: var(--folio-ink-soft); background: rgba(255,253,245,.35); font: 8px var(--display); }
.memo-type-controls button.is-active { color: #fffaf0; background: var(--folio-moss); }
.memo-workspace .text-memo textarea { width: 100%; height: 300px; }
#textMemo[data-size="small"] { font-size: 14px; }
#textMemo[data-size="medium"] { font-size: 18px; }
#textMemo[data-size="large"] { font-size: 24px; }
#textMemo[data-spacing="compact"] { line-height: 1.35; background-size: 100% 1.35em; }
#textMemo[data-spacing="normal"] { line-height: 1.72; background-size: 100% 1.72em; }
#textMemo[data-spacing="wide"] { line-height: 2.12; background-size: 100% 2.12em; }
.memo-workspace .drawing-memo { min-height: 330px; }
.memo-workspace #drawingCanvas { height: 260px; }
.memo-photo {
  position: sticky;
  top: 10px;
  width: 100%;
  min-height: min(64dvh, 600px);
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  padding: 10px 10px 28px;
  border: 1px solid rgba(77,61,41,.22);
  color: var(--folio-ink-soft);
  background: #f5edde;
  box-shadow: 0 10px 24px rgba(48,35,23,.15);
  transform: rotate(.35deg);
}
.memo-photo img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; background: #d9d1c3; }
.memo-photo span { padding-top: 10px; font: 10px var(--display); }

/* 半透明目次は10項目を見開きで5×2にする */
.more-sheet { grid-template-columns: repeat(5, minmax(0,1fr)); }
.more-sheet > button[data-portal] {
  position: relative;
  z-index: 1;
  min-height: 106px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  place-items: center start;
  gap: 11px;
  padding: 18px clamp(8px,1.2vw,18px);
  border: 0;
  border-right: 1px solid var(--index-line);
  border-bottom: 1px solid var(--index-line);
  color: #30352f;
  background: rgba(255,253,246,.12);
}
.more-sheet > button[data-portal] svg { width: 27px; height: 27px; color: #526b5a; stroke-width: 1.25; }
.more-sheet > button[data-portal] span { font: 500 clamp(11px,1.05vw,15px) var(--display); letter-spacing: .03em; }
.more-sheet > button:is([data-nav],[data-portal]) { border-right: 1px solid var(--index-line); border-bottom: 1px solid var(--index-line); }
.more-sheet > button:is([data-nav],[data-portal]):nth-of-type(5n) { border-right: 0; }
.more-sheet > button:is([data-nav],[data-portal]):nth-last-of-type(-n+5) { border-bottom: 0; }
body.dark .more-sheet > button[data-portal] { color: #30352f; }

@media (max-width: 839px) {
  .home-view .left-page > .favorites,
  body[data-app-size] .home-view .left-page > .favorites {
    min-height: 126px;
    grid-template-columns: repeat(5, minmax(0,1fr)) !important;
    grid-template-rows: repeat(2, minmax(48px,1fr));
    gap: 3px 5px;
    padding: 19px 4px 2px;
    overflow: hidden;
  }
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile { width: 35px !important; height: 35px !important; }
  .home-view .left-page > .favorites small { font-size: 6px; }
  .right-page-mode-switch { display: none; }
  .memo-studio { grid-template-columns: 1fr; }
  .memo-archive,
  .memo-photo { position: relative; top: auto; }
  .memo-history-list { max-height: 240px; }
  .memo-photo { min-height: 470px; }
  .memo-photo img { min-height: 390px; }
  #familyTodayDetail { grid-template-columns: 1fr 1fr; }
  .family-person-today:nth-child(2) { border-right: 0; }
  .family-person-today:nth-child(-n+2) { border-bottom: 1px solid rgba(65,73,63,.15); }
  .family-ledger-toolbar { align-items: stretch; flex-direction: column; }
  .family-view-switch button { flex: 1; min-width: 0; }
  .family-ledger-list { max-height: 58dvh; }
  .family-date-group { grid-template-columns: 82px minmax(0,1fr); }
  .family-ledger-row { grid-template-columns: 49px 42px minmax(0,1fr); }
  .family-ledger-row small { display: none; }
  .favorite-library-layout { align-items: start; }
  .favorite-shelf-grid { max-height: none; }
  .more-sheet { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: auto repeat(5,minmax(54px,1fr)); }
  .more-sheet > button[data-portal] { min-height: 54px; grid-template-columns: 24px minmax(0,1fr); gap: 7px; padding: 7px 10px; }
  .more-sheet > button[data-portal] svg { width: 21px; height: 21px; }
  .more-sheet > button[data-portal] span { font-size: 11px; }
  .more-sheet > button:is([data-nav],[data-portal]):nth-of-type(5n) { border-right: 1px solid var(--index-line); }
  .more-sheet > button:is([data-nav],[data-portal]):nth-of-type(2n) { border-right: 0; }
  .more-sheet > button:is([data-nav],[data-portal]):nth-last-of-type(-n+5) { border-bottom: 1px solid var(--index-line); }
  .more-sheet > button:is([data-nav],[data-portal]):nth-last-of-type(-n+2) { border-bottom: 0; }
}

@media (max-width: 390px) {
  .home-view .left-page > .favorites,
  body[data-app-size] .home-view .left-page > .favorites { min-height: 116px; }
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile { width: 31px !important; height: 31px !important; }
  .memo-workspace .text-memo textarea { height: 240px; }
  .memo-type-controls { flex-wrap: wrap; }
  .family-today-detail,
  .family-ledger { padding: 12px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .right-page-mode-switch button,
  .favorite-assignment button { transition: none; }
}

@media (min-width: 840px) and (max-aspect-ratio: 1 / 1) {
  .home-view .book {
    padding: 1.4dvh 1.5vw 1.7dvh;
    grid-template-columns: minmax(0,1fr) .7vw minmax(0,1fr);
    background-size: 100% 100%;
  }
  .home-view .paper-page { padding-right: 14px; padding-left: 14px; }
}

@media (max-width: 839px) {
  .weather-card .weather-expand-hint { right: 4px; bottom: 3px; font-size: 6px; }
  .weather-forecast-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .weather-forecast-paper { max-height: calc(100dvh - 12px); padding: 21px 13px 14px; overflow-y: auto; }
  .weather-forecast-header h2 { font-size: 27px; }
  .weather-forecast-header button { width: 37px; height: 37px; }
  .weather-forecast-hero { min-height: 124px; grid-template-columns: 88px minmax(90px,1fr) minmax(130px,1.2fr); gap: 6px; padding: 10px 1px; }
  .weather-hero-art { width: 82px; height: 70px; transform: scale(.7); transform-origin: left center; }
  .weather-forecast-hero strong { font-size: 45px; }
  .weather-forecast-hero b { font-size: 13px; }
  .weather-forecast-hero dl div { padding: 9px 7px; }
  .weather-forecast-hero dd { font-size: 17px; }
  .weather-forecast-days { grid-template-columns: repeat(7,76px); overflow-x: auto; scrollbar-width: none; }
  .weather-forecast-days::-webkit-scrollbar { display: none; }
  .weather-forecast-day { padding-right: 3px; padding-left: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .weather-forecast-dialog { animation: none; }
}

@media (max-width: 839px) {
  .weather-card::before { background: linear-gradient(90deg, transparent 0 37%, rgba(246,242,226,.8) 44%, rgba(246,242,226,.94) 100%); }
  .folio-menu-trigger {
    width: 55px;
    min-height: 43px;
    top: max(6px, env(safe-area-inset-top));
    right: max(5px, env(safe-area-inset-right));
  }
  .page-turn-tab { top: auto; bottom: calc(78px + env(safe-area-inset-bottom)); width: 27px; min-height: 79px; transform: none; }
  .page-turn-tab span { display: none; }
  .page-turn-tab b { max-height: 57px; font-size: 9px; }
  .more-sheet {
    top: auto;
    right: max(7px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(7px, env(safe-area-inset-left));
    width: auto;
    padding: 13px;
    border-radius: 10px 10px 3px 3px;
  }
  .more-sheet button { min-height: 65px; }
  .contents-heading { padding-bottom: 10px; }
  .contents-heading b { font-size: 22px; }
  .detail-paper { padding-left: 12px; padding-right: 12px; }
  .page-settings { padding-left: 12px; padding-right: 12px; }
  .page-settings > label { align-items: flex-start; flex-direction: column; gap: 7px; padding: 9px 0; }
  .page-settings select { width: 100%; }
}

@media (max-width: 390px) {
  .folio-menu-trigger { width: 52px; }
  .more-sheet { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .more-sheet button { min-height: 60px; }
  .more-sheet svg { width: 19px; height: 19px; }
  .page-turn-tab { width: 25px; }
}

.music-player {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid rgba(45, 61, 52, .28);
  color: #f8f2e3;
  background:
    radial-gradient(circle at 9% 24%, rgba(255,255,255,.08) 0 1px, transparent 1.4px) 0 0 / 8px 8px,
    linear-gradient(105deg, #273a31, #445e4f 58%, #31453a);
  box-shadow: 0 6px 15px rgba(39, 39, 29, .15);
}
.music-art {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,248,228,.38);
  border-radius: 50%;
  color: #273a31;
  background:
    radial-gradient(circle, #ead6a3 0 13%, #bda66c 14% 17%, #283c32 18% 48%, #d6c18e 49% 52%, #26382f 53%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.04), 0 4px 10px rgba(12,18,14,.2);
}
.music-art svg { width: 17px; height: 17px; stroke-width: 1.5; }
.music-copy { min-width: 0; }
.music-copy small,
.music-copy strong,
.music-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-copy small { color: #d6c18e; font: 600 7px var(--utility); letter-spacing: .2em; }
.music-copy strong { margin-top: 2px; font: 500 16px var(--display); letter-spacing: .03em; }
.music-copy span { margin-top: 2px; color: rgba(248,242,227,.68); font: 8px var(--utility); }
.music-controls { display: flex; align-items: center; gap: 7px; }
.music-controls button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,248,228,.24);
  border-radius: 50%;
  color: #f8f2e3;
  background: rgba(255,255,255,.045);
}
.music-controls button:active { transform: scale(.94); background: rgba(255,255,255,.12); }
.music-controls svg { width: 15px; height: 15px; stroke-width: 1.6; }
.music-controls .music-play {
  width: 42px;
  height: 42px;
  color: #2e4036;
  border-color: #e6d5aa;
  background: #e6d5aa;
}

/* 左ページは 天気 → 音楽 → 今日の予定 → みんなの今日 → お気に入り の順で組む */
.left-page > .music-player { margin-top: 12px; }
.left-page > .today-card { margin-top: 12px; }
.left-page > .family-today-panel { margin-top: 12px; }
.left-page > .favorites { margin-top: 14px; }

@media (min-width: 840px) {
  .left-page > .today-card {
    width: 100%;
    min-height: 145px;
  }
  .left-page > .family-today-panel {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    min-height: 130px;
    padding: 5px 10px 7px;
  }
  .left-page > .family-today-panel .section-heading {
    min-height: 27px;
  }
  .left-page > .family-today-panel .section-heading > span {
    font-size: 18px;
  }
  .left-page > .family-today-panel .section-heading > small {
    display: block;
    font-size: 8px;
  }
  .left-page > .family-today-panel .family-schedule-row {
    grid-template-columns: 49px 45px minmax(0, 1fr);
    gap: 7px;
    min-height: 19px !important;
  }
  .left-page > .family-today-panel .family-schedule-row button {
    font-size: 12px;
  }
  .left-page > .favorites {
    width: 100%;
    min-height: 88px;
    justify-content: start;
    align-content: start;
    padding: 22px 10px 0;
    column-gap: 16px;
    row-gap: 12px;
  }
  body[data-app-size="standard"] .left-page > .favorites {
    grid-template-columns: repeat(7, 50px) !important;
  }
  body[data-app-size="large"] .left-page > .favorites {
    grid-template-columns: repeat(6, 60px) !important;
  }
  body[data-app-size="xlarge"] .left-page > .favorites {
    grid-template-columns: repeat(6, 68px) !important;
  }
  .left-page > .favorites button {
    width: 100%;
  }
}

@media (max-width: 839px) {
  .page-turn-tab { display: none !important; }
  .left-page > .music-player,
  .left-page > .today-card,
  .left-page > .family-today-panel,
  .left-page > .favorites { margin-top: 8px; }
  .left-page > .favorites { gap: 8px 13px; }
  .music-player {
    min-height: 66px;
    grid-template-columns: 46px minmax(0,1fr) auto;
    gap: 8px;
    padding: 7px 9px;
  }
  .music-art { width: 42px; height: 42px; }
  .music-copy strong { font-size: 14px; }
  .music-controls { gap: 5px; }
  .music-controls button { width: 31px; height: 31px; }
  .music-controls .music-play { width: 38px; height: 38px; }
}

@media (min-width: 840px) and (max-aspect-ratio: 1 / 1) {
  .left-sticker-plant {
    width: 110px;
    height: 120px;
  }
  .left-page > .weather-card { width: calc(100% - 124px); }
  .left-page > .music-player {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding-right: 10px;
  }
  .left-page > .music-player .music-art {
    width: 42px;
    height: 42px;
  }
  .left-page > .favorites {
    min-height: 190px;
    column-gap: 14px;
    row-gap: 10px;
  }
  body[data-app-size="standard"] .left-page > .favorites {
    grid-template-columns: repeat(5, 50px) !important;
  }
  body[data-app-size="large"] .left-page > .favorites,
  body[data-app-size="xlarge"] .left-page > .favorites {
    grid-template-columns: repeat(4, 66px) !important;
  }
}

@media (max-width: 390px) {
  .music-player {
    grid-template-columns: 40px minmax(0,1fr) auto;
    gap: 6px;
    padding-left: 7px;
    padding-right: 7px;
  }
  .music-art { width: 38px; height: 38px; }
  .music-copy strong { font-size: 13px; }
  .music-copy span { max-width: 112px; }
  .music-controls { gap: 3px; }
  .music-controls button { width: 29px; height: 29px; }
  .music-controls .music-play { width: 35px; height: 35px; }
}

@media (orientation: landscape) and (max-height: 540px) {
  .home-view { min-height: 100dvh; overflow: hidden; }
  .book {
    display: block !important;
    width: 100%;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0;
    padding: 2px;
    border-radius: 0;
  }
  .paper-page {
    height: calc(100dvh - 4px) !important;
    min-height: 0 !important;
    padding: 6px 8px 8px;
    border-radius: 2px;
  }
  .right-page,
  .book-spine,
  .cover-masthead,
  .left-sticker-plant,
  .cover-scraps { display: none !important; }
  .weather-card {
    width: 55%;
    height: 84px;
    grid-template-columns: 39% 31% 30%;
  }
  .weather-main { padding: 5px 7px; }
  .weather-main strong { font-size: 34px; }
  .weather-main .eyebrow { font-size: 7px; }
  .weather-main > span:last-child { font-size: 10px; }
  .weather-stats { padding: 5px 7px; gap: 2px; font-size: 9px; }
  .weather-stats small { font-size: 6px; }
  .today-card {
    width: 55%;
    min-height: 105px;
    margin-top: 7px;
    padding: 3px 8px 5px;
  }
  .today-card .section-heading { min-height: 25px; }
  .today-card .section-heading > span { font-size: 17px; }
  .task-row { min-height: 25px; }
  .favorites {
    position: absolute;
    right: 8px;
    bottom: 9px;
    width: 41%;
    min-height: 65px;
    margin: 0;
    padding-top: 18px;
    grid-template-columns: repeat(6, minmax(0,1fr)) !important;
  }
  .favorites::before { font-size: 11px; }
  .favorites .app-tile { width: 38px !important; height: 38px !important; }
  .favorites small { font-size: 7px; }
  .family-today-panel {
    position: absolute;
    top: 6px;
    right: 8px;
    bottom: auto;
    width: 41%;
    min-height: 205px;
    margin: 0;
    padding: 3px 7px;
  }
  .family-today-panel .section-heading { min-height: 24px; }
  .family-today-panel .section-heading > span { font-size: 15px; }
  .family-today-panel .section-heading > small { display: none; }
  .family-schedule-row { min-height: 24px; }
  .music-player {
    position: absolute;
    left: 8px;
    bottom: 9px;
    width: 55%;
    min-height: 58px;
    margin: 0;
  }
  .page-turn-tab {
    top: auto;
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: 26px;
    min-height: 72px;
    transform: none;
  }
  .page-turn-tab span { display: none; }
  .folio-menu-trigger {
    top: max(5px, env(safe-area-inset-top));
    right: max(5px, env(safe-area-inset-right));
    width: 54px;
    min-height: 42px;
  }
  .more-sheet {
    top: auto;
    right: max(7px, env(safe-area-inset-right));
    bottom: max(7px, env(safe-area-inset-bottom));
    left: max(7px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - 14px);
    padding: 10px;
    grid-template-columns: repeat(6, minmax(0,1fr));
    border-radius: 7px;
  }
  .contents-heading { grid-column: 1 / -1; padding-bottom: 7px; }
  .contents-heading b { font-size: 19px; }
  .more-sheet button { min-height: 58px; }
}

/* 予定のクイック登録：素材を一枚の紙へ集め、確認してから書き込む */
.quick-capture-dialog { width: min(720px, calc(100vw - 24px)); }
.quick-capture-paper {
  position: relative;
  max-height: min(88dvh, 820px);
  overflow: auto;
  padding: 24px 26px 22px;
  color: var(--folio-ink);
  border: 1px solid rgba(73, 58, 37, .28);
  background:
    linear-gradient(90deg, rgba(255,255,255,.2), transparent 16%, transparent 87%, rgba(73,45,25,.05)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(70,76,67,.05) 31px 32px),
    #f5efdf;
  box-shadow: 0 24px 70px rgba(19, 14, 10, .48);
}
.quick-capture-paper::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 44%;
  width: 90px;
  height: 21px;
  transform: rotate(-1.5deg);
  background: rgba(215, 194, 148, .58);
  box-shadow: 0 1px 3px rgba(67,50,31,.12);
}
.quick-capture-header { display: flex; justify-content: space-between; align-items: flex-start; }
.quick-capture-header h2 { margin: 3px 0 0; font: 500 28px var(--display); letter-spacing: .03em; }
.quick-capture-header > button { border: 0; background: transparent; color: var(--folio-ink-soft); font-size: 28px; }
.quick-capture-lead { margin: 12px 0 15px; color: var(--folio-ink-soft); font: 12px/1.7 var(--body); }
.capture-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.capture-source-grid > button {
  min-height: 76px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  text-align: left;
  color: var(--folio-ink);
  border: 1px solid rgba(64, 71, 62, .23);
  border-radius: 2px;
  background: rgba(253, 249, 237, .72);
  box-shadow: 0 4px 10px rgba(56, 43, 28, .06);
}
.capture-source-grid svg { width: 26px; height: 26px; color: var(--folio-russet); stroke-width: 1.35; }
.capture-source-grid b,
.capture-source-grid small { display: block; }
.capture-source-grid b { font: 500 15px var(--display); }
.capture-source-grid small { margin-top: 3px; color: var(--folio-ink-soft); font: 8px/1.35 var(--utility); }
.quick-capture-input { display: block; margin-top: 16px; }
.quick-capture-input > span { display: block; margin-bottom: 6px; font: 600 10px var(--utility); letter-spacing: .1em; }
.quick-capture-input textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  padding: 10px 12px;
  color: var(--folio-ink);
  border: 1px solid rgba(64, 71, 62, .24);
  border-radius: 1px;
  background: rgba(255, 252, 244, .72);
  font: 13px/1.65 var(--body);
}
.quick-analyze {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  color: #f6efe0;
  border: 0;
  border-radius: 1px;
  background: #35473d;
  font: 500 13px var(--body);
  letter-spacing: .06em;
}
.quick-candidates { display: grid; gap: 7px; margin-top: 13px; }
.quick-empty { padding: 14px; color: var(--folio-ink-soft); border-top: 1px solid rgba(65,72,63,.2); border-bottom: 1px solid rgba(65,72,63,.14); font: 11px/1.6 var(--body); }
.quick-candidate {
  display: grid;
  grid-template-columns: 25px minmax(0,1fr);
  gap: 8px;
  padding: 9px 10px;
  border-left: 3px solid var(--folio-russet);
  background: rgba(255, 252, 242, .68);
  box-shadow: 0 3px 9px rgba(56,43,28,.055);
}
.quick-candidate-check { padding-top: 7px; }
.quick-candidate-check input { width: 17px; height: 17px; accent-color: #536756; }
.quick-candidate-fields { min-width: 0; }
.quick-candidate-fields input,
.quick-candidate-fields select {
  min-height: 32px;
  color: var(--folio-ink);
  border: 0;
  border-bottom: 1px solid rgba(64,71,62,.2);
  border-radius: 0;
  background: transparent;
  font: 11px var(--body);
}
.quick-candidate-fields .quick-title { width: 100%; font: 500 14px var(--body); }
.quick-candidate-fields > div { display: grid; grid-template-columns: 1fr .8fr .8fr; gap: 8px; margin-top: 3px; }
.quick-capture-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.quick-capture-actions > button { min-height: 40px; padding: 8px 15px; border: 1px solid rgba(64,71,62,.2); background: transparent; }
.quick-capture-actions .primary { color: #f7f0df; border-color: #35473d; background: #35473d; }
.quick-capture-actions .primary:disabled { opacity: .42; }

body.dark .quick-capture-paper { color: #ebe6d8; border-color: rgba(229,216,187,.18); background: #27332e; }
body.dark .quick-capture-lead,
body.dark .quick-empty,
body.dark .capture-source-grid small { color: rgba(235,230,216,.68); }
body.dark .capture-source-grid > button,
body.dark .quick-candidate { color: #ebe6d8; border-color: rgba(229,216,187,.17); background: rgba(44,57,51,.86); }
body.dark .quick-capture-input textarea,
body.dark .quick-candidate-fields input,
body.dark .quick-candidate-fields select { color: #ebe6d8; background: rgba(34,45,40,.72); }

/* v0.5.7 — 手帳へ綴じ込む「くらしの道具」 */
.folio-hub-paper {
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(160,132,79,.09), transparent 32%),
    linear-gradient(100deg, rgba(255,255,255,.38), transparent 24%),
    var(--folio-paper);
}
.folio-hub-intro {
  max-width: 560px;
  margin: 20px 0 24px;
  color: var(--folio-ink-soft);
  font: 13px/1.9 var(--body);
  letter-spacing: .035em;
}
.folio-tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.folio-tool-card {
  position: relative;
  min-height: 246px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 20px 19px;
  color: #f7f1e3;
  border: 0;
  border-radius: 2px 13px 2px 2px;
  text-align: left;
  box-shadow: 0 14px 30px rgba(46,37,27,.16), inset 0 0 0 1px rgba(255,255,255,.1);
}
.folio-tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 38%), repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 4px);
}
.folio-tool-card.subscriptions { background: linear-gradient(145deg, #6b6958, #353c36); }
.folio-tool-card.boardgame { background: linear-gradient(145deg, #785743, #472f28); }
.folio-tool-card.shopping { background: linear-gradient(145deg, #55736b, #29433f); }
.folio-tool-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.folio-tool-icon svg { width: 25px; height: 25px; }
.folio-tool-card > span:nth-child(2) { position: relative; z-index: 1; display: grid; gap: 5px; }
.folio-tool-card small { color: rgba(255,255,255,.64); font: 9px var(--utility); letter-spacing: .18em; }
.folio-tool-card b { font: 500 22px/1.25 var(--display); letter-spacing: .035em; }
.folio-tool-card em { color: rgba(255,255,255,.68); font: normal 10px/1.65 var(--body); }
.folio-tool-card > i { position: relative; z-index: 1; align-self: flex-end; font: normal 10px var(--utility); letter-spacing: .12em; }
.portal-address {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 1.1fr);
  align-items: end;
  gap: 24px;
  padding: 17px 20px;
  border: 1px solid rgba(70,69,58,.14);
}
.portal-address.is-complete { display: none; }
.portal-address h2 { margin: 2px 0 4px; font: 500 17px var(--display); }
.portal-address p { margin: 0; color: var(--folio-ink-soft); font: 10px/1.6 var(--body); }
.portal-address > div:last-child { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.portal-address input { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid rgba(66,70,62,.22); background: rgba(255,255,255,.45); font: 11px var(--body); }
.portal-address button,
#portalReloadButton,
#portalFullscreenButton { min-height: 40px; padding: 0 14px; color: #f6efe1; border: 0; background: #394d43; font: 10px var(--body); letter-spacing: .05em; }
.portal-toolbar-actions { display: flex; gap: 7px; }
#portalFullscreenButton { color: #394d43; border: 1px solid rgba(57,77,67,.32); background: rgba(255,253,246,.55); }

.portal-view { background: #272e2a; }
.portal-paper { height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); padding: 0 !important; background: #eae2cf; }
.portal-toolbar {
  min-height: 70px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto;
  align-items: center;
  gap: 13px;
  padding: max(8px, env(safe-area-inset-top)) max(76px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(55,58,52,.18);
  background: linear-gradient(90deg, #eee7d6, #e3dbc8);
  box-shadow: 0 4px 14px rgba(32,29,24,.13);
  z-index: 2;
}
.portal-toolbar h1 { margin: 1px 0 0; font: 500 20px var(--display); letter-spacing: .035em; }
.portal-toolbar .eyebrow { font-size: 8px; }
.portal-frame-wrap { position: relative; min-height: 0; margin: 9px 10px 10px; overflow: hidden; border: 1px solid rgba(50,54,48,.28); border-radius: 2px 10px 2px 2px; background: #fff; box-shadow: 0 10px 24px rgba(31,29,24,.17); }
.portal-frame-wrap iframe { width: 100%; height: 100%; display: block; border: 0; background: #fff; }
.portal-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: #536057; background: rgba(241,236,222,.96); font: 12px var(--body); letter-spacing: .05em; }
.portal-loading[hidden] { display: none; }
.portal-loading span { width: 30px; height: 30px; border: 2px solid rgba(57,77,67,.2); border-top-color: #394d43; border-radius: 50%; animation: folio-spin .8s linear infinite; }
@keyframes folio-spin { to { transform: rotate(360deg); } }
body.dark .folio-hub-paper { background: linear-gradient(140deg, #2f3933, #252d29); }
body.dark .folio-hub-intro { color: rgba(235,230,216,.65); }
body.dark .portal-paper { background: #252d29; }
body.dark .portal-toolbar { color: #eee8da; border-color: rgba(255,255,255,.1); background: linear-gradient(90deg, #313b35, #28312c); }

@media (max-width: 839px) {
  .folio-tool-grid { grid-template-columns: 1fr; gap: 9px; }
  .folio-tool-card { min-height: 112px; display: grid; grid-template-columns: 43px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 16px; border-radius: 2px 10px 2px 2px; }
  .folio-tool-icon { width: 42px; height: 42px; }
  .folio-tool-icon svg { width: 21px; height: 21px; }
  .folio-tool-card b { font-size: 19px; }
  .portal-address { grid-template-columns: 1fr; gap: 12px; }
  .portal-toolbar { min-height: 64px; grid-template-columns: 40px minmax(0,1fr) auto; padding-right: max(68px, env(safe-area-inset-right)); }
  .portal-toolbar h1 { font-size: 17px; }
  #portalReloadButton { min-height: 34px; padding: 0 9px; font-size: 8px; }
  #portalFullscreenButton { min-height: 34px; padding: 0 9px; font-size: 8px; }
  .portal-frame-wrap { margin: 5px 5px max(5px, env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .folio-hub-intro { margin: 13px 0 16px; font-size: 11px; }
  .folio-tool-card { min-height: 98px; padding: 12px; }
  .folio-tool-card em { display: none; }
  .portal-address { padding: 13px; }
  .portal-address > div:last-child { grid-template-columns: 1fr; }
  .portal-toolbar { gap: 7px; padding-right: 61px; }
  .portal-toolbar .eyebrow { display: none; }
  #portalReloadButton { width: 36px; overflow: hidden; color: transparent; padding: 0; }
  #portalReloadButton::after { content: "↻"; display: block; color: #f6efe1; font-size: 19px; }
}

/* v0.5.8 — お気に入りを選ぶ、見開きのアプリ図書室 */
.favorite-library-paper {
  background:
    linear-gradient(90deg, rgba(87,64,38,.045) 0 1px, transparent 1px) 42px 0 / calc(100% - 84px) 100%,
    radial-gradient(circle at 12% 20%, rgba(131,111,70,.08), transparent 26%),
    var(--folio-paper);
}
.favorite-library-intro { margin: 18px 0 22px; color: var(--folio-ink-soft); font: 12px/1.8 var(--body); letter-spacing: .035em; }
.favorite-count { align-self: center; margin-right: 70px; padding: 7px 11px; color: var(--folio-moss); border: 1px solid rgba(67,86,72,.24); font: 10px var(--utility); letter-spacing: .1em; }
.favorite-library-layout { display: grid; grid-template-columns: minmax(280px,.78fr) minmax(420px,1.22fr); gap: 18px; align-items: stretch; }
.favorite-shelf,
.app-library-list { min-width: 0; padding: 18px 19px; border: 1px solid rgba(61,68,60,.16); background: rgba(250,246,234,.58); box-shadow: 0 8px 20px rgba(44,35,25,.07); }
.favorite-shelf { display: flex; flex-direction: column; }
.favorite-shelf-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 12px 0 auto; align-content: start; }
.favorite-shelf-grid > button {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: var(--folio-ink);
  border: 0;
  border-bottom: 1px solid rgba(66,73,65,.15);
  background: transparent;
  text-align: left;
}
.favorite-shelf-grid .app-tile { width: 42px !important; height: 42px !important; }
.favorite-shelf-grid b,
.favorite-shelf-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-shelf-grid b { font: 500 13px var(--body); }
.favorite-shelf-grid small { margin-top: 3px; color: var(--folio-ink-soft); font: 8px var(--utility); }
.favorite-shelf-grid .favorite-shelf-empty { grid-column: 1 / -1; min-height: 132px; display: flex; justify-content: center; border: 1px dashed rgba(68,78,69,.25); text-align: center; }
.favorite-shelf-empty svg { width: 23px; height: 23px; margin-right: 8px; }
.favorite-shelf .picker-size-row { margin-top: 18px; padding-top: 13px; border-top: 1px solid rgba(65,73,64,.15); border-bottom: 0; }
.app-library-list { height: min(69dvh, 720px); display: flex; flex-direction: column; }
.app-library-list .app-search { margin-top: 12px; border-color: rgba(62,73,64,.22); background: rgba(255,253,246,.53); }
.app-library-list .app-picker-list { min-height: 180px; scrollbar-color: rgba(71,89,75,.38) transparent; }
.app-library-list .app-picker-item { color: var(--folio-ink); border-bottom-style: solid; border-bottom-color: rgba(67,75,67,.12); }
.app-library-list .app-picker-item:hover { background: rgba(83,108,92,.075); }
.app-library-list .app-picker-item.is-selected { background: rgba(83,108,92,.11); }
body.dark .favorite-shelf,
body.dark .app-library-list { background: rgba(43,54,48,.74); }
body.dark .favorite-count { color: #d8c38d; border-color: rgba(216,195,141,.34); }
body.dark .app-library-list .app-search { background: rgba(31,41,36,.72); }
body.dark .app-library-list input { color: #ebe6d8; }

@media (max-width: 839px) {
  .favorite-count { margin-right: 55px; }
  .favorite-library-layout { grid-template-columns: 1fr; }
  .favorite-shelf-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .app-library-list { height: min(62dvh, 620px); }
}

@media (max-width: 600px) {
  .favorite-library-intro { margin: 12px 0 15px; font-size: 10px; }
  .favorite-count { margin-right: 46px; padding: 5px 7px; font-size: 8px; }
  .favorite-shelf,
  .app-library-list { padding: 13px 12px; }
  .favorite-shelf-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .favorite-shelf-grid > button { min-height: 59px; grid-template-columns: 37px minmax(0,1fr); gap: 7px; padding: 6px 3px; }
  .favorite-shelf-grid .app-tile { width: 35px !important; height: 35px !important; }
  .favorite-shelf-grid b { font-size: 11px; }
  .favorite-shelf .picker-size-row { align-items: flex-start; flex-direction: column; }
  .app-library-list { height: 64dvh; }
  .app-library-list .app-picker-list { grid-template-columns: 1fr; }
}

/* v0.5.9 — Androidの確認を残しながら最短でホームを切り替える */
.home-switch-panel {
  margin: 12px -4px 8px;
  padding: 17px 16px 15px;
  border: 1px solid rgba(65,75,66,.16);
  border-left: 4px solid var(--folio-russet);
  background: linear-gradient(100deg, rgba(166,105,73,.07), rgba(83,108,92,.045));
}
.home-switch-copy h2 { margin: 3px 0 3px; font: 500 20px var(--display); letter-spacing: .025em; }
.home-switch-copy p { margin: 0; color: var(--folio-ink-soft); font: 10px var(--utility); }
.home-switch-copy p.is-folio { color: var(--folio-moss); font-weight: 600; }
.home-switch-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.home-switch-actions button {
  min-height: 62px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  color: var(--folio-ink);
  border: 1px solid rgba(63,75,65,.2);
  background: rgba(255,252,242,.62);
  text-align: left;
}
.home-switch-actions button:first-child { color: #f7f0e1; border-color: #42584b; background: #42584b; }
.home-switch-actions button:disabled { opacity: .44; }
.home-switch-actions svg { width: 21px; height: 21px; }
.home-switch-actions b,
.home-switch-actions small { display: block; }
.home-switch-actions b { font: 500 14px var(--body); }
.home-switch-actions small { margin-top: 2px; opacity: .68; font: 8px var(--utility); }
.home-switch-note { display: block; margin-top: 10px; color: var(--folio-ink-soft); font: 9px/1.6 var(--utility); }
body.dark .home-switch-panel { background: linear-gradient(100deg, rgba(172,112,80,.1), rgba(83,108,92,.08)); }
body.dark .home-switch-copy p.is-folio { color: #c9d6bd; }
body.dark .home-switch-actions button { color: #ebe6d8; background: rgba(48,60,53,.78); }
body.dark .home-switch-actions button:first-child { background: #4f6657; }

@media (max-width: 430px) {
  .home-switch-panel { padding: 14px 12px 12px; }
  .home-switch-actions { grid-template-columns: 1fr; }
  .home-switch-actions button { min-height: 55px; }
}

/* v0.6.0 — 基準画像のスクラップブック構図を開状態へ忠実に移植 */
@media (min-width: 840px) {
  .home-view.is-active {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    background:
      linear-gradient(90deg, rgba(16,8,4,.18), transparent 10%, transparent 89%, rgba(16,8,4,.2)),
      url("media/desk-walnut-v051.png") center / cover,
      #3d2417;
  }
  .book {
    width: calc(100vw - 34px);
    height: calc(100dvh - 26px);
    min-height: 0;
    margin: 13px auto;
    padding: 7px 8px 8px;
    grid-template-columns: minmax(0,1fr) 12px minmax(0,1fr);
    border: 1px solid #1e120d;
    border-radius: 9px;
    box-shadow: inset 0 0 0 2px rgba(222,190,141,.12), inset 0 0 24px rgba(15,7,3,.38), 0 10px 22px rgba(14,7,3,.48);
  }
  .paper-page {
    height: 100%;
    min-height: 0;
    padding: 17px 20px 18px;
    overflow: hidden;
    border-radius: 2px;
    background-image:
      linear-gradient(90deg, rgba(255,255,255,.2), transparent 13%, transparent 88%, rgba(71,45,23,.055)),
      radial-gradient(circle at 19% 16%, rgba(82,70,49,.055) 0 1px, transparent 1.3px),
      repeating-linear-gradient(0deg, transparent 0 30px, rgba(82,80,64,.075) 30px 31px);
    background-size: auto, 10px 10px, auto;
  }
  .left-page {
    display: grid;
    grid-template-rows: 102px 118px 190px minmax(105px,1fr);
    gap: 9px;
    align-content: stretch;
  }
  .left-page > #familyTodayHomeAnchor { display: none; }
  .left-page > .weather-card,
  .left-page > .music-player,
  .left-page > .today-card,
  .left-page > .favorites { margin: 0 !important; }
  .left-page > .weather-card {
    width: 69%;
    height: 102px;
    grid-template-columns: 39% 34% 27%;
    border: 0;
    background: url("media/weather-washi-v054.png") center 52% / cover no-repeat;
    box-shadow: 0 5px 12px rgba(49,43,32,.13);
  }
  .left-page > .weather-card::before {
    background: linear-gradient(90deg, rgba(176,208,220,.13) 0 34%, rgba(220,231,224,.75) 47%, rgba(234,237,224,.92) 100%);
  }
  .weather-main { padding: 7px 9px; }
  .weather-main strong { font-size: 37px; }
  .weather-main .eyebrow { font-size: 7px; }
  .weather-main > span:last-child { margin-top: 2px; font-size: 11px; }
  .weather-stats { padding: 6px 7px; gap: 3px; font-size: 9px; }
  .weather-stats small { font-size: 6px; }
  .left-sticker-plant {
    display: block;
    width: 128px;
    height: 142px;
    top: 16px;
    right: 23px;
    padding: 6px 6px 20px;
    transform: rotate(2.2deg);
    z-index: 5;
    box-shadow: 2px 7px 12px rgba(50,36,22,.22);
  }
  .left-page > .music-player {
    width: 100%;
    min-height: 0;
    height: 118px;
    grid-template-columns: 44px minmax(0,1fr) auto;
    gap: 9px;
    padding: 7px 148px 7px 11px;
    color: var(--folio-ink);
    border: 0;
    border-top: 1px solid rgba(61,68,59,.2);
    border-bottom: 1px solid rgba(61,68,59,.15);
    background: rgba(250,246,234,.68);
    box-shadow: 0 4px 11px rgba(45,36,25,.07);
  }
  .music-art {
    width: 42px;
    height: 42px;
    color: #f4edda;
    border-color: rgba(74,91,78,.28);
    background: radial-gradient(circle, #d5bd81 0 13%, #86947a 14% 18%, #3e5146 19% 51%, #b9a36e 52% 55%, #405348 56%);
  }
  .music-copy small { color: var(--folio-russet); }
  .music-copy strong { color: var(--folio-ink); font-size: 14px; }
  .music-copy span { color: var(--folio-ink-soft); }
  .music-controls button {
    width: 28px;
    height: 28px;
    color: var(--folio-ink);
    border-color: rgba(64,76,67,.2);
    background: rgba(255,255,255,.38);
  }
  .music-controls .music-play { width: 34px; height: 34px; color: #f7f0df; border-color: #51675a; background: #51675a; }
  .left-page > .today-card {
    width: 100%;
    min-height: 0;
    height: 100%;
    padding: 7px 10px 8px;
    transform: rotate(-.08deg);
  }
  .today-card::before {
    content: "";
    position: absolute;
    width: 66px;
    height: 13px;
    top: -7px;
    right: 9%;
    background: rgba(194,177,139,.42);
    transform: rotate(2deg);
  }
  .today-card .section-heading { min-height: 27px; margin-bottom: 3px; }
  .today-card .section-heading > span { font-size: 18px; }
  .task-row { min-height: 29px; grid-template-columns: 23px 48px minmax(0,1fr) auto; gap: 5px; }
  .task-check { width: 17px; height: 17px; border-radius: 1px; }
  .task-time { font-size: 9px; }
  .task-open { padding: 5px 3px; font-size: 12px; }
  .category-tag { font-size: 8px; }
  .left-page > .favorites {
    width: 100%;
    min-height: 0;
    display: grid;
    justify-content: start;
    align-content: start;
    padding: 23px 8px 0;
    gap: 7px 11px;
    border-top: 1px solid rgba(58,67,59,.17);
  }
  .left-page > .favorites::before { top: 3px; left: 8px; font-size: 14px; }
  body[data-app-size="standard"] .left-page > .favorites,
  body[data-app-size="large"] .left-page > .favorites,
  body[data-app-size="xlarge"] .left-page > .favorites { grid-template-columns: repeat(7, 48px) !important; }
  .left-page > .favorites button { width: 48px; }
  .left-page > .favorites .app-tile { width: 38px !important; height: 38px !important; border-radius: 10px; }
  .left-page > .favorites small { margin-top: 3px; font-size: 7px; }

  .right-page {
    display: grid;
    grid-template-rows: 47px minmax(300px,1fr) 166px;
    gap: 9px;
  }
  .right-header { min-height: 0; height: 47px; padding: 0 66px 4px 2px; align-items: center; border-bottom: 1px solid rgba(61,67,59,.16); }
  .right-header h1 { margin-top: 0; font-size: 25px; }
  .right-header .eyebrow { font-size: 7px; }
  .right-page > .calendar-card {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 32px 23px minmax(0,1fr);
    padding: 5px 8px 8px;
    border: 0;
    background: rgba(253,249,239,.58);
    box-shadow: 0 4px 13px rgba(48,37,25,.07);
  }
  .calendar-controls { height: 32px; font-size: 17px; }
  .calendar-controls button { height: 28px; }
  .week-row { height: 23px; }
  .week-row span { padding: 4px 0; font-size: 8px; }
  .calendar-grid { min-height: 0; grid-template-rows: repeat(6,minmax(0,1fr)); }
  .calendar-day { height: auto; min-height: 0; aspect-ratio: auto; font-size: 10px; }
  .calendar-day.is-today::before { inset: 3px 17%; border-radius: 1px; }
  .day-dots { bottom: 2px; }
  .day-dots i { width: 4px; height: 4px; }
  .right-page > .family-today-mount { min-height: 0; }
  .right-page .family-today-panel {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 5px 132px 7px 10px;
    transform: rotate(.08deg);
    overflow: visible;
  }
  .right-page .family-today-panel::before {
    content: "";
    position: absolute;
    width: 54px;
    height: 13px;
    left: -8px;
    bottom: 17px;
    background: rgba(213,187,125,.45);
    transform: rotate(-4deg);
  }
  .right-page .family-today-panel .section-heading { min-height: 28px; margin-bottom: 3px; }
  .right-page .family-today-panel .section-heading > span { font-size: 18px; }
  .right-page .family-today-panel .section-heading > small { display: block; font-size: 7px; }
  .right-page .family-schedule-row { min-height: 24px; grid-template-columns: 46px 43px minmax(0,1fr); gap: 5px; }
  .right-page .family-schedule-row button { font-size: 11px; }
  .right-page .family-today-panel .bottom-photo {
    position: absolute;
    display: block;
    width: 108px;
    height: 119px;
    right: 13px;
    bottom: 12px;
    transform: rotate(4deg);
    border-width: 6px;
    box-shadow: 2px 7px 12px rgba(55,39,24,.2);
  }
  .right-page > .family-upcoming-panel { display: none; }
  .cover-scraps { display: none; }
  .page-fold-actions { right: 13px; bottom: 10px; transform: scale(.88); transform-origin: right bottom; }

  /* 基準画像のホーム紙面は夜のインク設定から独立して常に明るく保つ */
  body.dark .home-view {
    --folio-ink: #252e2a;
    --folio-ink-soft: #59635d;
    --folio-paper: #f0ead9;
    --folio-paper-light: #fbf7eb;
    --ink: #252e2a;
    --ink-soft: #59635d;
    --paper: #f0ead9;
  }
  body.dark .home-view .paper-page { color: #252e2a; background-color: #f0ead9; }
  body.dark .home-view .paper-card,
  body.dark .home-view .calendar-card,
  body.dark .home-view .family-today-panel { color: #252e2a; background-color: rgba(251,247,235,.68); }
  body.dark .home-view .music-player { color: #252e2a; background: rgba(250,246,234,.68); }
  body.dark .home-view .music-copy strong { color: #252e2a; }
  body.dark .home-view .music-copy span,
  body.dark .home-view .family-empty { color: #59635d; }
}

@media (min-width: 840px) and (max-aspect-ratio: 1 / 1) {
  .book { width: calc(100vw - 24px); height: calc(100dvh - 24px); margin: 12px auto; }
  .left-page { grid-template-rows: 108px 82px minmax(190px,1fr) 132px; }
  .left-page > .weather-card { width: calc(100% - 108px); }
  .left-sticker-plant { width: 96px; height: 116px; right: 16px; }
  .left-page > .music-player { padding-right: 9px; }
  body[data-app-size="standard"] .left-page > .favorites,
  body[data-app-size="large"] .left-page > .favorites,
  body[data-app-size="xlarge"] .left-page > .favorites { grid-template-columns: repeat(4,48px) !important; }
  .right-page { grid-template-rows: 51px minmax(390px,1fr) 205px; }
  .right-page .family-today-panel { padding-right: 105px; }
  .right-page .family-today-panel .bottom-photo { width: 88px; height: 108px; }
}

@media (max-width: 839px) {
  .family-today-panel .bottom-photo { display: none !important; }
}

@media (max-width: 600px) {
  .quick-capture-dialog { width: calc(100vw - 14px); }
  .quick-capture-paper { max-height: calc(100dvh - 14px); padding: 19px 13px 14px; }
  .quick-capture-header h2 { font-size: 23px; }
  .quick-capture-lead { margin-top: 8px; font-size: 10px; }
  .capture-source-grid { gap: 5px; }
  .capture-source-grid > button { min-height: 72px; display: block; padding: 8px 6px; text-align: center; }
  .capture-source-grid svg { width: 22px; height: 22px; }
  .capture-source-grid b { margin-top: 3px; font-size: 12px; }
  .capture-source-grid small { display: none; }
  .quick-capture-input { margin-top: 11px; }
  .quick-capture-input textarea { min-height: 70px; }
  .quick-candidate-fields > div { grid-template-columns: 1.15fr .8fr .8fr; gap: 4px; }
  .quick-candidate-fields input,
  .quick-candidate-fields select { min-width: 0; font-size: 9px; }
  .quick-capture-actions { position: sticky; bottom: -14px; margin-right: -13px; margin-left: -13px; padding: 9px 13px 14px; background: rgba(245,239,223,.96); }
  body.dark .quick-capture-actions { background: rgba(39,51,46,.96); }
}

@media (prefers-reduced-motion: reduce) {
  .view.is-active,
  .turn-left .view.is-active,
  .turn-right .view.is-active { animation: none !important; }
  .lift-card,
  .app-tile { transition: none !important; }
}

/* v0.6.1 — 生成AIの実写手帳を背景にし、操作部分だけを紙面へ重ねる */
@media (min-width: 840px) {
  .home-view.is-active {
    overflow: hidden;
    background: #321d12;
  }

  .home-view .book {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 10.2dvh 12vw 10.4dvh;
    grid-template-columns: minmax(0, 1fr) 1.45vw minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    background: url("media/folio-open-bg-ai-v062.png") center / 100% 100% no-repeat;
    box-shadow: none;
  }

  .home-view .paper-page {
    height: 100%;
    min-height: 0;
    padding: 7px 15px 9px;
    border: 0;
    border-radius: 0;
    color: #2b2d28;
    background: transparent;
    box-shadow: none;
  }

  .home-view .page-rule { display: none; }
  .home-view .book-spine {
    display: block;
    visibility: hidden;
  }

  .home-view .left-page {
    grid-template-rows: 16% 17.5% 31% minmax(0, 1fr);
    gap: 1.35%;
  }

  .home-view .left-page > .weather-card {
    width: 68%;
    height: 100%;
    border: 1px solid rgba(91, 76, 53, .12);
    border-radius: 1px;
    background: url("media/weather-washi-v054.png") center 52% / cover no-repeat;
    box-shadow: 0 4px 10px rgba(52, 39, 25, .12);
  }

  .home-view .left-sticker-plant {
    top: 4%;
    right: 5.6%;
    width: 24.5%;
    height: 24%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #d9d4ca;
    box-shadow: inset 0 0 0 1px rgba(64, 49, 34, .13);
    transform: rotate(.25deg);
  }

  .home-view .left-sticker-plant img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .home-view .left-page > .music-player,
  .home-view .left-page > .today-card,
  .home-view .left-page > .favorites,
  .home-view .right-page > .calendar-card,
  .home-view .right-page .family-today-panel {
    border-color: rgba(74, 67, 53, .13);
    background-color: rgba(250, 246, 234, .64);
    box-shadow: 0 3px 9px rgba(52, 40, 27, .07);
    backdrop-filter: blur(.6px);
  }

  .home-view .left-page > .music-player {
    height: 100%;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-right: 27%;
  }

  .home-view .left-page > .today-card {
    height: 100%;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .home-view .left-page > .favorites {
    height: 100%;
    padding-top: 22px;
    gap: 5px 8px;
    overflow: hidden;
    background: rgba(250, 246, 234, .28);
    box-shadow: none;
  }

  body[data-app-size="standard"] .home-view .left-page > .favorites,
  body[data-app-size="large"] .home-view .left-page > .favorites,
  body[data-app-size="xlarge"] .home-view .left-page > .favorites {
    grid-template-columns: repeat(6, minmax(40px, 1fr)) !important;
  }

  .home-view .left-page > .favorites button { width: auto; min-width: 0; }

  .home-view .right-page {
    grid-template-rows: 7.5% minmax(0, 58.5%) minmax(0, 31.3%);
    gap: 1.35%;
  }

  .home-view .right-header {
    height: 100%;
    min-height: 0;
    padding: 0 66px 2px 3px;
  }

  .home-view .right-header h1 { font-size: clamp(20px, 2vw, 27px); }

  .home-view .right-page > .calendar-card {
    height: 100%;
    min-height: 0;
    background: rgba(252, 248, 237, .57);
  }

  .home-view .right-page .family-today-panel {
    height: 100%;
    min-height: 0;
    padding-right: 26%;
    background: rgba(252, 248, 237, .5);
  }

  .home-view .right-page .family-today-panel .bottom-photo {
    width: 24%;
    height: 76%;
    right: 1%;
    bottom: 7%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #d9d4ca;
    box-shadow: inset 0 0 0 1px rgba(64, 49, 34, .13);
    transform: rotate(.15deg);
  }

  .home-view .right-page .family-today-panel .bottom-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .home-view .right-page .family-today-panel .bottom-photo .photo-placeholder {
    inset: 0;
  }

  .home-view .folio-menu-trigger {
    top: max(12px, env(safe-area-inset-top));
    right: max(22px, env(safe-area-inset-right));
  }
}

@media (min-width: 840px) and (max-aspect-ratio: 1 / 1) {
  .home-view .book {
    padding: 9.2dvh 11.5vw 10dvh;
    grid-template-columns: minmax(0, 1fr) 1.7vw minmax(0, 1fr);
    background-size: cover;
  }
  .home-view .paper-page { padding-right: 10px; padding-left: 10px; }
  body[data-app-size="standard"] .home-view .left-page > .favorites,
  body[data-app-size="large"] .home-view .left-page > .favorites,
  body[data-app-size="xlarge"] .home-view .left-page > .favorites {
    grid-template-columns: repeat(4, minmax(38px, 1fr)) !important;
  }
}

/* v0.6.3 確定値 — ファイル末尾で指定画像と紙面サイズを固定 */
@media (min-width: 840px) {
  .home-view .book {
    padding: 1.4dvh 1.55vw 1.6dvh;
    grid-template-columns: minmax(0,1fr) .55vw minmax(0,1fr);
    background-image: var(--folio-book-background, url("media/folio-open-bg-ai-v062.png"));
    background-size: 100% 100%;
  }
  .home-view .paper-page { padding: 12px 22px 14px; }
  .home-view .left-sticker-plant { top: 7%; height: 27%; }
  .home-view .left-page > .weather-card {
    border-color: rgba(55,80,69,.18);
    box-shadow: 0 7px 17px rgba(45,35,23,.17);
    transform: rotate(-.18deg);
  }
  .home-view .left-page > .weather-card::after {
    content: "";
    position: absolute;
    z-index: 5;
    width: 70px;
    height: 14px;
    top: -7px;
    left: 43%;
    background: rgba(202,182,132,.48);
    transform: rotate(1.5deg);
  }
}

@media (min-width: 840px) and (max-aspect-ratio: 1 / 1) {
  .home-view .book {
    padding: 1.4dvh 1.5vw 1.7dvh;
    grid-template-columns: minmax(0,1fr) .7vw minmax(0,1fr);
    background-size: 100% 100%;
  }
  .home-view .paper-page { padding-right: 14px; padding-left: 14px; }
}

/* v0.6.5 配置固定値 */
@media (min-width: 840px) {
  .home-view .left-page > .favorites,
  body[data-app-size="standard"] .home-view .left-page > .favorites,
  body[data-app-size="large"] .home-view .left-page > .favorites,
  body[data-app-size="xlarge"] .home-view .left-page > .favorites {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid !important;
    grid-template-columns: repeat(5,minmax(0,1fr)) !important;
    grid-template-rows: repeat(2,minmax(0,1fr));
    gap: 5px 8px;
    padding: 21px 7px 4px;
    overflow: hidden;
  }
  .home-view .left-page > .favorites button { width: 100% !important; min-width: 0; }
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile {
    width: clamp(30px,3.1vw,43px) !important;
    height: clamp(30px,3.1vw,43px) !important;
  }
}

/* v0.6.6 最終固定値 */
.more-sheet { grid-template-columns: repeat(6,minmax(0,1fr)); }
.more-sheet > button:is([data-nav],[data-portal]):nth-of-type(5n) { border-right: 1px solid var(--index-line); }
.more-sheet > button:is([data-nav],[data-portal]):nth-of-type(6n) { border-right: 0; }
.memo-studio { grid-template-columns: 170px minmax(0,1fr); gap: 13px; align-items: start; }
.memo-archive { padding: 12px 9px; text-align: left; }
.memo-archive .section-heading > span { font-size: 20px; white-space: nowrap; }
.memo-archive .empty-state { padding: 28px 7px; text-align: left; }
.memo-history-item { grid-template-columns: minmax(0,1fr) 30px; border-left: 3px solid transparent; }
.memo-history-item.is-selected { border-left-color: #657c6b; background: rgba(93,119,99,.14); }
.memo-history-item > button:first-child { padding: 11px 3px 11px 7px; }
.memo-history-item time { margin: 0; color: var(--folio-ink); font: 500 10px var(--utility); text-align: left; }
.memo-history-item.is-selected time { color: #385343; }
.memo-workspace { position: relative; gap: 13px; }
.memo-workspace .text-memo { min-height: 445px; padding: 8px 10px 10px; overflow: visible; }
.memo-workspace .text-memo textarea { width: 100%; height: 380px; padding: 7px clamp(170px,28%,245px) 10px 7px; vertical-align: top; }
.memo-text-footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid rgba(63,74,64,.14); }
.memo-text-footer .memo-type-controls { margin: 0; }
.memo-photo {
  position: absolute;
  z-index: 5;
  top: 20px;
  right: 18px;
  width: clamp(150px,22%,215px);
  height: 245px;
  min-height: 0;
  padding: 7px 7px 18px;
  grid-template-rows: minmax(0,1fr) 24px;
}
.memo-photo img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.favorite-shelf-grid { grid-template-columns: repeat(var(--placement-cols,5),minmax(0,1fr)); gap: 6px; }
.portal-swipe-edge { position: absolute; z-index: 9; top: 0; bottom: 0; width: 28px; touch-action: pan-y; }
.portal-swipe-left { left: 0; }
.portal-swipe-right { right: 0; }

@media (min-width: 840px) {
  .home-view .right-page { grid-template-rows: 7.5% minmax(0,54.5%) minmax(0,35.3%); }
  .home-view .right-page .family-today-panel { padding-top: 9px; padding-bottom: 10px; }
  .home-view .right-page .family-schedule-row { min-height: 31px; padding-top: 3px; padding-bottom: 3px; }
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile {
    width: clamp(42px,3.8vw,54px) !important;
    height: clamp(42px,3.8vw,54px) !important;
  }
  .home-view .left-page > .favorites small { font-size: 8px; }
}

@media (max-width: 839px) {
  .more-sheet { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: auto repeat(6,minmax(54px,1fr)); }
  .more-sheet > button:is([data-nav],[data-portal]):nth-of-type(6n) { border-right: 1px solid var(--index-line); }
  .more-sheet > button:is([data-nav],[data-portal]):nth-of-type(2n) { border-right: 0; }
  .more-sheet > button:is([data-nav],[data-portal]):last-of-type { grid-column: 1 / -1; border-right: 0; }
  .memo-studio { grid-template-columns: 122px minmax(0,1fr); }
  .memo-archive .section-heading > span { font-size: 16px; white-space: normal; }
  .memo-archive { position: sticky; top: 7px; }
  .memo-history-list { max-height: calc(100dvh - 205px); }
  .memo-workspace .text-memo textarea { height: 342px; padding-right: clamp(112px,42%,165px); }
  .memo-photo { position: absolute; top: 18px; right: 12px; width: clamp(105px,38%,150px); height: 190px; min-height: 0; }
}

@media (max-width: 520px) {
  .memo-studio { grid-template-columns: 92px minmax(0,1fr); gap: 7px; }
  .memo-workspace .text-memo textarea { padding-right: 100px; }
  .memo-photo { width: 92px; height: 145px; right: 9px; }
}

/* v0.6.6 アプリアイコン通常ホーム相当 */
@media (min-width: 840px) {
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile,
  .home-view .right-apps-grid .app-tile {
    width: clamp(58px,4.6vw,68px) !important;
    height: clamp(58px,4.6vw,68px) !important;
  }
}
@media (max-width: 839px) {
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile {
    width: 52px !important;
    height: 52px !important;
  }
}
@media (max-width: 390px) {
  .home-view .left-page > .favorites .app-tile,
  body[data-app-size] .home-view .left-page > .favorites .app-tile {
    width: 47px !important;
    height: 47px !important;
  }
}
