:root {
  color-scheme: light;
  --page: #f3f1ec;
  --panel: rgba(255, 255, 255, 0.82);
  --paper: #fffdf9;
  --soft: #f7f4ee;
  --line: #e5dfd6;
  --line-strong: #d8d1c7;
  --text: #3f403c;
  --muted: #8a8780;
  --green: #6f917e;
  --green-dark: #557564;
  --green-soft: #e8f0ec;
  --bot-border: #e6ddd3;
  --danger: #b86b5f;
  --shadow: 0 16px 42px rgba(91, 83, 70, 0.12);
}

/* 夜モードでも「忘れたい過去」は通常のDocumentsより明確に沈んだ色で残す。 */
.app-shell.night-mode .documents-diary-item.forgotten-diary {
  border-color: #7f8c95;
  background: linear-gradient(135deg, #10161b 0%, #1d262c 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.17), 0 4px 13px rgba(0,0,0,.48);
}

.app-shell.night-mode .documents-diary-item.forgotten-diary .documents-diary-text em,
.app-shell.night-mode .documents-diary-item.forgotten-diary small,
.app-shell.night-mode .documents-diary-item.forgotten-diary .diary-status.locked {
  color: #f2f5f4;
}

.app-shell.night-mode .documents-diary-item.forgotten-diary .diary-status.readable {
  color: #c5f1d3;
}

.app-shell.night-mode .documents-diary-item.forgotten-diary .diary-status.unavailable {
  color: #c1cbd0;
}

/* 絵本の紙面は保ちつつ、閲覧画面そのものは夜向けの落ち着いた色にする。 */
.app-shell.night-mode .blue-gull-panel {
  color: #d9e7e2;
  background:
    radial-gradient(circle at 50% 0%, rgba(64, 98, 95, .44), transparent 46%),
    linear-gradient(135deg, #111d20, #17272a 58%, #122024);
}

.app-shell.night-mode .blue-gull-header > span { color: #d5bf95; }
.app-shell.night-mode .blue-gull-header h1 { color: #e5f0ea; }
.app-shell.night-mode .blue-gull-header p { color: #bbccc5; }
.app-shell.night-mode .blue-gull-book {
  border-color: #69817e;
  box-shadow: 0 16px 38px rgba(0,0,0,.42), inset 0 0 28px rgba(208,193,166,.14);
}
/* 紙の白地に載る絵本文は常に昼用の濃色で読む。 */
.app-shell.night-mode .blue-gull-text-page { color: #4c514f; text-shadow: 0 1px 0 rgba(255,255,255,.68); }
.app-shell.night-mode .blue-gull-text-page h2 { color: #506e62; }
.app-shell.night-mode .blue-gull-panel rt { color: #6e7c74; }
.app-shell.night-mode .blue-gull-book.blue-gull-page-7 .blue-gull-text-page,
.app-shell.night-mode .blue-gull-book.blue-gull-page-7 rt { color: #102e3d; }

/* 夜の展望台では、画面中央上を飛ぶかもめだけが淡くきらめく。 */
.app-shell.night-mode .blue-gull-book.blue-gull-page-4::after {
  position: absolute;
  z-index: 2;
  top: var(--blue-gull-glow-top);
  left: var(--blue-gull-glow-left);
  width: var(--blue-gull-glow-width);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 28% 44%, rgba(238, 254, 255, 1) 0 2.7%, transparent 4.6%),
    radial-gradient(circle at 67% 29%, rgba(255, 249, 205, 1) 0 2.2%, transparent 3.8%),
    radial-gradient(circle at 78% 65%, rgba(222, 246, 255, .98) 0 2%, transparent 3.5%),
    radial-gradient(ellipse at center, rgba(194, 231, 255, .48), rgba(157, 208, 255, .16) 40%, transparent 73%);
  filter: drop-shadow(0 0 9px rgba(181, 232, 255, 1)) drop-shadow(0 0 16px rgba(164, 211, 255, .7));
  content: "";
  animation: blue-gull-night-glimmer 2.7s ease-in-out infinite;
}

@keyframes blue-gull-night-glimmer {
  0%, 100% { opacity: .42; transform: scale(.75) rotate(-8deg); }
  46% { opacity: 1; transform: scale(1.16) rotate(5deg); }
  68% { opacity: .66; transform: scale(.9) rotate(-3deg); }
}

.app-shell.night-mode .blue-gull-question-dock .blue-gull-question,
.app-shell.night-mode .blue-gull-choice { border-color: #4d6665; background: rgba(29, 46, 48, .94); color: #deece6; }
.app-shell.night-mode .blue-gull-question button,
.app-shell.night-mode .blue-gull-pagination button,
.app-shell.night-mode .blue-gull-choice button { border-color: #58746f; background: #253d3d; color: #dcece5; }
.app-shell.night-mode .blue-gull-pagination button:last-child { background: #537f6c; color: #fff; }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  background: #0b80d0;
  color: var(--text);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Times New Roman", serif;
  letter-spacing: 0;
}

/* ARG 内の閲覧順を示す、目立たない背番号。画面そのものではなく、各ページ本文の末尾に置く。 */
.page-number-badge {
  display: block;
  width: max-content;
  margin: 20px 4px 4px auto;
  padding: 2px 0;
  color: #8a9099;
  font: 10px/1.2 "Segoe UI", "ＭＳ Ｐゴシック", sans-serif;
  letter-spacing: .04em;
  pointer-events: none;
  user-select: none;
}
.page-number-badge[hidden] { display: none; }

.memory-dialog form > .page-number-badge {
  position: absolute;
  right: 18px;
  bottom: 14px;
  margin: 0;
}

/* 絵本の番号は紙面に重ね、グリッドの高さを縮めない。 */
.blue-gull-book > .page-number-badge.page-number-blue-gull {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 10px;
  margin: 0;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(255, 252, 244, .72);
  color: rgba(74, 81, 79, .68);
  font-size: 9px;
}

.news-card > .page-number-inline {
  display: block;
  margin: 8px 0 0 auto;
  width: max-content;
  color: rgba(91, 101, 108, .64);
  font: 10px/1 "Segoe UI", "ＭＳ Ｐゴシック", sans-serif;
  letter-spacing: .04em;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.desktop-screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-x: auto;
  overflow-y: hidden;
  background:
    radial-gradient(ellipse at 14% 18%, rgba(89, 213, 255, .82) 0%, rgba(47, 174, 241, .45) 24%, transparent 51%),
    radial-gradient(ellipse at 88% 22%, rgba(45, 139, 255, .72) 0%, rgba(20, 103, 220, .35) 31%, transparent 57%),
    radial-gradient(ellipse at 52% 92%, rgba(0, 202, 232, .56) 0%, rgba(0, 143, 218, .22) 35%, transparent 62%),
    linear-gradient(138deg, #087fcf 0%, #079fe0 36%, #0768cb 69%, #043896 100%);
  background-color: #087fcf;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
}

.desktop-icon {
  position: absolute;
  top: 34px;
  left: 28px;
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 92px;
  min-height: 92px;
  padding: 8px 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  font-size: 13px;
}

.desktop-icon:hover,
.desktop-icon:focus-visible {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.16);
  outline: 0;
}

.desktop-icon:disabled {
  cursor: default;
  opacity: 0.72;
}

.desktop-icon img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
}

.desktop-icon span {
  max-width: 84px;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.desktop-form-link {
  top: 138px;
  color: #fff;
  text-decoration: none;
}

.zoomin-installer-icon { top: 242px; }
.zoomin-installer-icon[hidden] { display: none; }
.zoomin-file-mark { position: relative; display: grid; width: 50px; height: 54px; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #fff 0 72%, #dce7ff 72%); box-shadow: 0 2px 5px rgba(0, 0, 0, .35); }
.zoomin-file-mark::before { position: absolute; top: 7px; left: 7px; width: 36px; height: 35px; border: 2px solid #3677e6; border-radius: 7px; content: ""; }
.zoomin-file-mark i { width: 22px; height: 14px; border-radius: 4px; background: #3677e6; }
.zoomin-installer-icon.newly-available { animation: zoominDesktopReveal 1.2s ease-out; }
@keyframes zoominDesktopReveal { 0% { filter: brightness(1); transform: scale(1); } 38% { filter: brightness(1.8); transform: scale(1.08); } 100% { filter: brightness(1); transform: scale(1); } }

.form-link-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 5px;
  background: #742774;
  box-shadow: inset 0 -8px 0 rgba(43, 12, 57, 0.22), 0 2px 4px rgba(0, 0, 0, 0.28);
  color: #fff;
  font: 700 29px/1 "Segoe UI", system-ui, sans-serif;
}

.desktop-browser {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 52px;
  left: 130px;
  z-index: 6;
  display: grid;
  grid-template-rows: 38px 34px 44px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(137, 150, 166, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(4, 20, 43, 0.42);
  color: #29323d;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.desktop-browser:has(.browser-extension-bar:not([hidden])) {
  grid-template-rows: 38px 35px 34px 44px minmax(0, 1fr);
}

.desktop-browser[hidden] {
  display: none;
}

.desktop-browser.maximized {
  top: 0 !important;
  right: 0 !important;
  bottom: 42px !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0;
}

.browser-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f7f9;
  border-bottom: 1px solid #d9e0e7;
  font-size: 12px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.browser-titlebar > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
}

.browser-logo {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.browser-window-controls {
  align-self: stretch;
  padding-left: 0 !important;
  gap: 0 !important;
}

.browser-window-controls button {
  width: 42px;
  border: 0;
  background: transparent;
  color: #3f4a56;
  font-size: 18px;
  cursor: pointer;
}

.browser-window-controls button:hover,
.browser-window-controls button:focus-visible {
  background: #e5ebf1;
  outline: 0;
}

.browser-window-controls button:last-child:hover,
.browser-window-controls button:last-child:focus-visible {
  background: #c42b1c;
  color: #fff;
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 13px;
  background: #fff;
  border-bottom: 1px solid #e2e8ee;
  color: #667586;
  font-size: 18px;
}

.browser-navigation {
  display: flex;
  align-items: center;
  gap: 2px;
}

.browser-navigation button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #536373;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.browser-navigation button:hover:not(:disabled),
.browser-navigation button:focus-visible:not(:disabled) {
  background: #e9eef3;
  outline: 0;
}

.browser-navigation button:disabled {
  color: #b7c0ca;
  cursor: default;
}

#browserReloadButton { font-size: 20px; }

.browser-tabs {
  display: flex;
  align-items: end;
  gap: 2px;
  padding: 0 8px;
  overflow: hidden;
  overflow-y: hidden;
  background: #eef2f5;
  border-bottom: 1px solid #d9e0e7;
}

.browser-extension-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  overflow: hidden;
  border-bottom: 1px solid #d9e3ee;
  background: linear-gradient(90deg, #f5f8fc, #fff);
  color: #32445b;
  font-size: 12px;
  white-space: nowrap;
}

.browser-extension-bar[hidden] { display: none; }
.timeshift-extension-name { display: inline-flex; align-items: center; gap: 6px; color: #254f84; }
.timeshift-extension-name span { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 5px; background: #dceafa; color: #1764c0; font-size: 15px; font-weight: 700; }
.timeshift-archive-status { min-width: 102px; color: #5c6b7b; }
.timeshift-slider-label { color: #657689; font-size: 11px; }
.timeshift-slider { width: min(290px, 31vw); height: 4px; accent-color: #1670d2; cursor: pointer; direction: rtl; }
.timeshift-year-label { min-width: 57px; color: #174f90; font-weight: 700; text-align: right; }

.timeshift-store-page {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(26px, 5vw, 62px);
  overflow: auto;
  background: linear-gradient(135deg, #f5f9fe, #fff 55%, #eef5fc);
  color: #23364a;
}
.timeshift-store-page[hidden] { display: none; }
.timeshift-store-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; max-width: 870px; padding: 27px 30px; border: 1px solid #d9e3ef; border-radius: 10px; background: #fff; box-shadow: 0 11px 30px rgba(31, 72, 122, .11); }
.timeshift-store-icon, .timeshift-dialog-icon { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #1e7ad6, #28529a); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); color: #fff; font-size: 36px; font-weight: 300; }
.timeshift-store-copy h2, .timeshift-store-copy p, .timeshift-store-detail h3, .timeshift-store-detail p { margin: 0; }
.timeshift-store-eyebrow { margin-bottom: 5px !important; color: #55708e; font-size: 12px; }
.timeshift-store-copy h2 { margin-bottom: 8px; color: #183d69; font-size: 26px; font-weight: 600; }
.timeshift-store-copy > p:not(.timeshift-store-eyebrow):not(.timeshift-store-meta) { color: #4d5e70; font-size: 14px; line-height: 1.65; }
.timeshift-store-meta { margin-top: 14px !important; color: #778697; font-size: 11px; }
.timeshift-install-button, .timeshift-confirm-button { min-width: 136px; padding: 9px 18px; border: 1px solid #106bc4; border-radius: 4px; background: #1675d1; box-shadow: 0 1px 1px rgba(0,0,0,.12); color: #fff; font: 600 13px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer; }
.timeshift-install-button:hover:not(:disabled), .timeshift-confirm-button:hover:not(:disabled) { background: #075fb4; }
.timeshift-install-button:disabled, .timeshift-confirm-button:disabled { border-color: #c4d0dc; background: #e6edf3; color: #6c7b89; cursor: default; }
.timeshift-store-detail { max-width: 870px; padding: 23px 28px; border: 1px solid #e0e8f0; border-radius: 9px; background: rgba(255,255,255,.82); }
.timeshift-store-detail h3 { margin-bottom: 10px; color: #294e79; font-size: 16px; }
.timeshift-store-detail p { color: #536577; font-size: 13px; line-height: 1.75; }
.browser-extension-dialog { position: absolute; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20, 34, 49, .35); }
.browser-extension-dialog[hidden] { display: none; }
.browser-extension-dialog-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; width: min(505px, 100%); padding: 25px; border: 1px solid #bdcbd8; border-radius: 8px; background: #fff; box-shadow: 0 20px 44px rgba(6, 24, 43, .3); }
.timeshift-dialog-icon { width: 45px; height: 45px; border-radius: 10px; font-size: 25px; }
.browser-extension-dialog-card h2, .browser-extension-dialog-card p { margin: 0; }
.browser-extension-dialog-card h2 { color: #23384f; font-size: 16px; font-weight: 600; line-height: 1.45; }
.browser-extension-dialog-card p { margin-top: 9px; color: #566778; font-size: 12px; line-height: 1.65; }
.timeshift-dialog-actions { display: flex; grid-column: 1 / -1; justify-content: end; gap: 8px; margin-top: 3px; }
.timeshift-cancel-button { min-width: 94px; padding: 8px 15px; border: 1px solid #9eaeba; border-radius: 4px; background: #fff; color: #31465c; font: 13px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer; }
.timeshift-cancel-button:hover { background: #f2f6f9; }

.browser-tab {
  align-self: stretch;
  display: flex;
  align-items: center;
  /* タブ数に応じて均等に縮め、20件程度までは横スクロールを出さない。 */
  flex: 1 1 0;
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
  border-radius: 7px 7px 0 0;
  background: transparent;
  color: #536171;
}

.browser-tab[hidden] { display: none; }

.browser-tab.active {
  background: #fff;
  color: #1e2d3a;
}

.browser-tab-main {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  padding: 0 5px 0 10px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  font: 12px/1 "Segoe UI", system-ui, sans-serif;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.browser-tab-close {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  place-items: center;
  padding: 0;
  margin-right: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5e6b7a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.browser-tab-close:hover,
.browser-tab-close:focus-visible { background: #e4e9ef; outline: 0; }

.browser-new-tab-button {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  align-self: center;
  margin: 0 2px 2px 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #455766;
  font: 21px/1 "Segoe UI", system-ui, sans-serif;
}

.browser-new-tab-button:hover,
.browser-new-tab-button:focus-visible { background: #dfe6ec; outline: 0; }

.browser-new-tab-page .browser-logo { width: 52px; height: 52px; }
.browser-restore-prompt { position: absolute; z-index: 25; inset: 0; display: grid; place-items: center; background: rgba(20, 32, 48, .28); }
.browser-restore-prompt[hidden] { display: none; }
.browser-restore-card { width: min(430px, calc(100% - 32px)); padding: 24px 26px 20px; border: 1px solid #c8d1dc; border-radius: 8px; background: #fff; box-shadow: 0 18px 50px rgba(12, 28, 48, .28); color: #24364b; }
.browser-restore-card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.browser-restore-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.browser-restore-actions button { min-width: 72px; padding: 8px 16px; border: 1px solid #aebdce; border-radius: 4px; background: #fff; color: #254b75; cursor: pointer; font: inherit; }
.browser-restore-actions button:first-child { border-color: #1769c2; background: #1769c2; color: #fff; }

.browser-redirect-page {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 17px;
  background: #fff;
  color: #25344a;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

.browser-redirect-page[hidden] {
  display: none;
}

.browser-redirect-logo {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 7px 18px rgba(16, 41, 72, 0.2);
}

.browser-redirect-page p {
  margin: 0;
}

.browser-address {
  flex: 1;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #eef2f5;
  color: #4e5b69;
  font-size: 12px;
}

.browser-address:focus {
  border-color: #78a9e1;
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(52, 123, 207, .14);
}

.browser-download-button { position: relative; display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; padding: 0; margin-left: 5px; border: 0; border-radius: 50%; background: transparent; color: #405264; font: 21px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer; }
.browser-download-button[hidden] { display: none; }
.browser-download-button:hover, .browser-download-button:focus-visible { background: #e2e8ef; outline: 0; }
.browser-download-button.downloading > span { animation: zoominDownloadSpin 1s linear infinite; }
.browser-download-button.complete { color: #126cce; }
.browser-download-button b { position: absolute; top: -3px; right: -5px; display: grid; min-width: 14px; height: 14px; place-items: center; border: 1px solid #fff; border-radius: 50%; background: #2670d9; color: #fff; font: 700 9px/1 "Segoe UI", system-ui, sans-serif; }
@keyframes zoominDownloadSpin { to { transform: rotate(360deg); } }
.browser-download-flyout { position: absolute; z-index: 90; top: 83px; right: 12px; width: min(340px, calc(100% - 24px)); padding: 14px; border: 1px solid #d4dbe4; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(14, 30, 52, .24); font: 13px/1.45 "Segoe UI", system-ui, sans-serif; }
.browser-download-flyout[hidden] { display: none; }
.browser-download-flyout header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; font-size: 14px; }
.browser-download-flyout header button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: #526273; font-size: 18px; cursor: pointer; }
.browser-download-flyout header button:hover { background: #eef2f6; }
.browser-download-item { display: flex; gap: 11px; padding: 10px; border-radius: 7px; background: #f5f8fc; }
.browser-download-file-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 7px; background: #e2ecff; color: #2870d9; }
.browser-download-item strong, .browser-download-item p { display: block; margin: 0; }
.browser-download-item p { margin-top: 2px; color: #667587; font-size: 11px; }
.browser-download-progress { width: 220px; max-width: 100%; height: 4px; margin-top: 9px; overflow: hidden; border-radius: 3px; background: #dce4ee; }
.browser-download-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: #2775dc; transition: width .45s ease; }

.desktop-browser iframe {
  align-self: stretch;
  min-width: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #f3f3f3;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
}
.desktop-browser iframe[hidden] { display: none; }

/* スマホでは iframe の本文末尾でなく、ブラウザの右下に番号を固定する。 */
.desktop-browser > .page-number-badge {
  position: absolute;
  z-index: 8;
  right: 11px;
  bottom: 9px;
  margin: 0;
  padding: 3px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .88);
  color: #7c8793;
  pointer-events: none;
}

.browser-utility-page {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 42px;
  background: #fff;
  color: #27384b;
  font: 14px/1.6 "Segoe UI", system-ui, sans-serif;
  text-align: center;
}

.browser-utility-page[hidden] { display: none; }
.browser-utility-page h2, .browser-utility-page p { margin: 0; }
.browser-utility-page h2 { font-size: 22px; font-weight: 500; }
.browser-utility-page > p:last-child { color: #617083; }
.browser-error-code { color: #536f8e; font-size: 54px; font-weight: 300; letter-spacing: .06em; }

.portal-login-page { background: linear-gradient(135deg, #f5f9fd, #fff 54%, #edf4fb); }
.portal-login-card { width: min(370px, 100%); padding: 35px 38px 32px; border: 1px solid #d9e4ef; border-radius: 10px; background: #fff; box-shadow: 0 14px 35px rgba(44, 81, 128, .13); text-align: left; }
.portal-login-brand { margin: 0 0 20px; color: #335a8d; font-family: Georgia, "Yu Mincho", serif; font-size: 13px; letter-spacing: .1em; }
.portal-login-card h2 { margin: 0 0 24px; color: #263f66; font-size: 21px; font-weight: 600; }
.portal-login-card form { display: grid; gap: 15px; }
.portal-login-card label { display: grid; gap: 7px; color: #50627a; font-size: 12px; font-weight: 700; }
.portal-login-card input { padding: 11px 12px; border: 1px solid #cbd8e6; border-radius: 5px; outline: 0; color: #263d5d; font-size: 13px; }
.portal-login-card input:focus { border-color: #2d70c0; box-shadow: 0 0 0 3px rgba(45, 112, 192, .12); }
.portal-login-card button { margin-top: 5px; padding: 12px; border: 0; border-radius: 5px; background: #1b62bd; color: #fff; font-size: 13px; font-weight: 700; }
.portal-login-hint { min-height: 18px; margin: 0; color: #a22d37; font-size: 11px; line-height: 1.55; }

.boot-screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0b1930;
  backdrop-filter: blur(2px);
}

.boot-screen[hidden] {
  display: none;
}

.app-launch-screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(6, 22, 42, 0.22);
  backdrop-filter: blur(1px);
}

.app-launch-screen[hidden] {
  display: none;
}

.memoria-launch-art {
  position: relative;
  width: min(520px, 72vw);
}

.app-launch-screen img {
  width: min(520px, 72vw);
  max-height: min(420px, 70vh);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.blue-gull-launch-button {
  position: absolute;
  top: 52%;
  left: 62%;
  width: 13%;
  height: 14%;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

/* 待機画面に現れる青いかもめだけを、画面の雰囲気を崩さず見つけやすくする。 */
.blue-gull-launch-button::before,
.blue-gull-launch-button::after {
  position: absolute;
  inset: -42%;
  border-radius: 50%;
  pointer-events: none;
  content: "";
}

.blue-gull-launch-button::before {
  background: radial-gradient(circle at 18% 30%, rgba(231, 251, 255, .98) 0 2.5%, transparent 4%), radial-gradient(circle at 76% 20%, rgba(198, 239, 255, .95) 0 2%, transparent 3.5%), radial-gradient(circle at 83% 72%, rgba(255, 255, 229, .92) 0 2.2%, transparent 3.8%), radial-gradient(circle at 28% 82%, rgba(205, 243, 255, .9) 0 1.8%, transparent 3.2%);
  filter: drop-shadow(0 0 6px rgba(145, 223, 255, .95));
  animation: blue-gull-wait-sparkle 2.5s ease-in-out infinite;
}

.blue-gull-launch-button::after {
  inset: -14%;
  border: 1px solid rgba(174, 231, 255, .58);
  box-shadow: 0 0 13px rgba(104, 205, 247, .54), inset 0 0 10px rgba(202, 245, 255, .42);
  opacity: .4;
  animation: blue-gull-wait-ring 2.5s ease-in-out infinite;
}

@keyframes blue-gull-wait-sparkle {
  0%, 100% { opacity: .35; transform: scale(.78) rotate(-10deg); }
  48% { opacity: 1; transform: scale(1.08) rotate(8deg); }
  68% { opacity: .62; transform: scale(.91) rotate(2deg); }
}

@keyframes blue-gull-wait-ring {
  0%, 100% { opacity: .16; transform: scale(.76); }
  52% { opacity: .72; transform: scale(1.08); }
}

.blue-gull-launch-button:hover,
.blue-gull-launch-button:focus-visible {
  outline: 0;
  background: transparent;
}

.app-login-screen {
  position: absolute;
  top: 14px;
  right: 50%;
  bottom: 62px;
  width: min(1480px, calc(100vw - 28px));
  z-index: 5;
  display: grid;
  place-items: center;
  transform: translateX(50%);
  overflow: hidden;
  border: 1px solid rgba(222, 216, 207, 0.8);
  border-radius: 24px;
  background: rgba(247, 244, 238, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
}

.app-login-screen[hidden] {
  display: none;
}

.memoria-login-form {
  display: grid;
  width: min(340px, calc(100vw - 48px));
  gap: 13px;
  padding: 34px;
  border: 1px solid rgba(216, 209, 199, 0.9);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 24px 70px rgba(91, 83, 70, 0.18);
}

.memoria-login-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6e6a61;
  font-size: 21px;
}

.memoria-login-close:hover,
.memoria-login-close:focus-visible {
  background: rgba(111, 145, 126, 0.15);
  outline: 0;
}

.memoria-login-form > img {
  width: 52px;
  height: 52px;
  margin: 0 auto 2px;
}

.memoria-login-form h1,
.memoria-login-form p {
  margin: 0;
  text-align: center;
}

.memoria-login-form h1 {
  color: var(--green-dark);
  font-size: 25px;
  font-weight: 600;
}

.memoria-login-form > p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.memoria-login-form label {
  display: grid;
  gap: 6px;
  color: #64635d;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.memoria-login-form input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 11px;
  font: 14px/1.2 "Segoe UI", system-ui, sans-serif;
}

.memoria-login-form input:focus {
  border-color: var(--green);
  outline: 2px solid rgba(111, 145, 126, 0.18);
}

.memoria-login-error {
  min-height: 1.4em;
  color: var(--danger);
  font: 12px/1.4 "Segoe UI", system-ui, sans-serif;
}

.memoria-login-form button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

@media (max-width: 900px) {
  .desktop-browser {
    top: 10px;
    right: 8px;
    bottom: 50px;
    left: 8px;
  }

  .app-login-screen {
    top: 10px;
    bottom: 52px;
    width: calc(100vw - 20px);
    max-width: 720px;
  }
}

/* iPhone 等の狭い表示領域では、PC の仮想デスクトップを横にスクロールさせない。 */
@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .desktop-screen {
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

  /* タスクバーは仮想デスクトップでなく端末の表示領域に固定する。 */
  .desktop-taskbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .desktop-taskbar .search-box {
    min-width: 0;
    overflow: hidden;
    padding: 0 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .desktop-taskbar .taskbar-apps {
    justify-content: flex-end;
    gap: 5px;
    padding: 0 7px;
  }

  .desktop-taskbar .taskbar-tray { display: none; }

  /* ブラウザは以前の PC 用座標を使わず、常に閉じるボタンまで見える位置で開く。 */
  .desktop-browser {
    position: fixed;
    top: 10px !important;
    right: 10px !important;
    bottom: 52px !important;
    left: 10px !important;
    width: auto !important;
    height: auto !important;
    max-width: none;
    transform: none !important;
    border-radius: 8px;
  }

  .browser-toolbar { gap: 7px; padding: 0 8px; }
  .browser-address { min-width: 0; }
  .browser-titlebar > div:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .browser-window-controls button { width: 36px; }

  /* TimeShiftは状態表示と年代移動を二段に分け、狭いブラウザ内でもスライダー全体を残す。 */
  .desktop-browser:has(.browser-extension-bar:not([hidden])) {
    grid-template-rows: 38px 66px 34px 44px minmax(0, 1fr);
  }

  .browser-extension-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 25px 25px;
    column-gap: 8px;
    row-gap: 1px;
    align-items: center;
    min-width: 0;
    width: var(--timeshift-visible-width, 100%);
    max-width: var(--timeshift-visible-width, 100%);
    padding: 6px 12px;
    white-space: nowrap;
  }

  .timeshift-extension-name { grid-column: 1; grid-row: 1; font-size: 12px; }
  .timeshift-extension-name span { width: 18px; height: 18px; font-size: 14px; }
  .timeshift-archive-status { grid-column: 2 / -1; grid-row: 1; min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
  .timeshift-slider-label { grid-column: 1; grid-row: 2; font-size: 10px; }
  .timeshift-slider { grid-column: 2; grid-row: 2; width: 100%; min-width: 0; }
  .timeshift-year-label { grid-column: 3; grid-row: 2; min-width: 37px; font-size: 11px; }

  /* ブラウザ内の拡張機能ストアは、PC用の3列カードをそのまま縮めない。 */
  .timeshift-store-page {
    align-content: start;
    gap: 12px;
    padding: 16px 12px 96px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .timeshift-store-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    padding: 18px 16px;
  }
  .timeshift-store-icon { width: 48px; height: 48px; border-radius: 11px; font-size: 28px; }
  .timeshift-store-copy { min-width: 0; }
  .timeshift-store-eyebrow { font-size: 10px; }
  .timeshift-store-copy h2 { font-size: 22px; }
  .timeshift-store-copy > p:not(.timeshift-store-eyebrow):not(.timeshift-store-meta) { font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
  .timeshift-store-meta { font-size: 10px; }
  .timeshift-install-button { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .timeshift-store-detail { width: 100%; padding: 18px 16px; }
  .timeshift-store-detail p { font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
  .browser-extension-dialog { padding: 12px; overflow-y: auto; }
  .browser-extension-dialog-card { grid-template-columns: 42px minmax(0, 1fr); width: 100%; padding: 20px 16px; }
  .timeshift-dialog-actions { flex-wrap: wrap; }
  .timeshift-dialog-actions button { flex: 1 1 130px; min-width: 0; }

  /* 左サイドバーは短いメニューに組み替え、本文と重ならないようにする。 */
  .app-shell {
    position: fixed;
    top: 10px !important;
    right: 10px !important;
    bottom: 52px !important;
    left: 10px !important;
    grid-template-columns: 1fr;
    grid-template-rows: 202px minmax(0, 1fr);
    width: auto !important;
    max-width: none;
    height: auto !important;
    margin: 0;
    transform: none !important;
    border-radius: 22px;
  }

  .case-panel {
    min-height: 0;
    max-height: none;
    padding: 14px 16px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }

  .brand-row { gap: 9px; margin-bottom: 10px; }
  .brand-name { font-size: 27px; }
  .new-chat-button { min-height: 40px; }
  .new-chat-button span { font-size: 21px; }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin: 10px 0 0;
    padding: 0;
    border: 0;
  }

  .side-nav button {
    min-width: 0;
    min-height: 34px;
    gap: 7px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .side-nav span { width: 16px; }
  .recent-block,
  .progress,
  .memoria-window-drag-handle { display: none; }

  .memoria-window-controls { top: 8px; right: 8px; }
  .memoria-window-controls button { width: 34px; height: 30px; }

  /* 丸い操作ボタンはナビゲーションの下端に退避する。 */
  /* memoriaの本文ヘッダーに置き、サイドメニューの文字と重ならないようにする。 */
  .account-menu { top: 214px; right: 14px; }
  .notification-menu { top: 214px; right: 62px; }
  .account-menu-panel,
  .notification-panel { position: fixed; right: 12px; left: 12px; width: auto; }
  .chat-panel { grid-row: 2; }

  /* 付箋は最初から画面内に置き、見出しを指でつかんで移動できる。 */
  .sticky-notes-app {
    right: auto !important;
    bottom: 56px;
    left: 12px;
    width: min(310px, calc(100vw - 24px));
    max-height: calc(100dvh - 72px);
    overflow: auto;
  }

  .sticky-notes-header {
    position: sticky;
    top: 0;
    cursor: grab;
    touch-action: none;
  }

  .sticky-notes-header.dragging { cursor: grabbing; }
}

/* スマホでは会話を主画面にし、必要な機能だけを左メニューにまとめる。 */
.mobile-menu-toggle,
.mobile-menu-backdrop { display: none; }

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }
  .chat-panel { grid-row: 1; }
  .app-shell:not(.night-mode) .chat-panel {
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.72), transparent 32%), #f8fbfa;
  }

  .mobile-menu-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 46;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    color: #5d6968;
    font: 22px/1 system-ui, sans-serif;
    cursor: pointer;
  }

  .mobile-menu-toggle:hover,
  .mobile-menu-toggle:focus-visible {
    background: #f1f5f2;
    outline: 0;
  }

  .mobile-menu-backdrop {
    position: absolute;
    z-index: 55;
    display: block;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(29, 44, 45, 0.25);
    cursor: default;
  }

  .mobile-menu-backdrop[hidden] { display: none; }

  .case-panel {
    position: absolute;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 86vw);
    max-height: none;
    box-sizing: border-box;
    padding: 18px 16px 20px;
    border: 0;
    border-radius: 0 20px 20px 0;
    background: #faf9f6;
    box-shadow: 10px 0 24px rgba(23, 40, 39, 0.16);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.2s ease, visibility 0.2s ease;
    visibility: hidden;
  }

  .app-shell.mobile-menu-open .case-panel {
    transform: translateX(0);
    visibility: visible;
  }

  .brand-row { margin-bottom: 16px; }
  .new-chat-button { min-height: 46px; }
  .side-nav {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-top: 12px;
  }

  .mobile-menu-utilities {
    display: grid;
    gap: 6px;
    margin-top: 14px;
  }

  .mobile-menu-utilities .account-menu,
  .mobile-menu-utilities .notification-menu {
    position: relative;
    top: auto;
    right: auto;
    z-index: auto;
  }

  .mobile-menu-utilities .profile-button,
  .mobile-menu-utilities .notification-button {
    display: flex;
    width: 100%;
    height: 40px;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 18px;
  }

  .mobile-menu-utilities .profile-button::after {
    content: '계정·표시 모드';
    font: 600 13px/1 system-ui, sans-serif;
  }

  .mobile-menu-utilities .notification-button::after {
    content: '알림';
    font: 600 13px/1 system-ui, sans-serif;
  }

  .mobile-menu-utilities .account-menu-panel,
  .mobile-menu-utilities .notification-panel {
    position: absolute;
    z-index: 65;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    width: auto;
    max-height: min(360px, calc(100dvh - 220px));
  }

  .chat-header {
    min-height: 70px;
    box-sizing: border-box;
    padding: 16px 62px 10px;
  }

  .chat-title { text-align: left; }
  .chat-title h1 { font-size: 25px; }
  .chat-title p { font-size: 11px; }
  .messages { padding: 8px 14px 18px; }
  .message-row { width: 100%; }
  .message-row.assistant .message-stack { max-width: calc(100% - 104px); }
  .chat-form {
    width: calc(100% - 24px);
    margin: 0 12px;
    padding: 9px 11px 9px 14px;
  }
  .chat-form button { width: 44px; min-height: 44px; }

  /* gridの暗黙行を使わず、時刻と日付をひとまとまりに中央配置する。 */
  .desktop-taskbar .desktop-clock {
    display: flex;
    width: 72px;
    min-width: 72px;
    height: 42px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 2px 4px;
    font-size: 10px;
    line-height: 1.05;
    text-align: center;
  }

  .desktop-taskbar .desktop-clock #desktopTime {
    display: block;
    line-height: 1.05;
  }

  .desktop-taskbar .desktop-clock #desktopDate {
    display: block;
    font-size: 8px;
    line-height: 1.05;
    white-space: nowrap;
  }
}

/* スマホでもニュースとカレンダーを開けるよう、タスクバー右側を小型表示する。 */
@media (max-width: 900px) {
  .desktop-taskbar { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .desktop-taskbar .search-box { display: none; }
  .desktop-taskbar .taskbar-apps { justify-content: flex-start; gap: 4px; padding-left: 5px; }
  .desktop-taskbar .taskbar-tray { display: flex; align-items: center; height: 100%; }
  .desktop-taskbar .taskbar-tray > span,
  .desktop-taskbar .taskbar-tray .final-countdown { display: none !important; }
  .desktop-taskbar .news-toggle { width: auto; min-width: 76px; padding: 0 5px; justify-content: flex-start; gap: 3px; }
  .desktop-taskbar .news-toggle > span:last-child { display: grid; max-width: 52px; }
  .desktop-taskbar .news-toggle strong { display: none; }
  .desktop-taskbar .news-toggle small { display: block; overflow: hidden; font-size: 8px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-taskbar .news-weather-mark { flex: 0 0 auto; font-size: 17px; }
  .desktop-taskbar .desktop-clock { min-width: 72px; padding: 0 5px; font-size: 9px; line-height: 1.25; text-align: center; }
  .desktop-taskbar .desktop-clock #desktopDate { display: block; font-size: 8px; white-space: nowrap; }

  /* 固定配置したアプリ内でも、通知と表示モードのポップアップは画面内に開く。 */
  .account-menu-panel,
  .notification-panel {
    position: fixed;
    top: 274px;
    right: 12px;
    left: 12px;
    z-index: 100;
    width: auto;
    max-height: calc(100dvh - 340px);
  }
}

.boot-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
  opacity: 0.7;
  pointer-events: none;
}

.boot-screen::after {
  position: absolute;
  right: -10%;
  bottom: -42%;
  left: -10%;
  height: 56%;
  content: "";
  background: radial-gradient(ellipse at center, rgba(87, 157, 225, 0.22), transparent 66%);
  animation: remoteGlow 2.2s ease-out both;
  pointer-events: none;
}

.remote-connection {
  position: relative;
  z-index: 1;
  width: min(380px, calc(100vw - 48px));
  padding: 34px 38px 30px;
  border: 1px solid rgba(187, 219, 255, 0.28);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(20, 48, 81, 0.95), rgba(9, 28, 53, 0.95));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44), inset 0 1px rgba(255, 255, 255, 0.08);
  color: #eef6ff;
  text-align: center;
  animation: remoteWindow 360ms ease-out both;
}

.remote-connection-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid rgba(192, 225, 255, 0.55);
  border-radius: 7px;
  color: #b9dcff;
  font-size: 18px;
}

.remote-connection p,
.remote-connection h1 {
  margin: 0;
}

.remote-connection-label {
  color: rgba(225, 240, 255, 0.72);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.remote-connection h1 {
  margin-top: 8px;
  color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 23px;
  font-weight: 500;
}

.remote-connection-status {
  min-height: 1.6em;
  margin-top: 26px !important;
  color: #d9ebff;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

.remote-connection-progress {
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(194, 224, 255, 0.2);
}

.remote-connection-progress span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #d9efff, transparent);
  animation: remoteProgress 1.05s ease-in-out infinite;
}

.remote-connection-note {
  margin-top: 12px !important;
  color: rgba(210, 232, 255, 0.56);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
}

@keyframes remoteWindow {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes remoteProgress {
  from { transform: translateX(-120%); }
  to { transform: translateX(350%); }
}

@keyframes remoteGlow {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .boot-screen::after,
  .remote-connection,
  .remote-connection-progress span {
    animation: none;
  }
}

.desktop-taskbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  /* 接続中のオーバーレイより下を一つの重なり順として保つ。 */
  z-index: 1;
  display: grid;
  grid-template-columns: 44px minmax(180px, 330px) 1fr auto;
  align-items: center;
  height: 42px;
  background: rgba(24, 28, 34, 0.92);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.start-button {
  display: grid;
  place-items: center;
  height: 100%;
  width: 48px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 20px;
}

.start-button:hover,
.start-button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: 0;
}

.start-menu {
  position: fixed;
  bottom: 50px;
  left: 8px;
  z-index: 7;
  width: min(340px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid rgba(213, 221, 231, 0.95);
  border-radius: 10px;
  background: rgba(247, 249, 252, 0.98);
  box-shadow: 0 18px 50px rgba(18, 29, 45, 0.34);
  color: #25313e;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.start-menu[hidden] {
  display: none;
}

.start-menu-title {
  margin: 2px 4px 14px;
  font-size: 16px;
  font-weight: 600;
}

.start-account {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.start-account:hover,
.start-account:focus-visible {
  background: #e9eff7;
  outline: 0;
}

.start-account-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #617e9b;
  color: #fff;
  font-size: 18px;
}

.start-account strong,
.start-account small,
.start-account em {
  display: block;
}

.start-account strong {
  font-size: 14px;
}

.start-account small {
  margin-top: 2px;
  color: #657384;
  font-size: 11px;
}

.start-account em {
  margin-top: 2px;
  color: #657384;
  font-size: 11px;
  font-style: normal;
}

.start-account-email {
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.start-menu-apps {
  display: flex;
  justify-content: space-between;
  margin: 11px 4px 1px;
  padding: 12px 8px 3px;
  border-top: 1px solid #dde4ed;
  color: #4d5b6a;
  font-size: 12px;
}

.start-reset-menu-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #c9d7e6;
  border-radius: 7px;
  background: #f7fbff;
  color: #315a82;
  font: 600 12px "Segoe UI", system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.start-reset-menu-button:hover,
.start-reset-menu-button:focus-visible {
  border-color: #8eafd0;
  background: #edf6ff;
  outline: 0;
}

.start-reset-options[hidden] {
  display: none;
}

.start-reset-options {
  margin-top: 2px;
}

.start-reset-button {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d9c5c5;
  border-radius: 7px;
  background: #fffafa;
  color: #a64d4d;
  font: 600 12px "Segoe UI", system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.start-reset-button:hover,
.start-reset-button:focus-visible {
  border-color: #c98282;
  background: #fff1f1;
  outline: 0;
}

.start-countdown-reset-button {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #3c3c3c;
  border-radius: 7px;
  background: #151515;
  color: #ff5a5a;
  font: 600 12px "Segoe UI", system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.start-countdown-reset-button:hover,
.start-countdown-reset-button:focus-visible {
  border-color: #ac4545;
  background: #262020;
  outline: 0;
}

.search-box {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #555;
  font-size: 13px;
}

.taskbar-apps {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding-left: 18px;
}

.taskbar-apps span {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
}

.taskbar-apps .active {
  background: rgba(111, 145, 126, 0.8);
}

.taskbar-memoria-icon {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
}

.taskbar-memoria-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.taskbar-memoria-icon::after {
  position: absolute;
  right: 7px;
  bottom: 2px;
  left: 7px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  content: "";
}

.taskbar-memoria-icon.minimized {
  background: transparent;
  opacity: 0.7;
}

.taskbar-memoria-icon.minimized::after {
  opacity: 0;
}

.taskbar-memoria-icon:hover,
.taskbar-memoria-icon:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: 0;
}

.taskbar-browser-icon {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
}

.taskbar-browser-icon::after {
  position: absolute;
  right: 7px;
  bottom: 2px;
  left: 7px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  content: "";
}

.taskbar-browser-icon .browser-logo {
  width: 25px;
  height: 25px;
}

.taskbar-browser-icon.minimized {
  background: transparent;
  opacity: 0.7;
}

.taskbar-browser-icon.minimized::after {
  opacity: 0;
}

.taskbar-browser-icon:hover,
.taskbar-browser-icon:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: 0;
}

.taskbar-message-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: #4b92d4;
}

.taskbar-message-icon::before {
  position: absolute;
  top: 7px;
  left: 6px;
  width: 16px;
  height: 12px;
  border-radius: 7px;
  background: #fff;
  content: "";
}

.taskbar-message-icon::after {
  position: absolute;
  bottom: 6px;
  left: 8px;
  width: 5px;
  height: 5px;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  content: "";
}

.sms-unread-badge {
  position: absolute;
  z-index: 5;
  top: -7px;
  right: -9px;
  display: grid;
  width: max-content;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #d92d2d !important;
  color: #fff !important;
  font: 700 10px/1 "Segoe UI", system-ui, sans-serif;
}

.sms-unread-badge[hidden] {
  display: none;
}

#messagesDesktopIcon .sms-unread-badge {
  display: grid;
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  box-sizing: border-box;
  border-radius: 50%;
  background: #d92d2d !important;
  color: #fff !important;
}

#messagesDesktopIcon .sms-unread-badge[hidden] {
  display: none;
}

.taskbar-message-icon:hover,
.taskbar-message-icon:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.48);
  outline: 0;
}

.taskbar-sticky-notes-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: #f4c643;
}

.taskbar-sticky-notes-icon::before {
  position: absolute;
  inset: 5px;
  border-radius: 1px;
  background: #fff4a6;
  content: "";
}

.taskbar-sticky-notes-icon::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 7px;
  height: 7px;
  background: #f4c643;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  content: "";
}

.taskbar-sticky-notes-icon:hover,
.taskbar-sticky-notes-icon:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.48);
  outline: 0;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  white-space: nowrap;
}

.final-countdown {
  display: inline-grid;
  min-width: 78px;
  padding: 4px 7px;
  border: 1px solid #801a1a;
  background: #050505;
  box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.24), 0 0 8px rgba(255, 0, 0, 0.14);
  color: #ff3131;
  font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 0 7px rgba(255, 44, 44, 0.82);
}

.final-countdown[hidden] {
  display: none;
}

/* body直下へ移したため、仮想デスクトップ内のどのウィンドウにも隠れない。 */
body > .final-countdown:not([hidden]) {
  position: fixed;
  z-index: 2147483646;
  top: 10px;
  left: 10px;
  pointer-events: none;
}

.final-countdown.is-resetting {
  animation: final-countdown-reset-flash .42s steps(2, end) 1;
}

@keyframes final-countdown-reset-flash {
  0%, 100% { background: #050505; color: #ff3131; box-shadow: inset 0 0 10px rgba(255, 0, 0, .24), 0 0 8px rgba(255, 0, 0, .14); }
  50% { background: #ff4444; color: #fff; box-shadow: 0 0 19px rgba(255, 57, 57, .95); }
}

/* アプリを含むデスクトップ全体を一度だけフラッシュさせる。 */
body.final-countdown-resetting::after {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  background: #fff;
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: final-countdown-screen-flash .42s ease-out 1;
}

/* 誤った暗証番号ルートのエンディング遷移。画面を白へ収束させてから別ページを表示する。 */
body.ending-a-transition::after,
body.ending-b-transition::after {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  background: #fff;
  content: "";
  pointer-events: none;
  animation: ending-b-whiteout .56s ease-in forwards;
}

@keyframes ending-b-whiteout {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes final-countdown-screen-flash {
  0% { opacity: 0; }
  24% { opacity: .76; }
  52% { opacity: .18; }
  100% { opacity: 0; }
}

.desktop-clock {
  display: grid;
  min-width: 78px;
  height: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: 12px/1.2 "Segoe UI", system-ui, sans-serif;
  text-align: right;
}

.desktop-clock:hover,
.desktop-clock:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: 0;
}

.news-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: 11px/1.1 "Segoe UI", system-ui, sans-serif;
  text-align: left;
}

.news-toggle > span:last-child {
  display: grid;
  gap: 1px;
}

.news-toggle strong,
.news-toggle small {
  font: inherit;
}

.news-toggle small {
  color: rgba(255, 255, 255, 0.68);
}

.news-weather-mark {
  color: #c5e2f4;
  font-size: 20px;
}

.news-toggle:hover,
.news-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: 0;
}

.news-toggle.has-unread-breaking {
  position: relative;
  background: rgba(235, 188, 37, 0.22);
  box-shadow: inset 0 -2px #f3c733;
}

.news-toggle.has-unread-breaking::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border: 1px solid #1a2330;
  border-radius: 50%;
  background: #f4ca35;
  content: "";
}

.calendar-flyout {
  position: fixed;
  right: 10px;
  bottom: 50px;
  z-index: 50;
  width: min(334px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid rgba(210, 216, 225, 0.9);
  border-radius: 10px;
  background: rgba(247, 250, 254, 0.98);
  box-shadow: 0 18px 48px rgba(13, 25, 42, 0.32);
  color: #27313d;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.calendar-flyout[hidden] {
  display: none;
}

.news-flyout {
  position: fixed;
  right: 10px;
  bottom: 50px;
  z-index: 40;
  width: min(460px, calc(100vw - 28px));
  max-height: min(660px, calc(100svh - 70px));
  overflow-y: auto;
  border: 1px solid rgba(198, 210, 223, 0.96);
  border-radius: 12px;
  background: #f4f8fb;
  box-shadow: 0 22px 64px rgba(20, 31, 45, 0.34);
  color: #263542;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.news-flyout[hidden] {
  display: none;
}

/* トップストーリーは一覧全体で一つのページ。長い一覧をスクロール中でも、
   統合番号が見失われないようパネル右下に固定する。 */
.news-flyout > .page-number-badge {
  /* news-flyout 自身がスクロール領域なので absolute では本文と一緒に
     動いてしまう。画面右下へ固定して、一覧のどの位置でも確認できるようにする。 */
  position: fixed;
  z-index: 41;
  right: 22px;
  bottom: 60px;
  margin: 0;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(244, 248, 251, .86);
}

.news-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 112px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #417fae, #78a5c5);
  color: #fff;
}

.news-header p,
.news-header h2,
.news-header small {
  margin: 0;
}

.news-header p,
.news-header small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.news-header h2 {
  margin: 5px 0;
  font-size: 26px;
  font-weight: 500;
}

.news-header-weather {
  font-size: 54px;
  opacity: 0.82;
}

.news-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.news-close-button:hover,
.news-close-button:focus-visible {
  background: rgba(255, 255, 255, 0.34);
  outline: 0;
}

.news-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 17px 18px 10px;
}

.news-section-title h3,
.news-section-title span {
  margin: 0;
}

.news-section-title h3 {
  font-size: 16px;
}

.news-section-title span {
  color: #778798;
  font-size: 11px;
}

.news-section-title.has-unread-breaking {
  margin: 10px 12px 0;
  padding: 10px 8px;
  border: 1px solid #e3b732;
  border-radius: 7px;
  background: #fff3bd;
}

.news-section-title.has-unread-breaking h3,
.news-section-title.has-unread-breaking span {
  color: #6d5100;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.news-card {
  min-height: 125px;
  padding: 13px;
  border: 1px solid #dce5ed;
  border-radius: 9px;
  background: #fff;
}

.news-card.featured {
  grid-column: 1 / -1;
  min-height: 110px;
  background: linear-gradient(135deg, #fff, #edf6fb);
}

.news-card.breaking-news.unread {
  border-color: #d9ae2a;
  background: linear-gradient(135deg, #fff8d4, #ffeb91) !important;
  box-shadow: 0 0 0 3px rgba(236, 198, 67, 0.32);
}

.news-card.breaking-news.unread span {
  color: #b57600;
}

.news-card span {
  color: #4180af;
  font-size: 11px;
  font-weight: 700;
}

.news-card h4,
.news-card p,
.news-card small {
  margin: 0;
}

.news-card h4 {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.45;
}

.news-card p {
  margin-top: 7px;
  color: #5e6c79;
  font-size: 12px;
  line-height: 1.45;
}

.news-detail-link {
  margin-left: 6px;
  color: #176cc0;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.news-detail-link:hover,
.news-detail-link:focus-visible {
  color: #0b4f94;
}

.news-card small {
  display: block;
  margin-top: 10px;
  color: #84919d;
  font-size: 10px;
}

.news-ad {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 42% 1fr;
  overflow: hidden;
  border: 1px solid #d8dfd4;
  border-radius: 9px;
  background: #f9faf7;
}

.news-ad img {
  width: 100%;
  height: 142px;
  object-fit: contain;
  background: #eef1ec;
}

.news-ad-copy {
  padding: 14px;
}

.news-ad-copy span {
  color: #81897f;
  font-size: 10px;
}

.news-ad-copy h4,
.news-ad-copy p,
.news-ad-copy small {
  margin: 0;
}

.news-ad-copy h4 {
  margin-top: 6px;
  color: #4e6759;
  font-size: 15px;
  line-height: 1.45;
}

.news-ad-copy p {
  margin-top: 7px;
  color: #657166;
  font-size: 12px;
  line-height: 1.5;
}

.news-ad-copy small {
  display: block;
  margin-top: 10px;
  color: #8a958a;
  font-size: 10px;
}

@media (max-width: 520px) {
  .news-list {
    grid-template-columns: 1fr;
  }

  .news-card.featured {
    grid-column: auto;
  }

  .news-ad {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .news-ad img {
    height: 158px;
  }
}

.sms-app {
  position: fixed;
  right: 18px;
  bottom: 58px;
  z-index: 20;
  display: grid;
  grid-template-rows: auto auto minmax(170px, 1fr) auto auto;
  width: min(360px, calc(100vw - 32px));
  height: min(500px, calc(100svh - 90px));
  overflow: hidden;
  border: 1px solid rgba(194, 203, 216, 0.96);
  border-radius: 12px;
  background: #f5f7fa;
  box-shadow: 0 20px 60px rgba(20, 31, 45, 0.34);
  color: #283541;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.sms-app[hidden] {
  display: none;
}

.sticky-notes-app {
  position: fixed;
  right: 106px;
  bottom: 66px;
  z-index: 60;
  width: min(310px, calc(100vw - 32px));
  min-height: 250px;
  overflow: hidden;
  background: #fff3a4;
  box-shadow: 0 16px 38px rgba(50, 42, 12, 0.32);
  color: #3e3514;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.sticky-notes-app[hidden] {
  display: none;
}

.sticky-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding-left: 13px;
  background: #efd453;
}

.sticky-notes-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.sticky-notes-header button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #62551b;
  font-size: 20px;
}

.sticky-notes-header button:hover,
.sticky-notes-header button:focus-visible {
  background: rgba(255, 255, 255, 0.34);
  outline: 0;
}

.sticky-notes-content {
  margin: 0;
  padding: 22px 19px;
  white-space: pre-line;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.75;
}

.sms-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid #dbe1e9;
  background: #fff;
}

.sms-app-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sms-app-header h2 {
  margin: 0;
  font-size: 16px;
}

.sms-app-mark {
  color: #4b92d4;
  font-size: 14px;
}

.sms-app-header button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #667585;
  font-size: 20px;
}

.sms-app-header button:hover,
.sms-app-header button:focus-visible {
  background: #e9eef5;
  outline: 0;
}

.sms-recipient {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #dbe1e9;
  background: #fff;
  color: #647383;
  font-size: 12px;
}

.sms-recipient input,
.sms-compose textarea {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #283541;
  font: 14px "Segoe UI", system-ui, sans-serif;
}

.sms-recipient input {
  flex: 1;
}

.sms-recipient input:focus,
.sms-compose textarea:focus {
  outline: 0;
}

.sms-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 14px;
}

.sms-empty {
  margin: auto;
  color: #8a96a3;
  font-size: 13px;
}

.sms-bubble {
  max-width: 78%;
  padding: 8px 11px;
  border-radius: 14px 14px 3px 14px;
  background: #4b92d4;
  color: #fff;
  align-self: end;
}

.sms-bubble small,
.sms-bubble p {
  margin: 0;
}

.sms-bubble small {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

.sms-bubble p {
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sms-bubble p a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.sms-bubble.incoming {
  align-self: start;
  border-radius: 14px 14px 14px 3px;
  background: #e7ebef;
  color: #26333d;
}

.sms-bubble.incoming small {
  color: #71808c;
}

.sms-map-attachment {
  display: block;
  width: min(320px, 100%);
  margin-top: 9px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(20, 42, 57, 0.17);
  border-radius: 11px;
  background: #fff;
  cursor: zoom-in;
}

.sms-map-attachment img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.sms-image-dialog {
  width: min(960px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 14px;
  border: 0;
  border-radius: 14px;
  background: #18232b;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
}

.sms-image-dialog::backdrop {
  background: rgba(5, 12, 18, 0.72);
}

.sms-image-dialog form { position: relative; margin: 0; }

.sms-image-dialog img {
  display: block;
  max-width: min(920px, calc(100vw - 76px));
  max-height: calc(100vh - 88px);
  object-fit: contain;
}

.sms-image-dialog-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 22, 30, 0.8);
  color: #fff;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.zoomin-download-page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
  color: #182235;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.zoomin-site-header {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 0 5.5%;
  border-bottom: 1px solid #e6e9ef;
  gap: 34px;
}

.zoomin-site-header a { color: inherit; text-decoration: none; }

.zoomin-brand {
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -1.8px;
  color: #2468ee !important;
}

.zoomin-brand span { color: #182235; }

.zoomin-site-header nav { display: flex; gap: 24px; font-size: 13px; }
.zoomin-site-header nav a:first-child { color: #2468ee; font-weight: 700; }
.zoomin-signin { margin-left: auto; font-size: 13px; font-weight: 600; }

.zoomin-download-main {
  width: min(960px, calc(100% - 48px));
  margin: 0 auto;
  padding: 62px 0 72px;
  text-align: center;
}

.zoomin-eyebrow { margin: 0 0 12px; color: #687386; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.zoomin-download-main h2 { margin: 0; font-size: clamp(29px, 4vw, 44px); letter-spacing: -1.7px; }
.zoomin-lead { margin: 18px 0 35px; color: #586477; font-size: 16px; line-height: 1.75; }

.zoomin-primary-download {
  display: flex;
  align-items: center;
  max-width: 690px;
  margin: 0 auto;
  padding: 24px 26px;
  border: 1px solid #dfe5ee;
  border-radius: 15px;
  box-shadow: 0 12px 34px rgba(29, 55, 95, 0.1);
  text-align: left;
  gap: 17px;
}

.zoomin-app-mark {
  display: grid;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  place-items: center;
  background: #2468ee;
}

.zoomin-app-mark i { width: 25px; height: 17px; border-radius: 5px; background: #fff; }
.zoomin-primary-download h3 { margin: 0 0 5px; font-size: 17px; }
.zoomin-primary-download p { margin: 0 0 6px; color: #556174; font-size: 13px; }
.zoomin-primary-download small { color: #7a8493; font-size: 11px; }
.zoomin-primary-download button { margin-left: auto; padding: 12px 19px; border: 0; border-radius: 8px; background: #2468ee; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }

.zoomin-download-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; text-align: left; }
.zoomin-download-grid article { min-height: 155px; padding: 23px; border: 1px solid #e2e7ef; border-radius: 12px; }
.zoomin-download-grid article > span { color: #2468ee; font-size: 23px; }
.zoomin-download-grid h3 { margin: 14px 0 7px; font-size: 15px; }
.zoomin-download-grid p { min-height: 39px; margin: 0; color: #657185; font-size: 12px; line-height: 1.6; }
.zoomin-download-grid a { display: inline-block; margin-top: 12px; color: #2468ee; font-size: 12px; font-weight: 700; text-decoration: none; }

.taskbar-zoomin-icon { position: relative; display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 6px; background: #2d71e6; color: #fff; font-size: 18px; cursor: pointer; }
.taskbar-zoomin-icon[hidden] { display: none; }
.taskbar-zoomin-icon::after { position: absolute; right: 7px; bottom: 2px; left: 7px; height: 2px; border-radius: 2px; background: #fff; content: ""; }
.taskbar-zoomin-icon.minimized { background: transparent; opacity: .72; }
.taskbar-zoomin-icon.minimized::after { opacity: 0; }
.taskbar-zoomin-icon:hover, .taskbar-zoomin-icon:focus-visible { box-shadow: 0 0 0 2px rgba(255,255,255,.48); outline: 0; }

.zoomin-installer-window, .zoomin-app { position: fixed; z-index: 8; overflow: hidden; border: 1px solid #aab8cb; border-radius: 8px; background: #fff; box-shadow: 0 20px 54px rgba(6, 24, 48, .42); color: #1d2a3d; font-family: "Segoe UI", system-ui, sans-serif; }
.zoomin-installer-window[hidden], .zoomin-app[hidden] { display: none; }
.zoomin-installer-window { top: 21%; left: 50%; width: min(560px, calc(100vw - 32px)); transform: translateX(-50%); }
.zoomin-window-titlebar, .zoomin-app-titlebar { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 11px 0 14px; background: #f6f8fb; border-bottom: 1px solid #dbe2eb; font-size: 13px; }
.zoomin-window-titlebar > div, .zoomin-app-titlebar > div { display: flex; align-items: center; gap: 8px; }
.zoomin-window-titlebar button, .zoomin-app-titlebar button { display: grid; width: 31px; height: 29px; place-items: center; border: 0; background: transparent; color: #45566b; font-size: 17px; cursor: pointer; }
.zoomin-window-titlebar button:hover, .zoomin-app-titlebar button:hover { background: #e4eaf2; }
.zoomin-mini-mark, .zoomin-installer-large-mark { display: grid; place-items: center; border-radius: 8px; background: #2d71e6; color: #fff; }
.zoomin-mini-mark { width: 21px; height: 21px; font-size: 13px; }
.zoomin-installer-content { display: grid; grid-template-columns: 68px 1fr; gap: 22px; align-items: start; min-height: 178px; padding: 36px 40px; }
.zoomin-installer-large-mark { width: 58px; height: 58px; border-radius: 16px; font-size: 30px; }
.zoomin-installer-content h2, .zoomin-installer-content p { margin: 0; }
.zoomin-installer-content h2 { margin-top: 4px; font-size: 21px; }
.zoomin-installer-content p { margin-top: 12px; color: #59687a; font-size: 13px; line-height: 1.7; }
.zoomin-installer-window footer { display: flex; justify-content: end; gap: 8px; padding: 13px 18px; border-top: 1px solid #dbe2eb; background: #f7f9fc; }
.zoomin-installer-window footer button { min-width: 88px; padding: 8px 14px; border: 1px solid #afbdce; border-radius: 4px; background: #fff; color: #314257; font: 13px "Segoe UI", system-ui, sans-serif; cursor: pointer; }
.zoomin-installer-window footer button:last-child { border-color: #1d68d7; background: #2872db; color: #fff; }
.zoomin-installer-window footer button:disabled { cursor: default; opacity: .65; }
.zoomin-install-progress-wrap { margin-top: 18px; }
.zoomin-install-progress-wrap > div { width: 100%; height: 7px; overflow: hidden; border-radius: 5px; background: #dde4ec; }
.zoomin-install-progress-wrap i { display: block; width: 0; height: 100%; background: #2872db; transition: width .1s linear; }
.zoomin-install-progress-wrap small { display: block; margin-top: 7px; color: #627187; font-size: 11px; }

.zoomin-app { top: 50%; left: 50%; width: min(68vw, 1120px); height: min(72vh, 720px); min-width: 680px; transform: translate(-50%, -50%); border-color: #d3d9e1; border-radius: 10px; background: #dce1e7; }
.zoomin-app-titlebar { height: 52px; padding: 0 13px; border: 0; background: #dce1e7; cursor: move; user-select: none; touch-action: none; }
.zoomin-app-title { min-width: 104px; gap: 7px !important; color: #515a65; font-size: 15px; line-height: .83; letter-spacing: -.5px; }
.zoomin-app-title strong small { font-size: 14px; }
.zoomin-app-title .zoomin-mini-mark { width: 23px; height: 23px; border-radius: 7px; background: #2873e9; }
.zoomin-app-title .zoomin-mini-mark i { width: 13px; height: 9px; border-radius: 3px; background: #fff; }
.zoomin-search { display: flex; width: min(45%, 360px); height: 34px; align-items: center; gap: 6px; padding: 0 12px; margin-left: 17px; border-radius: 10px; background: #cbd1d8; color: #3e464f; font-size: 18px; }
.zoomin-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #27313d; font: 13px "Segoe UI", system-ui, sans-serif; }
.zoomin-search input::placeholder { color: #3c4550; }
.zoomin-title-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.zoomin-title-actions button { display: grid; width: 27px; height: 27px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #38434e; font-size: 16px; cursor: pointer; }
.zoomin-title-actions button:hover { background: rgba(255,255,255,.45); }
.zoomin-app-content { display: grid; grid-template-columns: 110px minmax(0, 1fr); height: calc(100% - 52px); padding: 0 7px 7px; background: #dce1e7; }
.zoomin-side-nav { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 5px 5px 8px 0; }
.zoomin-side-nav button { display: grid; place-items: center; gap: 3px; min-height: 55px; padding: 5px 3px; border: 0; border-radius: 10px; background: transparent; color: #303a45; font: 11px "Segoe UI", system-ui, sans-serif; cursor: pointer; }
.zoomin-side-nav button:hover { background: rgba(255,255,255,.45); }
.zoomin-side-nav button.active { background: #fff; }
.zoomin-side-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zoomin-side-nav button strong { height: 22px; font-size: 17px; line-height: 13px; letter-spacing: 2px; }
.zoomin-side-nav .zoomin-settings { margin-top: auto; }
.zoomin-home { min-width: 0; overflow: auto; border-radius: 14px; background: #fff; }
.zoomin-home-time { display: grid; justify-items: center; padding-top: clamp(28px, 3.8vh, 52px); color: #272c32; }
.zoomin-home-time strong { font-size: clamp(38px, 3.8vw, 57px); letter-spacing: -2px; line-height: 1; }
.zoomin-home-time span { margin-top: 12px; color: #6d7183; font-size: clamp(14px, 1.25vw, 19px); font-weight: 600; }
.zoomin-home-actions { display: flex; justify-content: center; gap: clamp(10px, 2vw, 28px); margin-top: clamp(28px, 4.2vh, 51px); padding: 0 16px; }
.zoomin-home-actions button { display: grid; justify-items: center; gap: 8px; width: min(96px, 14vw); border: 0; background: transparent; color: #676e7b; font: 600 clamp(11px, 1vw, 14px) "Segoe UI", system-ui, sans-serif; cursor: pointer; }
.zoomin-home-actions i { display: grid; width: clamp(49px, 5.4vw, 68px); height: clamp(49px, 5.4vw, 68px); place-items: center; border-radius: 17px; background: #1473e8; box-shadow: 0 5px 11px rgba(20,115,232,.16); color: #fff; font: 31px/1 "Segoe UI", system-ui, sans-serif; font-style: normal; }
.zoomin-home-actions .zoomin-action-new i { background: #ff742b; }
.zoomin-home-actions .zoomin-action-new i b { width: 25px; height: 18px; border-radius: 5px; background: #fff; position: relative; }
.zoomin-home-actions .zoomin-action-new i b::after { position: absolute; top: 3px; right: -7px; width: 7px; height: 12px; border-radius: 2px 5px 5px 2px; background: #fff; content: ""; }
.zoomin-home-actions button:hover i { filter: brightness(1.08); transform: translateY(-1px); }
.zoomin-schedule-card { width: min(610px, calc(100% - 34px)); margin: clamp(28px, 3.8vh, 43px) auto 22px; overflow: hidden; border: 1px solid #dce1e8; border-radius: 14px; color: #2d343d; }
.zoomin-schedule-card header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 49px; padding: 0 19px; border-bottom: 1px solid #dce1e8; }
.zoomin-schedule-card header strong { font-size: 14px; text-align: center; }
.zoomin-schedule-card header button { width: 24px; padding: 0; border: 0; background: transparent; color: #2d343d; font-size: 23px; text-align: left; cursor: pointer; }
.zoomin-schedule-card header button:last-child { justify-self: end; font-size: 16px; letter-spacing: 2px; }
.zoomin-schedule-nav { display: flex; align-items: center; gap: 20px; min-height: 45px; padding: 0 21px; border-bottom: 1px solid #e0e5ec; }
.zoomin-schedule-nav button { padding: 5px 9px; border: 1px solid #9aa3b0; border-radius: 7px; background: #fff; color: #424a54; font: 11px "Segoe UI", system-ui, sans-serif; }
.zoomin-schedule-nav span { font-size: 19px; letter-spacing: 6px; }
.zoomin-empty-schedule { display: grid; min-height: 142px; place-content: center; justify-items: center; gap: 12px; color: #626a76; }
.zoomin-empty-schedule > span { color: #b6c3ef; font-size: 52px; transform: rotate(-14deg); }
.zoomin-empty-schedule p { margin: 0; font-size: 12px; }
.zoomin-schedule-card footer { padding: 13px 23px; border-top: 1px solid #dce1e8; color: #394450; font-size: 12px; }

.zoomin-meeting-connect-dialog { position: absolute; z-index: 20; top: 50%; left: 50%; width: min(300px, 42vw); aspect-ratio: 1; display: grid; place-content: center; justify-items: center; gap: 16px; border: 1px solid #dde2ea; border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(30, 49, 75, .25); color: #142c56; transform: translate(-50%, -50%); }
.zoomin-meeting-connect-dialog[hidden], .zoomin-meeting-screen[hidden], .zoomin-home[hidden] { display: none; }
.zoomin-connect-close-dot { position: absolute; top: 17px; left: 18px; width: 13px; height: 13px; border-radius: 50%; background: #ff625c; }
.zoomin-connect-brand { display: grid; justify-items: center; line-height: .9; letter-spacing: -2px; }
.zoomin-connect-brand strong { color: #1767ed; font-size: 36px; font-weight: 800; }
.zoomin-connect-brand b { margin-top: 5px; color: #142c56; font-size: 31px; }
.zoomin-connect-spinner { width: 34px; height: 34px; border: 4px solid #d9e7fc; border-top-color: #2d7bf0; border-radius: 50%; animation: zoominConnectSpin 1s linear infinite; }
.zoomin-meeting-connect-dialog p { margin: 0; color: #6e7480; font-size: 14px; font-weight: 600; }
@keyframes zoominConnectSpin { to { transform: rotate(360deg); } }

.zoomin-meeting-screen { grid-column: 2; grid-row: 1; min-width: 0; height: 100%; background: #20242c; color: #fff; }
.zoomin-meeting-screen > header { display: flex; align-items: center; justify-content: space-between; height: 47px; padding: 0 18px; border-bottom: 1px solid #3a414d; background: #292e37; }
.zoomin-meeting-screen > header > div { display: flex; align-items: baseline; gap: 11px; }
.zoomin-meeting-screen > header strong { font-size: 13px; }
.zoomin-meeting-screen > header span { color: #b8c0cc; font-size: 11px; }
.zoomin-live-mark { padding: 5px 8px; border-radius: 5px; background: #3b2428; color: #ff8c98 !important; font-size: 10px !important; }
.zoomin-meeting-screen > main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); height: calc(100% - 47px); }
.zoomin-audio-stage { position: relative; display: grid; min-height: 0; overflow: hidden; place-content: center; justify-items: center; background: radial-gradient(circle at 50% 45%, #3b4556, #252a32 63%); }
.zoomin-audio-name { position: absolute; top: 18px; left: 19px; padding: 6px 10px; border-radius: 5px; background: rgba(0,0,0,.28); color: #e4e8ef; font-size: 11px; }
.zoomin-waveform { display: flex; width: min(88%, 570px); align-items: center; justify-content: center; gap: 2px; height: 138px; }
.zoomin-waveform i { width: 2px; flex: 0 0 2px; height: var(--wave-low); border-radius: 999px; background: linear-gradient(to bottom, #bbf2ff, #4e9dff 55%, #3169dc); box-shadow: 0 0 5px rgba(103, 198, 255, .36); transform: scaleY(.13); transform-origin: center; opacity: .52; transition: transform .18s ease, filter .18s ease, opacity .18s ease; animation: zoominWaveNeedle var(--wave-duration) cubic-bezier(.42, 0, .18, 1) var(--wave-delay) infinite; }
@keyframes zoominWaveNeedle { 0%, 100% { height: var(--wave-low); opacity: .42; } 17% { height: var(--wave-a); opacity: .84; } 41% { height: var(--wave-c); opacity: .62; } 68% { height: var(--wave-b); opacity: 1; } 83% { height: var(--wave-a); opacity: .72; } }
.zoomin-app.meeting-speaking .zoomin-waveform i { transform: scaleY(1); filter: brightness(1.28) saturate(1.18); opacity: 1; }
.zoomin-app.meeting-laughing .zoomin-waveform { height: 190px; }
.zoomin-app.meeting-laughing .zoomin-waveform i { height: 100px; background: linear-gradient(to bottom, #fff0dd 0%, #ff6a43 42%, #d71324 74%, #7c0617); box-shadow: 0 0 12px rgba(255, 52, 38, .8), 0 0 28px rgba(205, 9, 31, .36); filter: saturate(1.55) brightness(1.25); animation-name: zoominWaveLaugh; animation-duration: calc(var(--wave-duration) * .48); animation-timing-function: cubic-bezier(.28, 0, .15, 1); }
@keyframes zoominWaveLaugh { 0%,100% { height: 18px; opacity: .56; } 12% { height: 160px; opacity: 1; } 31% { height: 56px; opacity: .82; } 48% { height: 184px; opacity: 1; } 69% { height: 82px; opacity: .92; } 86% { height: 174px; opacity: 1; } }
.zoomin-audio-stage > p { margin: 16px 0 0; color: #cdd4de; font-size: 13px; }
.zoomin-audio-stage footer { position: absolute; bottom: 20px; display: flex; gap: 10px; }
.zoomin-audio-stage footer button { padding: 9px 14px; border: 0; border-radius: 7px; background: #3c424e; color: #fff; font: 12px "Segoe UI", system-ui, sans-serif; }
.zoomin-audio-stage footer button:last-child { background: #d94b54; }
.zoomin-ai-notes { display: grid; min-width: 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border-left: 1px solid #414854; background: #fbfcfe; color: #25303e; }
.zoomin-ai-notes > header { display: flex; align-items: center; gap: 9px; padding: 15px; border-bottom: 1px solid #e2e7ef; }
.zoomin-speed-control { position: relative; margin-left: auto; }
.zoomin-speed-control > button { padding: 3px 5px; border: 0; border-radius: 4px; background: transparent; color: #8a95a5; font: 10px "Segoe UI", system-ui, sans-serif; cursor: pointer; }
.zoomin-speed-control > button:hover { background: #eef2f7; color: #4d5d71; }
.zoomin-speed-menu { position: absolute; z-index: 4; top: calc(100% + 5px); right: 0; display: grid; width: 58px; overflow: hidden; border: 1px solid #d9e0e9; border-radius: 6px; background: #fff; box-shadow: 0 6px 18px rgba(40, 55, 75, .14); }
.zoomin-speed-menu[hidden] { display: none; }
.zoomin-speed-menu button { padding: 6px 8px; border: 0; background: #fff; color: #4d5867; font: 10px "Segoe UI", system-ui, sans-serif; text-align: right; cursor: pointer; }
.zoomin-speed-menu button:hover { background: #edf5ff; color: #1e66b7; }
.zoomin-ai-spark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: #eaf1ff; color: #3475e5; font-size: 16px; }
.zoomin-ai-notes strong, .zoomin-ai-notes small { display: block; }
.zoomin-ai-notes strong { font-size: 13px; }
.zoomin-ai-notes small { margin-top: 3px; color: #778294; font-size: 10px; }
.zoomin-ai-note-empty { display: grid; min-height: 0; overflow: hidden; place-content: center; justify-items: center; gap: 13px; padding: 18px; text-align: center; }
.zoomin-ai-note-empty span { color: #b5c5e9; font-size: 44px; }
.zoomin-ai-note-empty p { max-width: 170px; margin: 0; color: #7b8593; font-size: 11px; line-height: 1.65; }
.zoomin-ai-note-empty.has-transcript { display: block; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 20px; text-align: left; overscroll-behavior: contain; }
.zoomin-ai-note-empty.has-transcript p { max-width: none; color: #33445c; font-size: 13px; line-height: 1.8; }
.zoomin-ai-note-entry { margin: 0 0 13px; padding: 0 0 12px; border-bottom: 1px solid #e9edf3; }
.zoomin-ai-note-entry strong { font-size: 11px; font-weight: 700; }
.zoomin-ai-note-entry.speaker-domoto strong { color: #087f9d; }
.zoomin-ai-note-entry.speaker-takizawa strong { color: #b86429; }
.zoomin-ai-note-entry.speaker-man strong { color: #7b4eb0; }
.zoomin-ai-note-empty.has-transcript .zoomin-ai-note-entry p { max-width: none; margin: 4px 0 0; color: #33445c; font-size: 13px; line-height: 1.72; }

/* 会議中はホーム画面のサイドバーを使わず、通話専用のダークな上下バーへ切り替える。 */
.zoomin-meeting-title { display: none; }
.zoomin-app.meeting-active { background: #20242c; }
.zoomin-app.meeting-active .zoomin-app-titlebar { height: 46px; padding: 0 16px; border-bottom: 1px solid #383e47; background: #292d33; color: #fff; }
.zoomin-app.meeting-active .zoomin-app-title > .zoomin-mini-mark,
.zoomin-app.meeting-active .zoomin-app-title > strong,
.zoomin-app.meeting-active .zoomin-search,
.zoomin-app.meeting-active .zoomin-title-actions > button:not(#zoominAppMinimize):not(#zoominAppClose) { display: none; }
.zoomin-app.meeting-active .zoomin-meeting-title { display: inline; color: #f3f5f8; font-size: 13px; font-weight: 650; }
.zoomin-app.meeting-active .zoomin-app-title { min-width: 0; }
.zoomin-app.meeting-active .zoomin-title-actions button { color: #dae0e9; }
.zoomin-app.meeting-active .zoomin-app-content { display: block; height: calc(100% - 46px); padding: 0; background: #20242c; }
.zoomin-app.meeting-active .zoomin-side-nav { display: none; }
.zoomin-app.meeting-active .zoomin-meeting-screen { display: grid; grid-template-rows: minmax(0, 1fr) 48px; height: 100%; }
.zoomin-app.meeting-active .zoomin-meeting-screen > header { display: none; }
.zoomin-app.meeting-active .zoomin-meeting-screen > main { min-height: 0; overflow: hidden; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: auto; }
.zoomin-app.meeting-active .zoomin-audio-stage { border-right: 1px solid #414854; }
.zoomin-app.meeting-active .zoomin-waveform { width: min(80%, 430px); }
.zoomin-meeting-footer { display: flex; align-items: center; justify-content: center; gap: clamp(26px, 7vw, 78px); border-top: 1px solid #3a414d; background: #15191e; }
.zoomin-meeting-footer button { display: grid; min-width: 42px; justify-items: center; gap: 4px; border: 0; background: transparent; color: #f0f3f7; font: inherit; cursor: pointer; }
.zoomin-meeting-footer button:hover { color: #8cc5ff; }
.zoomin-footer-icon { width: 21px; height: 21px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.zoomin-footer-more { fill: currentColor; stroke: none; }
.zoomin-meeting-footer small { color: #b7bec8; font: 10px "Segoe UI", system-ui, sans-serif; }
.zoomin-meeting-footer small b { color: #d9e8fb; font-weight: 700; }
.zoomin-participants-panel { position: absolute; z-index: 25; right: 18px; bottom: 58px; display: grid; width: min(338px, calc(100% - 36px)); height: min(520px, calc(100% - 82px)); min-height: 300px; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #3c424c; border-radius: 10px; background: #24262a; box-shadow: 0 18px 40px rgba(0,0,0,.38); color: #f6f7f9; }
.zoomin-participants-panel[hidden] { display: none; }
.zoomin-participants-panel > header { display: flex; align-items: center; justify-content: center; min-height: 58px; border-bottom: 1px solid #3d4148; }
.zoomin-participants-panel > header strong { font-size: 16px; }
.zoomin-participants-panel > header button { position: absolute; right: 16px; border: 0; background: transparent; color: #e9ecf1; font-size: 28px; line-height: 1; cursor: pointer; }
.zoomin-participant-list { min-height: 0; overflow-y: auto; padding: 10px 13px; }
.zoomin-participant-list article { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 5px; }
.zoomin-participant-avatar { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: #fff; font-size: 19px; font-weight: 700; }
.zoomin-participant-avatar.kitayama { background: #3373d7; }
.zoomin-participant-avatar.domoto { background: #00a88f; }
.zoomin-participant-avatar.press { background: #59657a; }
.zoomin-participant-list strong, .zoomin-participant-list small { display: block; }
.zoomin-participant-list strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.zoomin-participant-list small { margin-top: 3px; color: #aeb5bf; font-size: 10px; }
.zoomin-participant-list article > button { border: 0; background: transparent; color: #c4cad3; font-size: 17px; cursor: pointer; }
.zoomin-participants-panel > footer { display: grid; grid-template-columns: 1fr 1.35fr .9fr; gap: 8px; padding: 13px; border-top: 1px solid #3d4148; }
.zoomin-participants-panel > footer button { min-height: 34px; border: 0; border-radius: 7px; background: #393c43; color: #f5f6f8; font: 12px "Segoe UI", system-ui, sans-serif; }
.zoomin-waiting-room-toast { position: absolute; z-index: 28; bottom: 62px; left: 20px; display: flex; width: min(360px, calc(50% - 30px)); align-items: center; gap: 15px; padding: 13px 14px 13px 16px; border: 1px solid #cfd6e1; border-radius: 8px; background: rgba(255,255,255,.98); box-shadow: 0 12px 30px rgba(16, 30, 54, .28); color: #27364c; }
.zoomin-waiting-room-toast[hidden] { display: none; }
.zoomin-waiting-room-toast div { min-width: 0; flex: 1; }
.zoomin-waiting-room-toast strong { display: block; color: #45546a; font-size: 11px; font-weight: 700; }
.zoomin-waiting-room-toast p { overflow: hidden; margin: 4px 0 0; color: #27364c; font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.zoomin-waiting-room-toast > button { flex: 0 0 auto; padding: 7px 15px; border: 0; border-radius: 5px; background: #0e72e7; color: #fff; font: 12px "Segoe UI", system-ui, sans-serif; cursor: pointer; }
.zoomin-waiting-room-toast > button:hover { background: #075fc4; }

@media (max-width: 760px) {
  .zoomin-site-header { padding: 0 20px; gap: 18px; }
  .zoomin-site-header nav { display: none; }
  .zoomin-download-main { width: min(100% - 32px, 960px); padding-top: 38px; }
  .zoomin-primary-download { align-items: flex-start; flex-wrap: wrap; }
  .zoomin-primary-download button { width: 100%; margin-left: 0; }
  .zoomin-download-grid { grid-template-columns: 1fr; }
  .zoomin-app { top: 6%; right: 10px; bottom: 52px; left: 10px; width: auto; height: auto; min-width: 0; transform: none; }
  .zoomin-app-content { grid-template-columns: 110px minmax(0, 1fr); }
  .zoomin-search { display: none; }
  .zoomin-home-time { padding-top: 34px; }
  .zoomin-home-actions { flex-wrap: wrap; margin-top: 36px; }
  .zoomin-home-actions button { width: 74px; }
  .zoomin-schedule-card { width: calc(100% - 22px); }
  .zoomin-meeting-screen > main { grid-template-columns: minmax(0, 1.65fr) minmax(150px, 1fr); }
  .zoomin-meeting-connect-dialog { inset: 10%; }
  .zoomin-app.meeting-active .zoomin-meeting-screen > main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .zoomin-meeting-footer { gap: 24px; }
}

.sms-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid #dbe1e9;
  background: #fff;
}

.sms-compose textarea {
  flex: 1;
  min-height: 30px;
  padding: 4px 2px;
  resize: none;
}

.sms-compose button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #4b92d4;
  color: #fff;
  font-size: 17px;
}

.sms-error {
  min-height: 16px;
  margin: 0;
  padding: 0 14px 8px;
  background: #fff;
  color: #b85f64;
  font-size: 11px;
}

/* iPhoneのメッセージアプリ風レイアウト */
.sms-app {
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100svh - 78px));
  border: 1px solid rgba(215, 215, 220, 0.94);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(20, 31, 45, 0.3);
  color: #111;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
}

.sms-app-header {
  position: relative;
  flex: 0 0 62px;
  min-height: 62px;
  padding: 0 16px;
  border-bottom: 1px solid #e5e5ea;
  background: rgba(255, 255, 255, 0.96);
}

.sms-app .sms-list-header[hidden],
.sms-app .sms-thread-header[hidden],
.sms-app .sms-conversation-list[hidden],
.sms-app .sms-thread-panel[hidden] {
  display: none !important;
}

.sms-app-header h2 {
  position: absolute;
  left: 50%;
  margin: 0;
  color: #111;
  font-size: 18px;
  font-weight: 700;
  transform: translateX(-50%);
}

.sms-list-header {
  justify-content: center;
}

.sms-edit-button,
.sms-close-button,
.sms-back-button {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #007aff;
  cursor: pointer;
}

.sms-edit-button {
  left: 13px;
  width: 48px;
  padding: 8px;
  font-size: 14px;
  white-space: nowrap;
}

.sms-close-button {
  right: 11px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #3c3c43;
  font-size: 22px;
}

.sms-back-button {
  left: 9px;
  width: 38px;
  height: 42px;
  color: #007aff;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
}

.sms-thread-header {
  justify-content: center;
}

.sms-thread-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sms-thread-title h2 {
  position: static;
  transform: none;
  font-size: 15px;
}

.sms-contact-avatar {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #c8d4ed, #718dcc);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}

.sms-thread-title .sms-contact-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 14px;
}

.sms-conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
}

.sms-empty {
  margin: 48px auto;
  color: #8e8e93;
}

.sms-conversation {
  position: relative;
  display: flex;
  width: 100%;
  gap: 12px;
  padding: 13px 20px 13px 16px;
  border: 0;
  border-bottom: 1px solid #e5e5ea;
  background: #fff;
  color: #111;
  text-align: left;
  cursor: pointer;
}

.sms-conversation:hover,
.sms-conversation:focus-visible {
  background: #f2f2f7;
  outline: 0;
}

.sms-conversation-body {
  min-width: 0;
  flex: 1;
}

.sms-conversation-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sms-conversation-top strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-conversation-top time {
  flex: 0 0 auto;
  color: #8e8e93;
  font-size: 12px;
}

.sms-conversation-preview {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-conversation-marker {
  position: absolute;
  top: 18px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #007aff;
}

.sms-thread-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  background: #fff;
}

.sms-thread {
  flex: 1;
  gap: 7px;
  padding: 18px 14px;
  background: #fff;
}

.sms-bubble {
  max-width: 80%;
  padding: 9px 12px;
  border-radius: 18px;
  background: #0a84ff;
  color: #fff;
  font-size: 15px;
}

.sms-bubble p {
  font-size: inherit;
  line-height: 1.4;
  white-space: pre-wrap;
}

.sms-bubble.incoming {
  align-self: start;
  border-radius: 18px;
  background: #e9e9eb;
  color: #111;
}

.sms-typing-indicator {
  display: flex;
  flex: 0 0 54px;
  align-items: center;
  align-self: start;
  gap: 5px;
  min-width: 68px;
  height: 54px;
  padding: 0 13px;
  border-radius: 27px;
  background: #e9e9eb;
}

.sms-typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8babf;
  animation: sms-typing-flow 1.08s ease-in-out infinite;
}

.sms-typing-indicator span:nth-child(2) { animation-delay: .16s; }
.sms-typing-indicator span:nth-child(3) { animation-delay: .32s; }

@keyframes sms-typing-flow {
  0%, 58%, 100% { background: #b8babf; transform: translateY(0); }
  28% { background: #50535a; transform: translateY(-1px); }
}

.sms-compose {
  gap: 8px;
  padding: 9px 12px 12px;
  border-top: 0;
}

.sms-compose textarea {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #dedee3;
  border-radius: 18px;
  background: #fff;
  font: 14px -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
}

.sms-compose button {
  width: 34px;
  height: 34px;
  background: #0a84ff;
}

.sms-error {
  padding-bottom: 6px;
}

.calendar-header {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.calendar-header button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #465566;
  font-size: 23px;
  line-height: 1;
}

.calendar-header button:hover,
.calendar-header button:focus-visible,
.calendar-day:hover,
.calendar-day:focus-visible {
  background: #e7eef7;
  outline: 0;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  /* イベント名が長くても列の最小幅を広げない。 */
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays > span,
.calendar-day {
  min-width: 0;
}

.calendar-weekdays {
  margin-bottom: 4px;
  color: #798596;
  font-size: 11px;
  text-align: center;
}

.calendar-day {
  display: grid;
  place-content: center;
  aspect-ratio: 1;
  padding: 2px 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #2b3541;
  font: 13px/1 "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

.calendar-day.has-event {
  align-content: center;
  gap: 1px;
}

.calendar-event-label {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #ad5f71;
  font: 7px/1 "Segoe UI", system-ui, sans-serif;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* カレンダー自体も一つの閲覧画面として、右下にだけ控えめに示す。 */
.calendar-flyout > .page-number-badge {
  margin: 8px 4px 0 auto;
  font-size: 9px;
}

.calendar-day.other-month {
  color: #a7b0bc;
}

.calendar-day.today {
  color: #3975ad;
  font-weight: 800;
}

.calendar-day.selected {
  background: #4e8dca;
  color: #fff;
  font-weight: 700;
}

.calendar-day.selected .calendar-event-label {
  color: rgba(255, 255, 255, 0.92);
}

.calendar-day.selected:hover,
.calendar-day.selected:focus-visible {
  background: #3e7eb8;
}

.calendar-today {
  width: 100%;
  margin-top: 12px;
  padding: 7px;
  border: 0;
  border-top: 1px solid #dbe3ec;
  background: transparent;
  color: #3e6f9d;
  font: 12px "Segoe UI", system-ui, sans-serif;
}

.calendar-today:hover,
.calendar-today:focus-visible {
  background: #edf3f9;
  outline: 0;
}

.app-shell {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 5;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  width: min(1480px, calc(100vw - 28px));
  height: calc(100vh - 76px);
  min-height: 0;
  margin: 0;
  transform: translateX(-50%);
  border: 1px solid rgba(222, 216, 207, 0.8);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.app-shell.maximized {
  top: 0 !important;
  right: 0 !important;
  bottom: 42px !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  transform: none !important;
  border-radius: 0;
}

.app-shell[hidden] {
  display: none;
}

.memoria-window-drag-handle {
  position: absolute;
  top: 0;
  right: 248px;
  left: 340px;
  z-index: 44;
  height: 58px;
  cursor: grab;
  touch-action: none;
}

.memoria-window-drag-handle.dragging {
  cursor: grabbing;
}

.memoria-window-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 45;
  display: flex;
  overflow: hidden;
  border: 1px solid #cdd8e0;
  border-radius: 10px;
  background: #f8fbfd;
}

.memoria-window-controls button {
  display: grid;
  width: 37px;
  height: 31px;
  place-items: center;
  border: 0;
  border-right: 1px solid #dbe3e9;
  color: #465b68;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}

.memoria-window-controls button:last-child {
  border-right: 0;
}

.memoria-window-controls button:hover {
  background: #e8f0f3;
}

.memoria-window-controls .window-close-button:hover,
.memoria-window-controls .window-close-button:focus-visible {
  color: #fff;
  background: #c74747;
  outline: 0;
}

.window-close-button {
  color: #7b7770;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
  line-height: 1;
}

.case-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 34px 28px 26px;
  background: rgba(250, 249, 246, 0.94);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
}

.bot-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #cfd8cd;
  border-radius: 12px;
  background: #fffdfa;
  color: var(--green-dark);
  box-shadow: 0 4px 10px rgba(89, 112, 96, 0.06);
}

.brand-name {
  font-size: 34px;
  line-height: 1;
  color: #4a4b47;
}

.new-chat-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 6px 12px rgba(85, 117, 100, 0.12);
}

.new-chat-button span {
  font-size: 21px;
  line-height: 1;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin: 25px 0 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.side-nav button {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: #565651;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  text-align: left;
}

.side-nav button[hidden] {
  display: none;
}

.side-nav button[aria-current="page"] {
  background: rgba(232, 240, 236, 0.7);
  color: var(--green-dark);
}

.side-nav span,
.recent-title span {
  width: 22px;
  text-align: center;
  color: #77746d;
}

.side-nav .home-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.side-nav .book-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.side-nav .book-icon::before,
.side-nav .book-icon::after {
  top: 5px;
  width: 6px;
  height: 11px;
  border-width: 1px;
}

.side-nav .sidebar-unread-badge {
  display: grid;
  width: auto;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 4px;
  place-items: center;
  border-radius: 999px;
  background: #c62b2b;
  color: #fff;
  font: 800 10px/1 "Segoe UI", system-ui, sans-serif;
}

.side-nav .sidebar-unread-badge[hidden] {
  display: none;
}

.side-nav .book-icon::before {
  left: 4px;
}

.side-nav .book-icon::after {
  right: 4px;
}

.plug-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: currentColor;
}

.plug-icon::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 5px;
  width: 12px;
  height: 9px;
  border: 1.8px solid currentColor;
  border-radius: 3px 3px 5px 5px;
}

.plug-icon::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 10px;
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
}

.plug-icon i {
  position: absolute;
  top: 3px;
  left: 8px;
  width: 2px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor;
}

.recent-block {
  display: grid;
  gap: 10px;
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6f6d66;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px;
  cursor: pointer;
}

.recent-item.active {
  border-left: 4px solid var(--green);
  background: rgba(232, 240, 236, 0.72);
}

.recent-item strong {
  display: block;
}

.recent-item strong {
  font-size: 15px;
  margin-bottom: 0;
}

.recent-title-input {
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 6px;
  outline: 0;
}

.recent-title-input:focus {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.chevron {
  color: var(--muted);
}

.progress {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
  color: #6d6b65;
  font-size: 13px;
}

.progress > strong {
  color: var(--green-dark);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.progress small {
  color: #918e87;
  font-size: 12px;
}

.trust-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: #77766f;
  font-size: 12px;
}

.trust-status strong {
  color: var(--green-dark);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2ebe6;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width .35s ease;
}

.progress-bar[hidden] { display: none; }

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #aab9a3);
  transition: width 240ms ease;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.68), transparent 32%),
    rgba(255, 255, 255, 0.86);
}

.chat-panel[hidden],
.album-panel[hidden],
.plugins-panel[hidden],
.documents-panel[hidden],
.blue-gull-panel[hidden] {
  display: none;
}

.chat-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 32px 8px;
}

.account-menu {
  position: absolute;
  top: 18px;
  right: 146px;
  z-index: 30;
}

.notification-menu {
  position: absolute;
  top: 18px;
  right: 196px;
  z-index: 30;
}

.notification-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #77746d;
}

.notification-button:hover,
.notification-button:focus-visible {
  background: #f1f3ef;
  outline: 0;
}

.notification-glyph {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  box-sizing: border-box;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  font: 700 13px/1 Georgia, serif;
  font-style: normal;
}

.notification-button .notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border: 2px solid #fffdf9;
  border-radius: 50%;
  background: var(--danger);
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(310px, calc(100vw - 36px));
  height: min(400px, calc(100vh - 120px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 42px rgba(72, 66, 56, 0.16);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-panel[hidden],
.stage-toast[hidden] {
  display: none;
}

.notification-panel h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.memoria-about {
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--line);
}

.memoria-about h2,
.memoria-about p { margin: 0; }
.memoria-about h2 { margin-bottom: 8px; }
.memoria-about p {
  color: #62635e;
  font-size: 12px;
  line-height: 1.55;
}
.memoria-about p + p { margin-top: 6px; }
.notification-heading { margin-top: 12px !important; }

.notification-list {
  display: grid;
  gap: 7px;
  padding-right: 3px;
}

.notification-item {
  padding: 10px;
  border-radius: 8px;
  background: #f5f6f3;
}

.notification-item p,
.notification-item time,
.notification-empty {
  margin: 0;
}

.notification-item p {
  color: #454741;
  font-size: 13px;
  line-height: 1.45;
}

.notification-item time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.notification-empty {
  padding: 12px 4px;
  color: var(--muted);
  font-size: 13px;
}

.stage-toast {
  position: absolute;
  top: 72px;
  right: 26px;
  z-index: 40;
  max-width: min(330px, calc(100% - 52px));
  padding: 13px 16px;
  border: 1px solid rgba(111, 145, 126, 0.45);
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 42px rgba(72, 66, 56, 0.18);
  color: #454b40;
  font-size: 13px;
  line-height: 1.45;
}

.profile-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #77746d;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 168px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 42px rgba(72, 66, 56, 0.16);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.account-menu-panel button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
  text-align: left;
  padding: 0 10px;
}

.account-menu-panel button:hover,
.account-menu-panel button:focus-visible {
  background: rgba(184, 107, 95, 0.1);
}

.account-menu-panel p {
  margin: 4px 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-menu-panel strong {
  color: var(--ink);
}

.appearance-menu {
  display: grid;
  gap: 7px;
  margin: 10px 6px 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.appearance-menu > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.account-menu-panel .appearance-menu button {
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-align: center;
}

.account-menu-panel .appearance-menu button[aria-pressed="true"] {
  border-color: #799888;
  background: var(--green-soft);
  color: var(--green-dark);
}

/* memoriaだけを暗色化する。デスクトップやブラウザの表示には影響させない。 */
.app-shell.night-mode {
  color-scheme: dark;
  --panel: rgba(22, 31, 32, .94);
  --paper: #172123;
  --soft: #202c2e;
  --line: #344448;
  --line-strong: #4c6264;
  --text: #edf3f0;
  --muted: #aab9b7;
  --green: #78a893;
  --green-dark: #b1d5c1;
  --green-soft: #29463e;
  --bot-border: #3d5050;
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
  border-color: #3c5152;
  background: #132022;
  box-shadow: var(--shadow);
}

.app-shell.night-mode .memoria-window-controls {
  border-color: #405356;
  background: #1c2a2d;
}

.app-shell.night-mode .memoria-window-controls button {
  border-color: #405356;
  color: #d9e6e3;
}

.app-shell.night-mode .case-panel {
  background: linear-gradient(155deg, #192729, #142022);
  border-color: var(--line);
}

.app-shell.night-mode .bot-avatar {
  border-color: #526461;
  background: #223134;
  color: #b9ddc8;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
}

.app-shell.night-mode .brand-name,
.app-shell.night-mode .side-nav button,
.app-shell.night-mode .recent-item,
.app-shell.night-mode .memory-tile,
.app-shell.night-mode .documents-header h1,
.app-shell.night-mode .plugin-card h3 {
  color: var(--text);
}

.app-shell.night-mode .side-nav button[aria-current="page"],
.app-shell.night-mode .recent-item.active {
  background: rgba(72, 112, 95, .38);
  color: #d3edda;
}

.app-shell.night-mode .progress,
.app-shell.night-mode .progress small,
.app-shell.night-mode .recent-title,
.app-shell.night-mode .chat-title p,
.app-shell.night-mode .privacy-note,
.app-shell.night-mode .documents-header p,
.app-shell.night-mode .plugins-header p,
.app-shell.night-mode .plugin-card p,
.app-shell.night-mode .plugin-card small {
  color: var(--muted);
}

.app-shell.night-mode .progress-bar { background: #334346; }

.app-shell.night-mode .chat-panel,
.app-shell.night-mode .album-panel,
.app-shell.night-mode .plugins-panel,
.app-shell.night-mode .documents-panel {
  background: radial-gradient(circle at 50% 0%, rgba(48, 72, 70, .46), transparent 42%), #142022;
}

.app-shell.night-mode .chat-title h1,
.app-shell.night-mode .memory-section-header h2,
.app-shell.night-mode .plugins-header h1,
.app-shell.night-mode .plugins-section h2,
.app-shell.night-mode .documents-header h1 { color: #c5e3d1; }

.app-shell.night-mode .message { color: #edf3f0; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.app-shell.night-mode .message.assistant { border-color: #405252; background: #1c2a2c; }
.app-shell.night-mode .message.user { border-color: #416554; background: #29483e; }
.app-shell.night-mode .system-message { background: #27443b; color: #d2ebdb; }
.app-shell.night-mode .chat-form { border-color: #405254; background: #1c2a2c; box-shadow: 0 10px 34px rgba(0, 0, 0, .24); }
.app-shell.night-mode textarea { color: #f1f6f3; }
.app-shell.night-mode textarea::placeholder { color: #8fa4a1; }

.app-shell.night-mode .memory-section,
.app-shell.night-mode .plugin-card,
.app-shell.night-mode .documents-diary-item,
.app-shell.night-mode .photo-note {
  border-color: #405052;
  background: rgba(29, 43, 45, .9);
  color: #dce9e5;
}

.app-shell.night-mode .memory-tile strong,
.app-shell.night-mode .photo-note,
.app-shell.night-mode .documents-diary-item.readable,
.app-shell.night-mode .documents-diary-item.readable small,
.app-shell.night-mode .documents-diary-text em { color: #dce9e5; }
.app-shell.night-mode .memory-hint,
.app-shell.night-mode .memory-tile small,
.app-shell.night-mode .documents-diary-item small { color: #a8bbb7; }
.app-shell.night-mode .photo-slot { border-color: #425557; background: #243437; }
.app-shell.night-mode .memory-tile.locked .photo-slot { background: linear-gradient(145deg, #283638, #202d2f); color: #a1b4ae; }
.app-shell.night-mode .documents-diary-item.readable { background: #203532; }
.app-shell.night-mode .documents-diary-item.final-message-diary { background: linear-gradient(135deg, #17333b, #1c4651); color: #d9f4fa; }
.app-shell.night-mode .documents-diary-item.final-message-diary .documents-diary-text em,
.app-shell.night-mode .documents-diary-item.final-message-diary small { color: #abdce8; }

/* 開錠後も「忘れたい過去」は通常の閲覧可カードへ戻さない。 */
.app-shell.night-mode .documents-diary-item.forgotten-diary.readable {
  border-color: #7f8c95;
  background: linear-gradient(135deg, #10161b 0%, #1d262c 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.17), 0 4px 13px rgba(0,0,0,.48);
}

.app-shell.night-mode .documents-diary-item.forgotten-diary.readable .documents-diary-text em {
  color: #f2f5f4;
}

.app-shell.night-mode .documents-diary-item.forgotten-diary.readable .diary-status.readable {
  color: #c5f1d3;
}

.app-shell.night-mode .notification-button,
.app-shell.night-mode .profile-button,
.app-shell.night-mode .notification-panel,
.app-shell.night-mode .account-menu-panel,
.app-shell.night-mode .stage-toast {
  border-color: #435657;
  background: #1d2b2d;
  color: #e2ece8;
}
.app-shell.night-mode .notification-item { background: #263739; }
.app-shell.night-mode .notification-item p,
.app-shell.night-mode .account-menu-panel strong { color: #e2ece8; }
.app-shell.night-mode .appearance-menu { border-color: #405254; }
.app-shell.night-mode .account-menu-panel .appearance-menu button[aria-pressed="true"] { border-color: #78ad91; background: #315a4b; color: #effaf3; }

.memory-dialog.night-mode {
  border-color: #45595b;
  background: #182527;
  color: #edf3f0;
}
.memory-dialog.night-mode h2 { color: #c8e6d5; }
.memory-dialog.night-mode p { color: #edf3f0; }
.memory-dialog.night-mode .memory-dialog-image { border-color: #425557; background: #243437; }
.memory-dialog.night-mode .ghost-button { border-color: #506564; color: #c8e6d5; }

.chat-title {
  grid-column: 1;
  grid-row: 1;
  text-align: center;
  justify-self: center;
  min-width: min(360px, 100%);
}

.leaf-line {
  display: block;
  margin-bottom: 0;
  color: #9ca895;
  font-size: 26px;
  line-height: 0.8;
}

h1 {
  margin: 0;
  color: var(--green-dark);
  font-size: clamp(32px, 3.2vw, 42px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.chat-title p {
  margin: 5px 0 0;
  color: #74736e;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 550;
}

.chat-title h1 {
  font-size: clamp(26px, 2.45vw, 32px);
}

.chat-title .leaf-line {
  font-size: 21px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 8px 32px 22px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(100%, 1120px);
  min-width: 0;
  align-self: center;
  margin-inline: auto;
}

.message-row.user {
  justify-content: flex-end;
}

.message-stack {
  display: grid;
  gap: 7px;
  min-width: 0;
  max-width: min(680px, 66vw);
}

.message-row.assistant .message-stack {
  max-width: min(640px, 62vw);
}

.message {
  width: auto;
  max-width: 100%;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.7;
  padding: 13px 19px;
  color: #3f403c;
  font-size: 15px;
  box-shadow: 0 5px 14px rgba(82, 73, 59, 0.055);
}

.message.assistant {
  border: 1px solid var(--bot-border);
  border-radius: 12px 12px 12px 2px;
  background: rgba(255, 253, 249, 0.92);
}

.message.user {
  border: 1px solid #dce8e2;
  border-radius: 12px 12px 2px 12px;
  background: var(--green-soft);
}

.bot-avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border-color: #91ad9a;
}

.message-time,
.message-status {
  color: #9a968e;
  font-size: 12px;
}

.user-meta {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.typing-message {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 76px;
  min-height: 48px;
}

.typing-message span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.28;
  animation: typingPulse 1.1s infinite ease-in-out;
}

.typing-message span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-message span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.system-message {
  align-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(232, 240, 236, 0.78);
  color: var(--green-dark);
  font-size: 13px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.chat-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: min(1060px, calc(100% - 64px));
  box-sizing: border-box;
  justify-self: center;
  margin: 0 auto;
  padding: 9px 11px 9px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 16px rgba(72, 66, 56, 0.075);
}

.attach-icon {
  color: #77746d;
  font-size: 22px;
}

textarea {
  width: 100%;
  min-height: 30px;
  max-height: 160px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 4px 0;
  line-height: 1.6;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

textarea::placeholder {
  color: #a4a097;
}

.chat-form button,
.dialog-actions button,
.will-dialog button,
.ending a {
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-form button {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.ghost-button {
  background: transparent;
  color: var(--green-dark);
  border: 1px solid var(--line);
}

.privacy-note {
  margin: 12px 0 18px;
  color: #9a968e;
  text-align: center;
  font-size: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.album-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.96), transparent 38%),
    rgba(255, 255, 255, 0.78);
}

.plugins-panel {
  min-height: 0;
  overflow: auto;
  padding: 34px min(7vw, 90px) 52px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.96), transparent 38%),
    rgba(255, 255, 255, 0.78);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.documents-panel {
  min-height: 0;
  overflow: auto;
  padding: 38px min(7vw, 90px) 52px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 248, 245, 0.9));
}

.documents-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.documents-header > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: #e7efe7;
  color: #52715a;
  font-size: 23px;
}

.documents-header h1,
.documents-header p {
  margin: 0;
}

.documents-header h1 {
  color: #4a504a;
  font-size: 22px;
}

.documents-header p {
  margin-top: 4px;
  color: #848983;
  font-size: 13px;
}

.documents-diary-list {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin-top: 24px;
}

.blue-gull-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  gap: 12px;
  padding: 20px min(4vw, 56px) 18px;
  box-sizing: border-box;
  color: #4c514f;
  background: linear-gradient(135deg, #fffdfa 0%, #f3f8f6 54%, #fbfaf5 100%);
}

.blue-gull-header { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0; text-align: center; }
.blue-gull-header > span { color: #b4a38c; font-size: 19px; }
.blue-gull-header h1, .blue-gull-header p { margin: 0; }
.blue-gull-header h1 { font-family: Georgia, "Hiragino Mincho ProN", serif; font-size: clamp(28px, 3vw, 42px); font-weight: 600; letter-spacing: .08em; }
.blue-gull-header p { margin-top: 7px; color: #77736b; font-family: Georgia, "Hiragino Mincho ProN", serif; font-size: 13px; }

.blue-gull-reader-row { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; gap: 16px; }
.blue-gull-book { position: relative; display: grid; grid-template-columns: 1fr; width: auto; max-width: 100%; min-height: 0; height: 100%; aspect-ratio: 16 / 9; margin: 0 auto; overflow: hidden; border: 1px solid #ddd4c5; border-radius: 18px; background-color: #fffcf4; background-image: var(--blue-gull-page-image); background-repeat: no-repeat; background-position: center; background-size: contain; box-shadow: 0 14px 34px rgba(78,88,76,.18), inset 0 0 28px rgba(208,193,166,.18); }
.blue-gull-reader-row:has(.blue-gull-question-dock:not(:empty)) .blue-gull-book { margin: 0; }
.blue-gull-question-dock { width: 190px; }
.blue-gull-question-dock:empty { display: none; }
.blue-gull-page { position: relative; min-height: 0; }
.blue-gull-text-page { width: 43%; overflow: hidden; padding: clamp(13px, 1.7vw, 23px) clamp(15px, 2.2vw, 30px); box-sizing: border-box; font-family: "Hiragino Mincho ProN", YuMincho, serif; font-size: clamp(8px, .7vw, 11px); line-height: 1.34; text-shadow: 0 1px 0 rgba(255,255,255,.68); }
.blue-gull-book:not(.blue-gull-page-7) .blue-gull-text-page { font-weight: 700; }
.blue-gull-text-page h2 { margin: 0 0 7px; color: #506e62; font-size: clamp(13px, 1.08vw, 17px); letter-spacing: .08em; }
.blue-gull-story-text { column-count: 1; }
.blue-gull-text-page p { break-inside: avoid; white-space: pre-line; }
.blue-gull-text-page p + p { margin-top: 4px; }
.blue-gull-ending { display: block; margin-top: 8px; text-align: center; }
.blue-gull-panel ruby { ruby-position: over; }
.blue-gull-panel rt { color: #6e7c74; font-size: .48em; font-weight: 500; letter-spacing: 0; }

/* P5は右側、P7は中央右の白い枠を本文領域として使う。 */
.blue-gull-book.blue-gull-page-2 .blue-gull-text-page { width: 43%; }
.blue-gull-book.blue-gull-page-5 .blue-gull-text-page { justify-self: end; }
.blue-gull-book.blue-gull-page-7 .blue-gull-text-page { width: 53%; height: 96%; align-self: start; justify-self: start; margin-top: 3%; margin-left: 48%; padding: clamp(9px, .75vw, 11px); color: #102e3d; background: transparent; font-size: clamp(8px, .7vw, 11px); font-weight: 700; line-height: 1.7; text-shadow: none; }
.blue-gull-book.blue-gull-page-7 .blue-gull-text-page h2 { margin-bottom: 6px; color: #061e28; font-size: clamp(13px, 2.08vw, 17px); }
.blue-gull-book.blue-gull-page-7 .blue-gull-text-page p { margin: 0; }
.blue-gull-book.blue-gull-page-7 .blue-gull-text-page p + p { margin-top: 0; }
.blue-gull-book.blue-gull-page-7 rt { color: #102e3d; }
.blue-gull-illustration { overflow: hidden; background: radial-gradient(ellipse at 32% 18%, rgba(255,252,219,.92), transparent 26%), linear-gradient(to bottom, #e9f6f4 0 56%, #9fd3e2 56% 69%, #ecf2dd 69% 100%); }
.blue-gull-illustration::before { position: absolute; right: -4%; bottom: 16%; left: -5%; height: 22%; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 100%, #889d83 0 24%, transparent 25%), linear-gradient(170deg, transparent 45%, rgba(101,130,119,.75) 46% 53%, transparent 54%); content: ""; }
.blue-gull-bird { position: absolute; top: 22%; right: 22%; color: #4b9ed0; font-family: Georgia, serif; font-size: 98px; font-weight: 700; transform: rotate(-14deg) scaleX(1.35); text-shadow: 0 4px 8px rgba(42,93,123,.15); }
.blue-gull-boy { position: absolute; bottom: 21%; left: 38%; width: 33px; height: 83px; border-radius: 46% 46% 30% 30%; color: transparent; background: linear-gradient(#83684f 0 20%, #e5d3b6 21% 44%, #8ca6a3 45% 73%, #907f65 74%); box-shadow: 13px 72px 0 -10px #746858; }
.blue-gull-lighthouse { position: absolute; right: 13%; bottom: 31%; color: #f9f5e9; font-size: 64px; text-shadow: 0 1px 0 #a4a297, 0 8px 14px rgba(74,93,91,.22); }
.blue-gull-illustration-placeholder { display: grid; place-content: center; gap: 10px; border-left: 1px dashed rgba(88,133,144,.35); color: #7799a0; text-align: center; background: repeating-linear-gradient(135deg, #edf7f7 0 12px, #f9fcfa 12px 24px); }
.blue-gull-illustration-placeholder::before { display: none; }
.blue-gull-illustration-placeholder span { display: grid; width: 110px; height: 110px; place-items: center; margin: auto; border: 1px dashed #8cb5b9; border-radius: 50%; color: #66929a; font-family: "Hiragino Mincho ProN", YuMincho, serif; font-size: 21px; }
.blue-gull-illustration-placeholder small { color: #8b9893; }
.blue-gull-question { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); align-items: center; gap: 5px; margin-top: 7px; padding-top: 7px; border-top: 1px solid #dfd8ce; font-size: .92em; }
.blue-gull-question p { grid-column: 1 / -1; margin: 0 0 2px; font-weight: 700; line-height: 1.4; }
.blue-gull-question button { padding: 8px 10px; border: 1px solid #d5ded5; border-radius: 8px; color: #536d60; background: #fbfdfb; text-align: left; }
.blue-gull-question button.correct { color: #fff; background: #648d79; }
.blue-gull-question button.incorrect { color: #a45c53; background: #fff1ef; }
.blue-gull-question small { grid-column: 1 / -1; color: #61766c; }
.blue-gull-answer-reveal { display: inline-grid; position: relative; min-width: 1.2em; color: inherit; }
.blue-gull-answer-reveal > span { grid-area: 1 / 1; }
.blue-gull-answer-reveal.is-glowing { color: #138ed1; animation: blue-gull-answer-glow 1s ease-in-out; }
.blue-gull-answer-reveal.is-revealing { color: #176b93; }
.blue-gull-answer-reveal.is-revealing .blue-gull-answer-mask { opacity: 0; transition: opacity 1s ease; }
.blue-gull-answer-reveal.is-revealing .blue-gull-answer-text { opacity: 1; transition: opacity 1s ease; }
.blue-gull-answer-text { opacity: 0; color: #176b93; }
.blue-gull-answer-reveal.is-revealed { display: inline; color: inherit; }
@keyframes blue-gull-answer-glow {
  0%, 100% { color: #138ed1; text-shadow: 0 0 0 rgba(46,173,239,0); }
  50% { color: #29aef3; text-shadow: 0 0 8px rgba(46,173,239,.95), 0 0 15px rgba(46,173,239,.5); }
}
.blue-gull-question-dock .blue-gull-question { grid-template-columns: 1fr; margin: 0; padding: 16px; border: 1px solid #d9d2c6; border-radius: 14px; background: rgba(255,255,255,.7); font-size: 12px; }
.blue-gull-question-dock .blue-gull-question button { text-align: center; }

.blue-gull-pagination { display: flex; align-items: center; justify-content: center; gap: 42px; margin: 0; font-family: "Hiragino Mincho ProN", YuMincho, serif; }
.blue-gull-pagination button, .blue-gull-choice button { border: 1px solid #d9d2c6; border-radius: 12px; color: #526e63; background: rgba(255,255,255,.76); }
.blue-gull-pagination button { min-width: 180px; padding: 12px 20px; }
.blue-gull-pagination button:last-child { color: #fff; background: #678f7e; }
.blue-gull-pagination button:disabled,
.blue-gull-question button:disabled { cursor: not-allowed; }
.blue-gull-choice { display: flex; align-items: center; gap: 12px; width: min(1080px,100%); margin: 0 auto; padding: 16px 20px; border: 1px solid #e5ded4; border-radius: 16px; background: rgba(255,255,255,.58); }
.blue-gull-choice > span { color: #6c8d7e; font-weight: 700; white-space: nowrap; }
.blue-gull-choice p { flex: 1; margin: 0; font-family: "Hiragino Mincho ProN", YuMincho, serif; font-size: 13px; }
.blue-gull-choice button { padding: 11px 14px; font-size: 12px; white-space: nowrap; }
.blue-gull-nav-icon { display: inline-grid; width: 19px; place-items: center; color: #5398bb; font-family: Georgia, serif; font-size: 22px; font-weight: 700; }

@media (max-width: 900px) {
  .blue-gull-text-page { font-size: 10px; }
  .blue-gull-story-text { column-gap: 22px; }
  .blue-gull-choice { flex-wrap: wrap; }
  .blue-gull-panel { padding: 14px; }
  .blue-gull-header h1 { font-size: 25px; }
  .blue-gull-pagination { gap: 12px; }
  .blue-gull-pagination button { min-width: auto; padding: 9px 12px; }
}

/* スマホでも絵本の見開き構図は保ち、問題だけを紙面の下へ分ける。 */
@media (max-width: 760px) {
  .blue-gull-panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap: 12px;
    padding: 14px 16px 18px;
    overscroll-behavior: contain;
  }

  .blue-gull-header {
    flex: 0 0 auto;
    gap: 6px;
    padding: 0 108px 0 52px;
  }

  .blue-gull-header > span { font-size: 12px; }
  .blue-gull-header h1 { overflow: visible; margin: 0; font-size: 15px; letter-spacing: .015em; line-height: 1.2; white-space: nowrap; }
  .blue-gull-header p { overflow: visible; margin-top: 4px; font-size: 8px; line-height: 1.35; white-space: nowrap; }

  .blue-gull-reader-row {
    display: flex;
    width: 100%;
    min-height: auto;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .blue-gull-book,
  .blue-gull-reader-row:has(.blue-gull-question-dock:not(:empty)) .blue-gull-book {
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    background-image: var(--blue-gull-page-image);
    background-position: center;
    background-size: contain;
  }

  .blue-gull-book::before {
    display: none;
  }

  .blue-gull-page,
  .blue-gull-text-page,
  .blue-gull-book.blue-gull-page-2 .blue-gull-text-page,
  .blue-gull-book.blue-gull-page-5 .blue-gull-text-page,
  .blue-gull-book.blue-gull-page-7 .blue-gull-text-page {
    position: absolute;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 14px 18px;
    overflow: hidden;
    color: #4c514f;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.34;
    text-shadow: 0 1px 0 rgba(255,255,255,.68);
    transform: none;
    transform-origin: top left;
  }

  .blue-gull-text-page h2,
  .blue-gull-book.blue-gull-page-7 .blue-gull-text-page h2 {
    margin: 0 0 7px;
    color: #506e62;
    font-size: 17px;
    line-height: 1.25;
  }

  .blue-gull-text-page p,
  .blue-gull-book.blue-gull-page-7 .blue-gull-text-page p { margin: 0; }
  .blue-gull-text-page p + p,
  .blue-gull-book.blue-gull-page-7 .blue-gull-text-page p + p { margin-top: 4px; }
  .blue-gull-book.blue-gull-page-7 .blue-gull-text-page {
    padding: 10px 12px;
    color: #102e3d;
    border-radius: 0;
    background: transparent;
    font-size: 11px;
    line-height: 1.5;
    text-shadow: none;
  }
  .blue-gull-book.blue-gull-page-7 rt { color: #102e3d; }

  .blue-gull-book > .page-number-badge.page-number-blue-gull {
    right: 14px;
    bottom: 9px;
    font-size: 10px;
  }

  .blue-gull-question-dock {
    width: 100%;
    flex: 0 0 auto;
  }

  .blue-gull-question-dock .blue-gull-question {
    gap: 9px;
    margin: 0;
    padding: 16px;
    border-radius: 14px;
    font-size: 14px;
  }

  .blue-gull-question-dock .blue-gull-question p { margin-bottom: 4px; line-height: 1.55; }
  .blue-gull-question-dock .blue-gull-question button { min-height: 46px; padding: 10px 13px; font-size: 14px; line-height: 1.45; }
  .blue-gull-question-dock .blue-gull-question small { line-height: 1.5; }

  .blue-gull-pagination {
    width: 100%;
    flex: 0 0 auto;
    gap: 7px;
    padding-bottom: 2px;
  }

  .blue-gull-pagination button {
    min-width: 0;
    flex: 1 1 0;
    min-height: 44px;
    padding: 8px 7px;
    font-size: 13px;
    line-height: 1.3;
  }

  .blue-gull-pagination span { flex: 0 0 auto; font-size: 12px; white-space: nowrap; }
}

.documents-diary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 15px 17px;
  border: 1px solid #e4e7e1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: #737871;
  font: 600 14px/1.4 "Segoe UI", system-ui, sans-serif;
  text-align: left;
}

.documents-diary-item small {
  flex: 0 0 auto;
  color: #9a9e99;
  font-size: 11px;
  font-weight: 600;
}

.documents-diary-text {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.documents-diary-text strong {
  overflow: hidden;
  color: inherit;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.documents-diary-text em {
  overflow: hidden;
  color: #a0a49f;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.documents-diary-item.readable {
  border-color: #b8cdbb;
  background: #fff;
  color: #3f5945;
  cursor: pointer;
}

.documents-diary-item.readable small {
  color: #4f7b5b;
}

.documents-diary-item.unread-document {
  border-width: 3px;
}

/* 鍵付きの灰色カードも、未閲覧なら輪郭を背景と異なる色で明示する。 */
.documents-diary-item.forgotten-diary.unread-document {
  border-color: #f0cf67;
  box-shadow: 0 0 0 1px rgba(255, 248, 205, .42), 0 4px 13px rgba(26, 31, 34, .28);
}

.documents-diary-item.unread-document .documents-diary-text strong,
.documents-diary-item.unread-document .documents-diary-text em {
  font-weight: 800;
}

/* 最後に現れる四通だけは、通常の日記とは異なる記録として見せる。 */
.documents-diary-item.final-message-diary {
  border-color: #a8dbe8;
  background: linear-gradient(135deg, #f8feff 0%, #e8f8fc 52%, #f8fdff 100%);
  color: #24596b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 3px 12px rgba(74, 176, 204, .13);
}

.documents-diary-item.final-message-diary small {
  color: #287d98;
}

.documents-diary-item.final-message-diary .documents-diary-text em {
  color: #668d9b;
}

.documents-diary-item.final-message-diary.readable:hover,
.documents-diary-item.final-message-diary.readable:focus-visible {
  border-color: #5fb6d0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 5px 17px rgba(56, 164, 194, .22);
}

.documents-diary-item.forgotten-diary {
  border-color: #4d5356;
  background: linear-gradient(135deg, #5a6063, #454a4d);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 8px rgba(28,32,34,.14);
}

.documents-diary-item.forgotten-diary .documents-diary-text em,
.documents-diary-item.forgotten-diary small,
.documents-diary-item.forgotten-diary .diary-status.locked {
  color: #fff;
}

/* ダーク背景でも、状態は文字色だけで静かに区別する。 */
.documents-diary-item.forgotten-diary .diary-status.readable {
  color: #c4f3d5;
}

.documents-diary-item.forgotten-diary .diary-status.unavailable {
  color: #b8c0c5;
}

.documents-diary-item .diary-status.locked {
  position: relative;
  display: inline-block;
  padding-left: 17px;
  color: #8c8377;
}

.documents-diary-item .diary-status.locked::before {
  position: absolute;
  top: 5px;
  left: 0;
  width: 10px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  box-sizing: border-box;
  content: "";
}

.documents-diary-item .diary-status.locked::after {
  position: absolute;
  top: 0;
  left: 2px;
  width: 6px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  box-sizing: border-box;
  content: "";
}

.documents-diary-item.readable:hover,
.documents-diary-item.readable:focus-visible {
  border-color: #6e9b75;
  box-shadow: 0 4px 14px rgba(78, 114, 84, 0.12);
  outline: 0;
}

.plugins-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 26px;
}

.plugins-header h1,
.plugins-header p,
.plugins-section h2,
.plugin-card h3,
.plugin-card p,
.plugin-card small {
  margin: 0;
}

.plugins-header h1 {
  margin-top: 3px;
}

.plug-heading-icon {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--green-dark);
}

.plugins-header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.plugins-explore-button {
  padding: 10px 14px;
  border: 1px solid #c8d5ca;
  border-radius: 9px;
  background: #fffdfa;
  color: var(--green-dark);
  font: 700 13px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.plugins-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 620px;
  padding: 0 14px;
  border: 1px solid #d8ddd5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #848b82;
}

.plugins-search input {
  width: 100%;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 14px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.plugins-section {
  max-width: 760px;
  margin-top: 32px;
}

.plugins-section h2 {
  margin-bottom: 12px;
  color: #5a6058;
  font-size: 15px;
}

.plugin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.plugin-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid #dce1db;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.plugin-card.actionable { cursor: pointer; }
.plugin-card[aria-disabled="true"] { cursor: default; }

.plugin-card.enabled {
  border-color: #b9cbbc;
  background: linear-gradient(135deg, #fbfdf9, #eef5ee);
}

.plugin-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: #e7efe6;
  color: var(--green-dark);
  font-size: 19px;
}

.book-icon {
  position: relative;
  background: #e7efe6;
  color: var(--green-dark);
}

.book-icon::before,
.book-icon::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 10px;
  height: 19px;
  border: 1.6px solid currentColor;
  background: rgba(255, 255, 255, 0.34);
}

.book-icon::before {
  left: 7px;
  border-radius: 2px 0 0 3px;
}

.book-icon::after {
  right: 7px;
  border-left: 0;
  border-radius: 0 2px 3px 0;
}

.plugin-card h3 {
  color: #494e48;
  font-size: 14px;
}

.plugin-card p {
  margin-top: 4px;
  color: #7b817a;
  font-size: 12px;
  line-height: 1.45;
}

.plugin-card small {
  color: #818a80;
  font-size: 11px;
  white-space: nowrap;
}

.plugin-card.enabled small {
  color: #4f7b5b;
  font-weight: 700;
}

.plugin-card.downloadable {
  border-color: #9ebda4;
  background: linear-gradient(135deg, #fbfdf9, #e8f4e9);
}

.plugin-card.downloadable small {
  color: #39804b;
  font-weight: 700;
}

.plugin-card.downloading small,
.plugin-card.installing small {
  color: #50789d;
  font-weight: 700;
}

.plugin-card.downloading,
.plugin-card.installing {
  border-color: #b7cbe0;
  background: linear-gradient(135deg, #fbfdff, #edf5fb);
}

.side-nav button.menu-added-glow {
  animation: sidebar-menu-added-glow 1s ease-out;
}

@keyframes sidebar-menu-added-glow {
  0% { color: #4a6f63; background: transparent; box-shadow: 0 0 0 rgba(179,233,255,0); }
  35% { color: #1a78a6; background: rgba(222,247,255,.94); box-shadow: 0 0 18px rgba(156,221,249,.94), inset 0 0 12px rgba(255,255,255,.95); }
  100% { color: #4a6f63; background: transparent; box-shadow: 0 0 0 rgba(179,233,255,0); }
}

.album-header {
  padding: 18px 42px 10px;
  text-align: center;
}

.memory-archive-status {
  margin: 0 min(5vw, 54px);
  color: #4f6255;
  font: 600 12px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}

.memory-album {
  min-height: 0;
  overflow: auto;
  padding: 18px min(5vw, 54px) 34px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.memory-section {
  margin: 0 0 30px;
  padding: 18px;
  border: 1px solid rgba(213, 205, 195, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.memory-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.memory-section-header h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 19px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 18px;
}

.memory-tile {
  display: grid;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.memory-tile.locked {
  cursor: default;
}

.memory-tile.locked .photo-slot {
  place-items: center;
  background:
    linear-gradient(145deg, rgba(239, 238, 234, 0.96), rgba(221, 226, 222, 0.78)),
    repeating-linear-gradient(135deg, rgba(65, 82, 70, 0.06) 0 8px, transparent 8px 16px);
  color: #778079;
}

.memory-tile.locked .photo-slot::before {
  content: "—";
  color: rgba(65, 82, 70, 0.42);
  font-size: 28px;
}

.memory-hint {
  color: #7f7b73;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.memory-action-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #b8cbe0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(234, 243, 252, 0.96), rgba(250, 252, 255, 0.92));
  color: #314e6d;
  text-align: left;
}

.memory-action-card .gull-mark {
  font-size: 26px;
}

.memory-action-card strong,
.memory-action-card small {
  display: block;
}

.memory-action-card small {
  margin-top: 3px;
  color: #60768d;
}

.memory-action-card .action-label {
  font-weight: 800;
}

.memory-restore-button {
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  min-height: 38px;
  padding: 0 16px;
  font-weight: 800;
}

.photo-slot {
  display: grid;
  align-items: end;
  aspect-ratio: 4 / 3;
  min-height: 128px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 253, 249, 0.94), rgba(232, 240, 236, 0.64)),
    repeating-linear-gradient(135deg, rgba(111, 145, 126, 0.08) 0 8px, transparent 8px 16px);
  box-shadow: 0 10px 24px rgba(82, 73, 59, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.photo-slot.has-image {
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  background: #f5f1ea;
}

.photo-slot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.memory-tile:hover .photo-slot,
.memory-tile:focus-visible .photo-slot {
  transform: translateY(-2px);
  border-color: #b9c9bd;
  box-shadow: 0 16px 30px rgba(82, 73, 59, 0.12);
}

.photo-note {
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid rgba(213, 205, 195, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.84);
  color: #605f5a;
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
}

.memory-tile strong {
  overflow: hidden;
  color: #4a4b47;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-tile.unread-memory .photo-slot {
  border: 3px solid #222;
}

.memory-tile.unread-memory strong,
.memory-tile.unread-memory small {
  font-weight: 800;
}

.memory-tile small,
.memory-date {
  color: var(--muted);
  font-size: 12px;
}

.memory-dialog {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--text);
  padding: 0;
}

.memory-dialog::backdrop {
  background: rgba(67, 60, 50, 0.35);
}

.memory-dialog form {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px 24px 40px;
}

.memory-dialog h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 24px;
}

.memory-dialog-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f1ea;
}

.memory-dialog p {
  margin: 0;
  color: #565651;
  line-height: 1.75;
}

.memory-record-update {
  display: block;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #b8d9e4;
  color: #16739a;
  font-weight: 600;
  line-height: 1.8;
  white-space: pre-wrap;
}

.memory-dialog.diary-view {
  height: min(620px, calc(100vh - 32px));
  overflow: hidden;
}

.memory-dialog.diary-view form {
  height: 100%;
  box-sizing: border-box;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.memory-dialog.diary-view p {
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.memory-dialog.forgotten-diary-view {
  border-color: #363b3e;
  background: linear-gradient(145deg, #555b5e, #404548);
  color: #fff;
}

.memory-dialog.forgotten-diary-view .memory-date,
.memory-dialog.forgotten-diary-view h2,
.memory-dialog.forgotten-diary-view p {
  color: #fff;
}

.memory-dialog.forgotten-diary-view form {
  background: transparent;
}

.memory-dialog.forgotten-diary-view button {
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.15);
  color: #fff;
}

.memory-dialog.final-message-diary-view {
  border-color: #8fd2e5;
  background: linear-gradient(145deg, #f9feff, #e4f6fb);
  box-shadow: 0 22px 60px rgba(37, 123, 152, .22), inset 0 0 0 1px rgba(255,255,255,.88);
}

.memory-dialog.final-message-diary-view .memory-date,
.memory-dialog.final-message-diary-view h2 {
  color: #1d6278;
}

.memory-dialog.final-message-diary-view p {
  color: #244f5d;
}

.memory-dialog button {
  justify-self: end;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  min-height: 40px;
  padding: 0 18px;
  font-weight: 700;
}

.memory-dialog .ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--green-dark);
}

.puzzle-dialog fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.puzzle-dialog legend {
  padding: 0 6px;
  color: #494c48;
  font-weight: 800;
}

.puzzle-dialog label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #565651;
}

.puzzle-dialog input {
  accent-color: var(--green);
}

.will-dialog {
  width: min(720px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--text);
  padding: 0;
}

.will-dialog::backdrop {
  background: rgba(67, 60, 50, 0.35);
}

.will-dialog form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.will-dialog h2 {
  margin: 0;
  color: var(--green-dark);
}

.will-dialog pre {
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf2;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: inherit;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.answer-error {
  min-height: 1.4em;
  margin: 0;
  color: var(--danger);
}

.ending-page {
  display: grid;
  place-items: center;
  padding: 16px;
}

.ending {
  width: min(760px, 100%);
  padding: 42px;
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.ending h1 {
  margin: 0;
  color: var(--green-dark);
  font-size: clamp(34px, 6vw, 58px);
}

.ending p {
  margin: 0;
  color: #5d5b55;
  line-height: 1.9;
}

.case-kicker {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: calc(100vw - 20px);
    max-width: 720px;
    height: calc(100svh - 72px);
    top: 10px;
    margin: 0;
  }

  .case-panel {
    max-height: 260px;
    padding: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-row {
    margin-bottom: 16px;
  }

  .brand-name {
    font-size: 30px;
  }

  .recent-block {
    display: none;
  }

  .chat-header {
    grid-template-columns: 1fr;
    padding: 14px 16px 10px;
  }

  .account-menu {
    top: 14px;
    right: 144px;
  }

  .notification-menu {
    top: 14px;
    right: 192px;
  }

  .profile-button {
    width: 38px;
    height: 38px;
  }

  .chat-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .leaf-line {
    font-size: 22px;
  }

  h1 {
    font-size: 32px;
  }

  .chat-title p {
    font-size: 12px;
  }

  .messages {
    padding: 14px;
  }

  .album-header {
    padding: 14px 16px 10px;
  }

  .plugins-panel {
    padding: 22px 18px 34px;
  }

  .plugins-header {
    align-items: stretch;
    flex-direction: column;
  }

  .plugins-explore-button {
    align-self: flex-start;
  }

  .plugin-grid {
    grid-template-columns: 1fr;
  }

  .memory-album {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 14px;
    padding: 14px;
  }

  .message-stack {
    width: auto;
    max-width: calc(100% - 110px);
  }

  .message {
    font-size: 14px;
    padding: 13px 16px;
  }

  .chat-form {
    margin: 0 12px;
  }
}

/* ファイル末尾に置き、PC用の後続スタイルより優先するモバイル用デスクトップ。 */
@media (max-width: 900px) {
  html, body { width: 100%; max-width: 100%; overflow: hidden; }
  .desktop-screen { width: 100vw; max-width: 100vw; overflow: hidden; }

  .desktop-taskbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }
  .desktop-taskbar .search-box { min-width: 0; overflow: hidden; padding: 0 10px; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-taskbar .search-box { display: none; }
  .desktop-taskbar .taskbar-apps { justify-content: flex-start; gap: 4px; padding-left: 5px; }
  .desktop-taskbar .taskbar-tray { display: flex; align-items: center; height: 100%; }
  .desktop-taskbar .taskbar-tray > span,
  .desktop-taskbar .taskbar-tray .final-countdown { display: none !important; }
  .desktop-taskbar .news-toggle {
    width: 76px;
    min-width: 76px;
    padding: 0 4px;
    justify-content: flex-start;
    gap: 3px;
  }
  .desktop-taskbar .news-toggle > span:last-child {
    display: grid;
    min-width: 0;
    max-width: 50px;
  }
  .desktop-taskbar .news-toggle strong { display: none; }
  .desktop-taskbar .news-toggle small {
    display: block;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .desktop-taskbar .news-weather-mark { flex: 0 0 auto; font-size: 17px; }
  .desktop-taskbar .desktop-clock {
    width: 72px;
    min-width: 72px;
    padding: 0 4px;
    font-size: 9px;
    line-height: 1.25;
    text-align: center;
  }
  .desktop-taskbar .desktop-clock #desktopDate {
    display: block;
    font-size: 8px;
    white-space: nowrap;
  }

  .desktop-browser {
    position: fixed;
    top: 10px !important;
    right: 10px !important;
    bottom: 52px !important;
    left: 10px !important;
    width: auto !important;
    height: auto !important;
    max-width: none;
    transform: none !important;
  }
  .browser-toolbar { gap: 7px; padding: 0 8px; }
  .browser-address { min-width: 0; }
  .browser-titlebar > div:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .browser-window-controls button { width: 36px; }

  .app-shell {
    position: fixed;
    top: 10px !important;
    right: 10px !important;
    bottom: 52px !important;
    left: 10px !important;
    grid-template-columns: 1fr;
    grid-template-rows: 202px minmax(0, 1fr);
    width: auto !important;
    max-width: none;
    height: auto !important;
    margin: 0;
    transform: none !important;
    border-radius: 22px;
  }
  .case-panel { min-height: 0; max-height: none; padding: 14px 16px 10px; border-right: 0; overflow: hidden; }
  .brand-row { gap: 9px; margin-bottom: 10px; }
  .brand-name { font-size: 27px; }
  .new-chat-button { min-height: 40px; }
  .new-chat-button span { font-size: 21px; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 10px 0 0; padding: 0; border: 0; }
  .side-nav button { min-width: 0; min-height: 34px; gap: 7px; padding: 0 9px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
  .side-nav span { width: 16px; }
  .recent-block, .progress, .memoria-window-drag-handle { display: none; }
  .memoria-window-controls { top: 8px; right: 8px; }
  .memoria-window-controls button { width: 34px; height: 30px; }
  .account-menu { top: 214px; right: 14px; }
  .notification-menu { top: 214px; right: 62px; }
  .account-menu-panel,
  .notification-panel {
    position: fixed;
    top: 274px;
    right: 12px;
    left: 12px;
    z-index: 100;
    width: auto;
    max-height: calc(100dvh - 340px);
  }
  .chat-panel { grid-row: 2; }

  .sticky-notes-app {
    right: auto !important;
    bottom: 56px;
    left: 12px;
    width: min(310px, calc(100vw - 24px));
    max-height: calc(100dvh - 72px);
    overflow: auto;
  }
  .sticky-notes-header { position: sticky; top: 0; cursor: grab; touch-action: none; }
  .sticky-notes-header.dragging { cursor: grabbing; }
}

/* 最終優先のスマホ用メニュー。会話を常に主画面として表示する。 */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }
  .chat-panel { grid-row: 1; }
  .app-shell:not(.night-mode) .chat-panel {
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.72), transparent 32%), #f8fbfa;
  }

  .mobile-menu-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 46;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    color: #5d6968;
    font: 22px/1 system-ui, sans-serif;
  }

  .mobile-menu-backdrop {
    position: absolute;
    z-index: 55;
    display: block;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(29, 44, 45, 0.25);
  }
  .mobile-menu-backdrop[hidden] { display: none; }

  .case-panel {
    position: absolute;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 86vw);
    max-height: none;
    box-sizing: border-box;
    padding: 18px 16px 20px;
    border: 0;
    border-radius: 0 20px 20px 0;
    background: #faf9f6;
    box-shadow: 10px 0 24px rgba(23, 40, 39, 0.16);
    transform: translateX(-105%);
    transition: transform 0.2s ease, visibility 0.2s ease;
    visibility: hidden;
  }
  .app-shell.mobile-menu-open .case-panel { transform: translateX(0); visibility: visible; }

  .brand-row { margin-bottom: 16px; }
  .new-chat-button { min-height: 46px; }
  .side-nav { grid-template-columns: 1fr; gap: 4px; margin-top: 12px; }
  .case-panel .recent-block {
    display: grid;
    flex: 0 0 auto;
    gap: 7px;
    margin-top: 16px;
  }
  .case-panel .recent-list {
    max-height: 142px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .case-panel .recent-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 44px;
    padding: 6px;
  }
  .case-panel .recent-item strong { font-size: 13px; }
  .case-panel .progress {
    display: grid;
    margin-top: auto;
    padding: 18px 4px 0;
    border-top: 1px solid var(--line);
    font-size: 12px;
  }
  .case-panel .progress small { font-size: 11px; }

  .mobile-menu-utilities { display: grid; gap: 6px; margin-top: 14px; }
  .mobile-menu-utilities .account-menu,
  .mobile-menu-utilities .notification-menu { position: relative; top: auto; right: auto; z-index: auto; }
  .mobile-menu-utilities .profile-button,
  .mobile-menu-utilities .notification-button {
    display: flex;
    width: 100%;
    height: 40px;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 18px;
  }
  .mobile-menu-utilities .profile-button::after { content: '계정·표시 모드'; font: 600 13px/1 system-ui, sans-serif; }
  .mobile-menu-utilities .notification-button::after { content: 'memoria 정보·알림'; font: 600 13px/1 system-ui, sans-serif; }
  .mobile-menu-utilities .account-menu-panel,
  .mobile-menu-utilities .notification-panel {
    position: absolute;
    z-index: 65;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    width: auto;
    max-height: min(360px, calc(100dvh - 220px));
  }

  /* 左上のメニューボタンと、各画面の見出しを重ねない。 */
  .plugins-panel { padding: 70px 18px 34px; }

  .chat-header { min-height: 70px; box-sizing: border-box; padding: 16px 62px 10px; }
  .chat-title { text-align: left; }
  .chat-title h1 { font-size: 25px; }
  .chat-title p { font-size: 11px; }
  .messages { padding: 8px 14px 18px; }
  .message-row { width: 100%; }
  .message-row.assistant .message-stack { max-width: calc(100% - 104px); }
  .chat-form {
    width: calc(100% - 24px);
    margin: 0 12px;
    padding: 9px 11px 9px 14px;
  }
  .chat-form button { width: 44px; min-height: 44px; }

  .desktop-taskbar .desktop-clock {
    display: flex;
    width: 72px;
    min-width: 72px;
    height: 42px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 2px 4px;
    font-size: 10px;
    line-height: 1.05;
    text-align: center;
  }
  .desktop-taskbar .desktop-clock #desktopTime { display: block; line-height: 1.05; }
  .desktop-taskbar .desktop-clock #desktopDate { display: block; font-size: 8px; line-height: 1.05; white-space: nowrap; }
}

/* Zoomin とタスクバーは、仮想デスクトップを狭い画面で表示しても横にはみ出さない。 */
@media (max-width: 900px) {
  .desktop-taskbar .taskbar-apps {
    min-width: 0;
    gap: 3px;
    padding-left: 3px;
  }

  .desktop-taskbar .taskbar-apps > button {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  /* メインストーリーは右端の単独アイコンにし、アプリ用の幅を確保する。 */
  .desktop-taskbar .news-toggle {
    width: 38px;
    min-width: 38px;
    justify-content: center;
    padding: 0;
  }
  .desktop-taskbar .news-toggle > span:last-child { display: none; }
  .desktop-taskbar .news-weather-mark { font-size: 18px; }
  .desktop-taskbar .desktop-clock { width: 64px; min-width: 64px; padding-right: 2px; padding-left: 2px; }

  .zoomin-download-page { width: 100%; min-width: 0; max-width: 100%; overflow-x: hidden; }
  .zoomin-site-header {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    gap: 12px;
    padding-right: 52px;
    padding-left: 16px;
  }
  .zoomin-brand { flex: 0 0 auto; font-size: 27px; }
  .zoomin-site-header > a:last-child { min-width: 0; margin-left: auto; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .zoomin-download-main {
    width: auto;
    max-width: 960px;
    min-width: 0;
    box-sizing: border-box;
    /* 右端には本文で約5文字分の余白を常に残す。 */
    margin-right: clamp(64px, 8vw, 88px);
    margin-left: 24px;
  }
  .zoomin-download-main h1,
  .zoomin-download-main h2 { max-width: 100%; overflow-wrap: anywhere; }
  .zoomin-download-main h2 { font-size: clamp(27px, 8vw, 38px); letter-spacing: -1.4px; }
  .zoomin-lead { max-width: 100%; font-size: 14px; overflow-wrap: anywhere; }
  .zoomin-primary-download { width: 100%; min-width: 0; box-sizing: border-box; padding: 18px; }
  .zoomin-primary-download > div:not(.zoomin-app-mark),
  .zoomin-download-grid article { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 760px) {
  /* inset と translate を併用せず、接続中ダイアログを必ずアプリ中央へ置く。 */
  .zoomin-meeting-connect-dialog {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(280px, calc(100% - 28px));
    min-height: 220px;
    aspect-ratio: auto;
    transform: translate(-50%, -50%);
  }
  .zoomin-connect-brand strong { font-size: 30px; }
  .zoomin-connect-brand b { font-size: 26px; }
}

@media (max-width: 900px) {
  /* Zoomin本文の右端ではなく、ブラウザ内の安全な位置に番号を固定する。 */
  .desktop-browser:has(.zoomin-download-page:not([hidden])) > .page-number-badge {
    right: 72px;
  }

  /* 残り時間はbody直下のオーバーレイにし、ブラウザ・memoria・各モーダルより前面へ出す。 */
  body > .final-countdown:not([hidden]) {
    position: fixed;
    /* 画面内のウィンドウやモーダルより常に前面に出す。 */
    z-index: 2147483646;
    top: 10px;
    left: 10px;
    display: inline-grid !important;
    min-width: 78px;
    pointer-events: none;
  }
}

/* Phase 1終幕の警告。アプリやブラウザより常に前面へ出す。 */
.phase1-memory-restart-alert {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 29, 47, .42);
}

.phase1-memory-restart-alert[hidden] { display: none; }

.phase1-memory-restart-dialog {
  width: min(540px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid #667b91;
  border-radius: 3px;
  background: #f4f6f8;
  box-shadow: 0 22px 54px rgba(5, 15, 28, .52);
  color: #182332;
  font: 16px/1.75 "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

.phase1-memory-restart-dialog header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #3d82c5, #2364a6);
  color: #fff;
}

.phase1-memory-restart-dialog h2 { margin: 0; font-size: 17px; font-weight: 600; }
.phase1-memory-restart-icon {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #2b6eae;
  font-weight: 800;
}
.phase1-memory-restart-dialog > p { margin: 0; padding: 27px 28px 20px; }
.phase1-memory-restart-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}
.phase1-memory-restart-actions button {
  min-width: 90px;
  min-height: 36px;
  border: 1px solid #71869a;
  border-radius: 2px;
  background: linear-gradient(#fff, #e4e9ee);
  color: #172638;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.phase1-memory-restart-actions button:focus-visible { outline: 3px solid #76b8ff; outline-offset: 2px; }
.phase1-memory-restart-actions button:active { background: #d6e0e9; }

@media (max-width: 700px) {
  .phase1-memory-restart-alert { padding: 14px; }
  .phase1-memory-restart-dialog { width: min(540px, calc(100vw - 28px)); font-size: 14px; }
  .phase1-memory-restart-dialog header { min-height: 44px; padding: 7px 12px; }
  .phase1-memory-restart-dialog h2 { font-size: 15px; line-height: 1.35; }
  .phase1-memory-restart-dialog > p { padding: 22px 20px 18px; }
  .phase1-memory-restart-actions { padding: 0 16px 16px; }
  .phase1-memory-restart-actions button { min-width: 78px; min-height: 34px; }
}

/* Zoomin はモバイルでは、横長のデスクトップアプリではなく Zoom のホーム画面に合わせた構成にする。 */
.zoomin-mobile-nav { display: none; }

@media (max-width: 900px) {
  .zoomin-app:not(.meeting-active) {
    top: 6%;
    right: 10px;
    bottom: 52px;
    left: 10px;
    width: auto;
    height: auto;
    min-width: 0;
    border: 1px solid #d3d9e1;
    border-radius: 10px;
    box-shadow: 0 20px 54px rgba(6, 24, 48, .42);
    background: #dce1e7;
    transform: none;
  }

  .zoomin-app:not(.meeting-active) .zoomin-app-titlebar {
    height: 62px;
    min-height: 62px;
    padding: 0 16px;
    background: #f4f6f8;
    border-bottom: 1px solid #dbe2eb;
    cursor: default;
    touch-action: auto;
  }

  .zoomin-app:not(.meeting-active) .zoomin-app-title {
    min-width: 0;
    gap: 12px !important;
    line-height: 1;
  }

  .zoomin-app:not(.meeting-active) .zoomin-app-title .zoomin-mini-mark {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #7772c7;
    color: #fff;
    font-size: 21px;
    font-weight: 700;
  }

  .zoomin-app:not(.meeting-active) .zoomin-app-title .zoomin-mini-mark i { display: none; }
  .zoomin-app:not(.meeting-active) .zoomin-app-title .zoomin-mini-mark::before { content: "기"; }
  .zoomin-app:not(.meeting-active) .zoomin-app-title .zoomin-mini-mark::after { position: absolute; top: -3px; right: -4px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 3px; background: #14a54b; content: ""; }
  .zoomin-app:not(.meeting-active) .zoomin-app-title > strong { display: none; }
  .zoomin-app:not(.meeting-active) .zoomin-app-title::after { color: #05070b; content: "홈"; font-size: clamp(26px, 7vw, 38px); font-weight: 750; letter-spacing: -.055em; }

  .zoomin-app:not(.meeting-active) .zoomin-title-actions { gap: 4px; }
  .zoomin-app:not(.meeting-active) .zoomin-title-actions button { display: none; width: 29px; height: 29px; border-radius: 6px; background: transparent; box-shadow: none; color: #45566b; font-size: 18px; }
  .zoomin-app:not(.meeting-active) .zoomin-title-actions button:nth-child(3),
  .zoomin-app:not(.meeting-active) .zoomin-title-actions button:nth-child(4) { display: grid; }

  .zoomin-app:not(.meeting-active) .zoomin-app-content { display: block; height: calc(100% - 62px); padding: 0; background: #fff; }
  .zoomin-app:not(.meeting-active) .zoomin-side-nav { display: none; }
  .zoomin-app:not(.meeting-active) .zoomin-home { position: relative; height: 100%; overflow: hidden; border-radius: 0; background: #fff; }
  .zoomin-app:not(.meeting-active) .zoomin-home-time { display: none; }

  .zoomin-app:not(.meeting-active) .zoomin-home-actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 22px 11px 24px; border-bottom: 1px solid #e6e9ef; }
  .zoomin-app:not(.meeting-active) .zoomin-home-actions button { width: auto; min-width: 0; gap: 8px; color: #666a74; font-size: clamp(9px, 2.45vw, 13px); font-weight: 600; letter-spacing: -.035em; line-height: 1.25; }
  .zoomin-app:not(.meeting-active) .zoomin-home-actions i { width: clamp(47px, 13vw, 68px); height: clamp(47px, 13vw, 68px); border-radius: 17px; font-size: clamp(24px, 7vw, 34px); }
  .zoomin-app:not(.meeting-active) .zoomin-home-actions .zoomin-action-new i b { width: 47%; height: 34%; }
  .zoomin-app:not(.meeting-active) .zoomin-home-actions .zoomin-action-new i b::after { top: 17%; right: -27%; width: 27%; height: 66%; }

  .zoomin-app:not(.meeting-active) .zoomin-schedule-card { width: 100%; height: calc(100% - 132px); margin: 0; border: 0; border-radius: 0; color: #151925; }
  .zoomin-app:not(.meeting-active) .zoomin-schedule-card > header,
  .zoomin-app:not(.meeting-active) .zoomin-schedule-nav,
  .zoomin-app:not(.meeting-active) .zoomin-schedule-card > footer { display: none; }
  .zoomin-app:not(.meeting-active) .zoomin-schedule-card::before { display: grid; height: 60px; place-items: center; border-bottom: 1px solid #edf0f4; color: #1772ee; content: "캘린더 추가"; font-size: 16px; font-weight: 650; }
  .zoomin-app:not(.meeting-active) .zoomin-empty-schedule { min-height: 0; height: calc(100% - 60px); place-content: center; gap: 17px; padding: 0 26px 92px; color: #1d2130; text-align: center; }
  .zoomin-app:not(.meeting-active) .zoomin-empty-schedule > span { display: none; }
  .zoomin-app:not(.meeting-active) .zoomin-empty-schedule p { max-width: 330px; margin: 0; font-size: clamp(18px, 5.2vw, 27px); font-weight: 500; line-height: 1.38; }

  .zoomin-mobile-nav { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); min-height: 70px; padding: 7px 4px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid #dfe3e9; background: rgba(255,255,255,.98); }
  .zoomin-mobile-nav button { display: grid; min-width: 0; place-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: #71737d; font: 10px/1.2 "Segoe UI", "Hiragino Sans", sans-serif; cursor: pointer; }
  .zoomin-mobile-nav svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .zoomin-mobile-nav strong { height: 25px; color: currentColor; font-size: 18px; line-height: 16px; letter-spacing: 1px; }
  .zoomin-mobile-nav button.active { color: #1772ee; font-weight: 700; }
  .zoomin-mobile-nav button.active svg { fill: currentColor; }
  .zoomin-app:not(.meeting-active) .zoomin-home > .page-number-badge {
    position: absolute;
    z-index: 3;
    right: 10px;
    bottom: 78px;
    margin: 0;
    padding: 3px 5px;
    border-radius: 3px;
    background: rgba(255,255,255,.9);
    color: #7c8793;
  }

  .zoomin-app.meeting-active { top: 6%; right: 10px; bottom: 52px; left: 10px; width: auto; height: auto; min-width: 0; border: 1px solid #d3d9e1; border-radius: 10px; transform: none; }
  .zoomin-app.meeting-active .zoomin-app-content { height: calc(100% - 46px); }
  .zoomin-app.meeting-active .zoomin-meeting-screen > main { grid-template-columns: 1fr; grid-template-rows: minmax(190px, 42%) minmax(0, 1fr); }
  .zoomin-app.meeting-active .zoomin-audio-stage { border-right: 0; border-bottom: 1px solid #414854; }
  .zoomin-app.meeting-active .zoomin-ai-notes { border-left: 0; }
  .zoomin-app.meeting-active .zoomin-meeting-footer { gap: min(9vw, 42px); }
}


/* メッセージ作成欄：1行時は文字と送信ボタンの中心線を合わせ、会話を切り替えても前の高さを残さない。 */
.sms-compose {
  align-items: center;
}

.sms-compose textarea {
  height: 38px;
  min-height: 38px;
  padding: 7px 13px;
  line-height: 20px;
}

.sms-compose button {
  flex: 0 0 34px;
  align-self: center;
}

/* Phase 1：メモリ不足の警告は閉じてもタスクバーから再表示できる。 */
.taskbar-memory-alert-icon {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #f0bc20;
  font: 22px/1 system-ui, sans-serif;
  cursor: pointer;
}
.taskbar-memory-alert-icon > span {
  display: block;
  align-self: center;
  justify-self: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  transform: translateY(1px);
}
.taskbar-memory-alert-icon::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #d8403d;
  content: "";
}
.taskbar-memory-alert-icon:hover,
.taskbar-memory-alert-icon:focus-visible { background: rgba(255,255,255,.15); outline: 0; }
.taskbar-memory-alert-icon[hidden] { display: none; }

.phase1-reboot-overlay {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  color: #e8effa;
  font: 15px/1.6 "Segoe UI", "Hiragino Sans", sans-serif;
  animation: phase1-reboot-fade .52s ease both;
}
.phase1-reboot-overlay[hidden] { display: none; }
.phase1-reboot-overlay > div { display: grid; justify-items: center; gap: 16px; opacity: 0; animation: phase1-reboot-message 1.4s .35s ease both; }
.phase1-reboot-overlay p { margin: 0; letter-spacing: .12em; }
.phase1-reboot-spinner { width: 42px; height: 42px; border: 4px solid rgba(207,225,255,.22); border-top-color: #eaf4ff; border-radius: 50%; animation: phase1-reboot-spin .9s linear infinite; }
body.phase1-rebooting { cursor: wait; }
@keyframes phase1-reboot-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes phase1-reboot-message { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes phase1-reboot-spin { to { transform: rotate(1turn); } }
@media (max-width: 900px) { .desktop-taskbar .taskbar-memory-alert-icon { flex: 0 0 30px; width: 30px; height: 30px; font-size: 18px; } .desktop-taskbar .taskbar-memory-alert-icon::after { top: 2px; right: 2px; width: 6px; height: 6px; } }
@media (prefers-reduced-motion: reduce) { .phase1-reboot-overlay, .phase1-reboot-overlay > div, .phase1-reboot-spinner { animation: none; opacity: 1; } }

/* Android Chromeでもブラウザ内ページのiframeを縦方向に最後まで操作できるようにする。 */
@media (max-width: 900px) {
  .desktop-browser iframe:not([hidden]) {
    touch-action: pan-y;
    overscroll-behavior-y: auto;
  }
}

/* All reader sizes share the same logical paper; JS scales it with the image. */
.blue-gull-panel .blue-gull-book .blue-gull-text-page {
  position: absolute;
  margin: 0;
  padding: 14px 18px;
  font-size: 11px;
  line-height: 1.34;
  transform-origin: top left;
}
.blue-gull-panel .blue-gull-book .blue-gull-text-page h2 { font-size: 17px; line-height: 1.25; }
.blue-gull-panel .blue-gull-book .blue-gull-text-page p { margin: 0; }
.blue-gull-panel .blue-gull-book .blue-gull-text-page p + p { margin-top: 4px; }
.blue-gull-panel .blue-gull-book.blue-gull-page-7 .blue-gull-text-page { padding: 10px 12px; line-height: 1.5; }
