[hidden] { display: none !important; }
:root {
  --bg-secondary: #f7f8f6; --text-primary: #273740; --text-secondary: #65737a; --text-tertiary: #65737a;
  --border: #d9e0df; --border-light: #e6eae7; --accent: #405d70; --accent-soft: #eaf0f3;
  --calendar-green: #4a9d5b; --calendar-green-tint: #ecf5ee;
  --task-purple: #7c5cbf; --task-purple-tint: #f0ebf9; --muji-red: #405d70; --now-color: #c9252b;
  --left-pane-w: 208px; --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
:root[data-theme=dark] { --accent: #a2bdce; --accent-soft: #263843; --bg-secondary: #1e2529; --calendar-green-tint: #213126; --task-purple-tint: #2a2440; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.auth-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg-secondary); }
.auth-card { max-width: 400px; width: 100%; background: var(--bg); border: 1px solid var(--border-light); padding: 36px; border-radius: 12px; }
.auth-card h1 { font-size: 24px; margin: 16px 0 6px; }
.auth-card form, .private-form { display: flex; flex-direction: column; gap: 18px; }
.private-muted { color: var(--text-secondary); font-size: 13px; }
.private-header { gap: 12px; height: auto; min-height: 68px; padding: 12px 24px; flex-wrap: wrap; }
.private-header h1 { white-space: nowrap; font-size: 18px; }
.private-account { padding: 16px; display: grid; gap: 10px; font-size: 12px; overflow-wrap: anywhere; }
.private-account .btn { justify-content: center; }
.private-overview { padding: 0 20px; font-size: 14px; }
.nav-glyph { font-size: 22px; line-height: 1; margin-right: 8px; width: 22px; text-align: center; }
.private-mobile-settings { display: none; }
input:not([type=checkbox]):not([type=file]), textarea, select { box-sizing: border-box; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); color: var(--text-primary); padding: 10px 12px; font: inherit; min-width: 0; max-width: 100%; box-shadow: none; }
#place-autocomplete gmp-place-autocomplete { box-sizing: border-box; width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); color: var(--text-primary); color-scheme: light; box-shadow: none; }
:root[data-theme=dark] #place-autocomplete gmp-place-autocomplete { color-scheme: dark; }
.private-form label, .auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.private-form input, .private-form textarea, .private-form select, .auth-card input { width: 100%; }
.private-form textarea { min-height: 120px; resize: vertical; }
.private-form .check-label { flex-direction: row; align-items: center; }
.private-form input[type=checkbox] { width: 20px; height: 20px; }
.private-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.private-actions, .calendar-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.private-actions { justify-content: flex-end; }
.btn { min-height: 44px; cursor: pointer; }
.btn[disabled] { cursor: wait; opacity: .6; }
.calendar-toolbar { padding: 20px 24px 16px; }
.calendar-toolbar h2 { margin: 0 auto 0 8px; font-size: 20px; }
.view-switch { display: flex; overflow: hidden; }
.view-switch button { min-width: 44px; min-height: 44px; padding: 8px 14px; }
.private-calendar { margin: 0 24px; border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; }
.calendar-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; padding-right: 24px; }
.calendar-workspace .day-agenda { padding: 0; }
.calendar-workspace .agenda-columns { grid-template-columns: 1fr; gap: 16px; }
.calendar-workspace .private-day { min-height: 96px; }
.calendar-workspace .day-agenda h2 { display: flex; align-items: center; justify-content: space-between; font-size: 15px; gap: 4px; }
.calendar-workspace details { padding: 12px 0; font-size: 13px; }
.private-calendar .cal-week-header { background: var(--bg-secondary); }
.private-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.private-day { min-height: 112px; border: 0; border-right: 1px solid var(--border-light); border-top: 1px solid var(--border-light); padding: 8px; min-width: 0; cursor: pointer; }
.private-day:nth-child(7n) { border-right: 0; }
.private-day.outside { color: var(--text-tertiary); background: var(--bg-secondary); }
.private-day.selected { box-shadow: inset 0 0 0 2px var(--text-primary); }
.private-date { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.private-day.today .private-date { background: var(--muji-red); color: white; }
.private-chip { display: block; width: 100%; margin-top: 4px; padding: 4px 6px; background: var(--calendar-green-tint); color: var(--text-primary); border-radius: 4px; text-align: left; font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; min-height: 28px; }
.private-chip.task { background: var(--task-purple-tint); border-left: 3px solid var(--task-purple); }
.private-chip.event { border-left: 3px solid var(--calendar-green); }
.private-chip.done, .record-row.done .record-title { text-decoration: line-through; opacity: .65; }
.private-month .private-day { height: 124px; min-height: 0; padding: 4px; overflow: hidden; }
.private-month .private-date { display: grid; width: 24px; height: 24px; font-size: 13px; }
.private-month .private-chip { margin-top: 2px; padding: 2px 6px; min-height: 0; height: 20px; font-size: 12px; line-height: 16px; }
.private-month .private-more { margin-top: 2px; padding: 2px 6px; height: 20px; font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; }
.day-agenda, .private-section { padding: 24px; }
.day-agenda .calendar-month-back { display: none; }
.day-agenda h2, .private-section h2 { font-size: 17px; margin: 0 0 16px; }
.agenda-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.agenda-block { background: var(--bg-secondary); padding: 16px; border-radius: 8px; }
.agenda-block h3 { font-size: 14px; margin: 0 0 12px; }
.record-row { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.record-row:last-child { border-bottom: 0; }
.record-row button.record-open { text-align: left; flex: 1; min-width: 0; padding: 4px; cursor: pointer; }
.record-title { display: block; font-size: 14px; overflow-wrap: anywhere; }
.record-meta { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.task-check { width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0; cursor: pointer; }
.task-check input { width: 20px; height: 20px; cursor: pointer; }
.private-empty { font-size: 14px; color: var(--text-secondary); padding: 16px 0; }
.private-more { color: var(--text-secondary); font-size: 12px; padding: 4px; }
#private-content:has(.private-week) { display: flex; flex-direction: column; }
#private-content:has(.private-week) .calendar-toolbar { flex-shrink: 0; }
.calendar-workspace:has(.private-week) { flex: 1; min-height: 0; align-items: stretch; }
.private-week { display: flex; flex-direction: column; min-height: 0; }
.private-week .cal-week-header { flex-shrink: 0; }
.private-week .private-grid { flex: 1; min-height: 0; overflow-y: auto; }
.private-week .private-day { min-height: 0; }
.calendar-workspace:has(.private-week) .day-agenda { overflow-y: auto; }
.private-hours { display: grid; grid-template-columns: 64px 1fr; position: relative; }
.day-now-marker { position: absolute; left: 64px; right: 0; height: 2px; z-index: 3; background: var(--now-color); pointer-events: none; }
.day-now-marker span { position: absolute; right: 100%; top: -12px; min-width: 48px; padding: 3px 5px; border-radius: var(--radius-lg); background: var(--now-color); color: var(--white); text-align: center; font-size: 11px; line-height: 18px; font-variant-numeric: tabular-nums; }
.day-now-marker::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--now-color); }
.week-scroll-hint { display: none; }
.day-all-day { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0; padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--border-light); cursor: default; }
.day-all-day h3 { margin: 0; padding: 8px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.day-all-day > div { min-width: 0; padding-right: 8px; }
.day-all-day .private-chip { min-height: 32px; margin: 0 0 4px; }
.day-all-day .private-chip:last-child { margin-bottom: 0; }
.place-position-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--text-secondary); font-size: 12px; }
.place-position-notice .btn { margin-left: auto; }
.hour-label { height: 62px; padding: 16px 8px; color: var(--text-secondary); font-size: 12px; border-top: 1px solid var(--border-light); }
.hour-slot { height: 62px; border-top: 1px solid var(--border-light); padding: 8px; cursor: pointer; }
.day-time-events { position: absolute; inset: 0 0 0 64px; pointer-events: none; }
.day-time-event { position: absolute; pointer-events: auto; }
.day-time-event .private-chip { margin: 0; height: 100%; padding: 2px 6px; font-size: 12px; line-height: 1.1; white-space: normal; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; }
.day-time-event .chip-time { white-space: nowrap; }
.private-chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.private-chip.dragging { opacity: .5; }
.touch-drag-ghost { position: fixed; z-index: 200; pointer-events: none; max-width: 240px; padding: 10px 14px; background: var(--bg); border: 2px solid var(--task-purple); border-radius: 6px; box-shadow: var(--shadow-3); font-size: 13px; }
.hour-slot:focus-visible, .private-day:focus-visible { outline: 2px solid var(--muji-red); outline-offset: -2px; }
.drop-hover { outline: 2px dashed var(--task-purple); outline-offset: -2px; }
.journal-card { padding: 20px 0; border-bottom: 1px solid var(--border-light); }
.journal-date { font-size: 13px; color: var(--text-secondary); }
.journal-card h3 { font-size: 16px; margin: 8px 0; }
.journal-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.private-photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.private-photos img { width: 112px; height: 112px; object-fit: cover; border-radius: 6px; }
.photo-open { display: flex; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 6px; }
.private-photo-dialog { position: fixed; inset: 0; margin: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; background: transparent; color: white; overflow: hidden; }
.private-photo-dialog::backdrop { background: rgba(0,0,0,.9); }
.photo-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.photo-stage img { max-width: 90%; max-height: 80%; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 30px #0008; }
.photo-close, .photo-prev, .photo-next { position: absolute; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: #0009; color: white; font-size: 28px; cursor: pointer; }
.photo-close { top: 16px; right: 16px; }
.photo-prev, .photo-next { top: 50%; transform: translateY(-50%); }
.photo-prev { left: 16px; }
.photo-next { right: 16px; }
.private-photo-dialog button:disabled { opacity: .25; cursor: default; }
.photo-counter { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: #0009; font-size: 13px; }
.photo-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.photo-dots button { width: 24px; height: 32px; padding: 8px; border: 0; background: transparent; cursor: pointer; }
.photo-dots button::after { content: ''; display: block; width: 8px; height: 8px; border-radius: 50%; background: #ffffff73; }
.photo-dots button[aria-pressed="true"]::after { background: white; transform: scale(1.2); }
.private-photo { position: relative; }
.private-photo button { display: block; font-size: 12px; padding: 8px; min-height: 44px; cursor: pointer; }
.place-tag { display: inline-block; border-radius: 4px; background: var(--map-blue-tint); padding: 6px 10px; font-size: 12px; cursor: pointer; margin-top: 8px; }
.private-place-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.place-card { padding: 20px; border: 1px solid var(--border-light); border-radius: 8px; }
.place-card h3 { margin: 0 0 8px; font-size: 16px; }
#private-map { height: 360px; border-radius: 8px; margin-bottom: 20px; background: var(--bg-secondary); }
.private-dialog { max-width: 620px; width: calc(100% - 32px); max-height: 90dvh; border: 1px solid var(--border); border-radius: 12px; padding: 24px; background: var(--bg); color: var(--text-primary); }
.private-dialog::backdrop { background: #0006; }
.private-dialog.private-discard-dialog { width: calc(100% - 32px); max-width: 440px; height: fit-content; margin: auto; border-radius: 12px; }
.discard-body { padding: 0 24px 24px; }
.discard-body p { margin: 0 0 20px; color: var(--text-secondary); line-height: 1.8; }
.discard-body .private-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.private-dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.private-dialog h2 { font-size: 18px; margin: 0; }
.kind-picker { display: grid; gap: 12px; }
.kind-picker button { text-align: left; padding: 18px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.private-form details { border-top: 1px solid var(--border-light); padding-top: 12px; }
.private-form summary { cursor: pointer; margin-bottom: 12px; font-size: 14px; min-height: 32px; }
.form-error { color: var(--danger); font-size: 14px; white-space: pre-wrap; scroll-margin-block: 88px; }
.form-error:focus { outline: 2px solid var(--danger); outline-offset: 4px; }
.private-status { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text-primary); color: var(--bg); padding: 12px 18px; border-radius: 8px; box-shadow: var(--shadow-3); z-index: 150; display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 24px); }
.private-status button { background: var(--bg); color: var(--text-primary); padding: 8px 12px; border-radius: 4px; min-height: 44px; white-space: nowrap; cursor: pointer; }
.private-search-results { position: absolute; right: 24px; top: 68px; width: min(480px, calc(100vw - 48px)); max-height: 65dvh; overflow: auto; background: var(--bg); box-shadow: var(--shadow-3); z-index: 40; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.private-search-results h2 { font-size: 14px; margin: 8px 0; }
.settings-group { max-width: 720px; margin-bottom: 24px; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--border-light); }
.settings-group h2 { font-size: 15px; margin: 0 0 12px; }
.settings-group > label { display: flex; align-items: center; gap: 12px; font-size: 14px; min-height: 44px; }
.settings-group > label > select { height: 44px; }
.settings-group p { line-height: 1.8; }
.settings-group h3 { margin: 20px 0 8px; font-size: 13px; font-weight: 500; }
.settings-group .btn { margin: 4px 8px 4px 0; }
.file-field { display: grid; gap: 6px; margin-top: 16px; }
.file-field label { font-size: 14px; font-weight: 500; }
.file-field p { margin: 0; }
input[type=file] { box-sizing: border-box; width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); color: var(--text-primary); font: inherit; font-size: 13px; box-shadow: none; cursor: pointer; }
input[type=file]::file-selector-button { min-height: 42px; margin-right: 12px; padding: 10px 14px; border: 0; border-right: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-weight: 500; cursor: pointer; }
.btn:focus-visible, .view-switch button:focus-visible, .kind-picker button:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.private-empty-state { display: grid; justify-items: center; gap: 8px; max-width: 360px; margin: 48px auto; padding: 32px 24px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; }
.private-empty-state h3 { margin: 0; font-size: 16px; }
.private-empty-state p { margin: 0 0 8px; color: var(--text-secondary); font-size: 13px; }
.private-place-list .private-empty-state { grid-column: 1 / -1; }
.lp-section-label { margin: 0; }
.private-overview { margin: 0 0 20px; padding: 0; }
.private-dialog { padding: 0; overflow: auto; }
.private-dialog header { position: sticky; top: 0; z-index: 1; margin: 0; padding: 16px 24px 12px; background: var(--bg); }
.private-dialog header .btn { min-width: 44px; font-size: 20px; }
#dialog-content { padding: 0 24px 24px; }
.private-dialog:focus { outline: none; }
#dialog-content > .private-actions { margin-top: 12px; }
.private-form > .private-actions { position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); }
.private-section + .private-section { padding-top: 0; }
.private-section:has(+ .private-section) { padding-bottom: 0; }
.import-preview { padding: 16px; background: var(--bg-secondary); margin-top: 16px; border-radius: 8px; }
.cp-body { overflow-y: auto; }
@media (max-width: 1024px) {
  .app-shell { display: block; width: 100%; height: 100dvh; padding: 0 0 calc(64px + env(safe-area-inset-bottom)); }
  .left-pane { display: none; }
  #private-shell .center-pane { height: 100%; padding: 0; margin: 0; }
  .cp-header.private-header { display: flex; position: static; gap: 8px; padding: 12px 16px; }
  .private-header .cp-header-title { display: block; }
  .private-search { order: 5; width: 100%; }
  .private-mobile-settings { display: inline-flex; min-width: 44px; font-size: 20px; }
  .cp-header.private-header #google-connect { font-size: 13px; padding: 8px 12px; }
  .private-dialog { width: 100%; max-width: none; margin: auto 0 0; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .cp-body { padding: 0; }
  .mobile-tabbar { display: flex; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-tabbar .nav-glyph { margin: 0; }
  .calendar-toolbar { padding: 16px; }
  .calendar-toolbar h2 { font-size: 18px; }
  .view-switch { width: 100%; }
  .view-switch button { flex: 1; }
  .private-calendar { margin: 0 12px; }
  .calendar-workspace { display: block; padding-right: 0; }
  .calendar-workspace .day-agenda { padding: 20px 16px; }
  .calendar-workspace .private-day { min-height: 84px; }
  .private-day { min-height: 84px; padding: 3px; }
  .private-chip { font-size: 10px; min-height: 28px; padding: 4px 2px; }
  .private-date { width: 28px; height: 28px; font-size: 13px; }
  .private-month .private-day { height: 98px; padding: 2px; }
  .private-month .private-date { width: 20px; height: 20px; font-size: 11px; }
  .private-month .private-chip, .private-month .private-more { height: 16px; padding: 1px 2px; font-size: 10px; line-height: 14px; }
  .private-month .chip-time { display: none; }
  .day-agenda, .private-section { padding: 20px 16px; }
  .agenda-columns { grid-template-columns: 1fr; gap: 16px; }
  .private-week { overflow-x: auto; }
  .private-week .private-grid { min-width: 700px; }
  .private-status { bottom: 80px; width: max-content; font-size: 13px; }
  body[data-section=map] .private-status { bottom: calc(144px + env(safe-area-inset-bottom)); }
  .private-form .form-row { grid-template-columns: 1fr; }
  .private-search-results { top: 120px; right: 12px; width: calc(100vw - 24px); }
}

/* 3タブの共通部品と、タブごとの情報密度。 */
.ui-icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.nav-glyph { display: inline-flex; margin: 0; width: 20px; }
.lp-logo { padding: 28px 20px 32px; }
.lp-nav { gap: 8px; }
.lp-nav-label { display: none; }
.lp-nav-item { min-height: 44px; font-size: 14px; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.lp-nav-item.active { background: var(--accent-soft); color: var(--accent); }
.private-account { border-top: 1px solid var(--border-light); }
.private-account .btn { justify-content: flex-start; }
.private-header { min-height: 76px; gap: 12px; }
#private-shell .private-header { display: flex; }
.private-header h1 { font-size: 20px; font-weight: 700; }
.private-search { position: relative; width: 240px; max-width: 100%; }
.private-search .search-glyph, .map-search > .ui-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--text-secondary); pointer-events: none; }
.private-header .private-search input, .map-filters .map-search input[type=search] { box-sizing: border-box; width: 100%; height: 44px; padding: 10px 12px 10px 40px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg-secondary); color: var(--text-primary); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.private-search:hover input, .map-filters .map-search:hover input[type=search] { border-color: var(--border); }
.private-search:focus-within, .map-search:focus-within { border-radius: var(--radius-lg); outline: 2px solid var(--accent); outline-offset: 2px; }
.private-header .private-search input:focus-visible, .map-filters .map-search input:focus-visible { outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); font-family: var(--font-sans); font-size: 14px; font-weight: 500; line-height: 1.5; min-height: 44px; transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.btn:active { transform: none; }
.btn:not(:disabled):active { background: var(--accent-soft); border-color: var(--accent); }
.btn:disabled { pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 500; }
:root[data-theme=dark] .btn-primary { color: #152530; }
.btn-primary:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 88%, var(--text-primary)); border-color: color-mix(in srgb, var(--accent) 88%, var(--text-primary)); opacity: 1; }
.btn-primary:not(:disabled):active { background: color-mix(in srgb, var(--accent) 76%, var(--text-primary)); border-color: color-mix(in srgb, var(--accent) 76%, var(--text-primary)); }
#add-button { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg); gap: 6px; padding: 10px 16px; font-weight: 600; white-space: nowrap; }
#add-button .ui-icon { width: 18px; height: 18px; flex-basis: 18px; }
#add-button:not(:disabled):hover { background: color-mix(in srgb, var(--text-primary) 80%, var(--accent)); border-color: color-mix(in srgb, var(--text-primary) 80%, var(--accent)); }
#add-button:not(:disabled):active { background: color-mix(in srgb, var(--text-primary) 65%, var(--accent)); border-color: color-mix(in srgb, var(--text-primary) 65%, var(--accent)); }
.btn-outline { background: var(--bg); border-color: var(--border); box-shadow: none; }
.btn-outline:not(:disabled):hover { background: var(--bg-secondary); border-color: color-mix(in srgb, var(--border) 65%, var(--accent)); }
.btn-ghost, .agenda-links .btn, .journal-section-field > .btn { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:not(:disabled):hover, .agenda-links .btn:not(:disabled):hover, .journal-section-field > .btn:not(:disabled):hover { background: var(--bg-secondary); border-color: transparent; color: var(--text-primary); }
.btn-ghost:not(:disabled):active, .agenda-links .btn:not(:disabled):active, .journal-section-field > .btn:not(:disabled):active { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.mobile-search-button { display: none; }
.private-mobile-settings { display: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.private-dialog { border-radius: 12px; box-shadow: var(--shadow-3); }
.private-dialog header { padding: 20px 24px 16px; }
.kind-picker button { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); font-weight: 500; line-height: 1.5; background: var(--bg); transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.kind-picker button:not(:disabled):hover { background: var(--bg-secondary); border-color: var(--accent); }
.kind-picker button:not(:disabled):active { background: var(--accent-soft); }
.calendar-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; padding: 16px 24px; }
.calendar-toolbar h2 { min-width: 0; margin: 0; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.calendar-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.calendar-heading h2 { flex: 1; }
.calendar-help-button { flex-shrink: 0; width: 44px; height: 44px; padding: 8px; }
.calendar-help { font-size: 14px; line-height: 1.8; color: var(--text-secondary); }
.calendar-help p { margin: 0 0 16px; }
.calendar-help strong { display: block; margin-bottom: 4px; font-weight: 500; color: var(--text-primary); }
.calendar-date-nav { display: flex; border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.calendar-date-nav .btn { min-width: 44px; height: 44px; padding: 8px; border: 0; background: transparent; color: var(--text-secondary); }
.calendar-date-nav .btn:not(:disabled):hover { background: var(--accent-soft); color: var(--accent); }
.calendar-date-nav .btn:not(:disabled):active { background: var(--border-light); color: var(--text-primary); }
.calendar-date-nav .btn-icon { width: 44px; padding: 0; border-radius: 50%; }
.calendar-workspace { grid-template-columns: minmax(0, 1fr) 288px; padding-bottom: 16px; }
.calendar-workspace .day-agenda { padding: 4px 0 0 20px; }
.private-calendar { background: var(--bg); }
.private-month .private-day { height: 124px; }
.private-week .private-chip { white-space: normal; overflow-wrap: anywhere; }
.private-day.selected { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.private-day.today .private-date { background: var(--accent); }
.view-switch, .map-category-filter, .map-mobile-switch { padding: 3px; gap: var(--space-1); background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg); }
.view-switch button, .map-category-filter button, .map-mobile-switch button { min-height: 44px; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-md); font-family: var(--font-sans); font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--text-secondary); transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.view-switch button:not(:disabled):hover, .map-category-filter button:not(:disabled):hover, .map-mobile-switch button:not(:disabled):hover { background: var(--accent-soft); color: var(--accent); }
.view-switch button[aria-pressed=true], .map-category-filter button[aria-pressed=true], .map-mobile-switch button[aria-pressed=true] { background: var(--bg); color: var(--accent); }
.view-switch button:not(:disabled):active, .map-category-filter button:not(:disabled):active, .map-mobile-switch button:not(:disabled):active { background: var(--accent-soft); color: var(--accent); }
.view-switch button:disabled, .map-category-filter button:disabled, .map-mobile-switch button:disabled { opacity: .6; pointer-events: none; }
.agenda-progress { font-size: 12px; color: var(--text-secondary); margin: -4px 0 20px; }
.agenda-block { background: none; padding: 0; }
.agenda-block h3 { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.agenda-block h3 span { font-size: 12px; color: var(--text-secondary); }
.agenda-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.record-row > .ui-icon { color: var(--accent); }
.record-detail { padding: 8px 0; }
.record-detail-type { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; }
.record-detail .private-actions { margin-top: 24px; }
.diary-workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100%; background: var(--bg); }
.diary-list { display: block; overflow-y: auto; border-right: 1px solid var(--border-light); padding: 24px 16px; background: var(--bg-secondary); }
.diary-list-heading, .map-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.diary-list-heading h2 { font-size: 16px; }
.diary-month { font-size: 12px; font-weight: 500; color: var(--text-secondary); padding: 28px 12px 12px; }
.diary-list-row { display: grid; gap: 8px; width: 100%; padding: 16px 12px; text-align: left; border-radius: var(--radius-lg); border-bottom: 1px solid var(--border-light); }
.diary-list-row[aria-pressed=true] { background: var(--accent-soft); }
.diary-list-row strong { font-size: 14px; font-weight: 500; }
.diary-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.diary-detail { overflow-y: auto; padding: 48px clamp(24px, 5vw, 80px); }
.diary-detail > * { max-width: 680px; margin-left: auto; margin-right: auto; }
.diary-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 32px; border-bottom: 1px solid var(--border-light); }
.diary-detail-heading .journal-date { margin: 0 0 12px; }
.diary-detail-heading h2 { font-size: 24px; font-weight: 500; }
.diary-text-section { margin-top: 32px; margin-bottom: 32px; font-size: 16px; line-height: 2; }
.diary-text-section h3 { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 12px; }
.diary-detail .private-photos img { width: 88px; height: 88px; }
.diary-back { display: none; }
.place-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); border-radius: 8px; margin-right: 8px; min-height: 40px; }
.journal-section-field { display: grid; gap: 0; margin-bottom: 24px; }
.section-heading { font-size: 14px; font-weight: 500; }
.journal-section-field .journal-section-options { padding-top: 0; border-top: 0; }
.journal-section-options > summary { min-height: 44px; margin: 0; color: var(--text-secondary); font-size: 12px; }
.journal-section-options[open] > summary { margin-bottom: 8px; }
.journal-section-options > .btn { display: flex; margin: 8px 0 0 auto; font-size: 13px; }
.journal-section-field .section-title { font-weight: 500; }
.journal-section-field .section-text { min-height: 160px; line-height: 1.9; font-size: 16px; }
.journal-section-field > .btn { justify-self: end; font-size: 13px; }
.journal-place-choices { display: grid; gap: 10px; }
.place-state-fields { border: 1px solid var(--border-light); border-radius: 8px; padding: 12px 16px; display: grid; gap: 12px; }
.place-state-fields legend { font-size: 13px; color: var(--text-secondary); }
.map-workspace { display: grid; grid-template-columns: clamp(280px, 28%, 360px) minmax(0, 1fr); height: 100%; }
.map-sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--bg); border-right: 1px solid var(--border-light); }
.map-filters { display: block; padding: 20px 16px 16px; border-bottom: 1px solid var(--border-light); }
.map-search { display: block; position: relative; width: 100%; max-width: none; }
.map-category-filter { display: flex; margin: 16px 0 12px; }
.map-category-filter button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0; padding-inline: var(--space-2); font-size: 13px; white-space: nowrap; }
.map-filter-bottom { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--space-2); }
.map-select-field { display: grid; min-width: 0; gap: 6px; font-size: 12px; line-height: 1.5; font-weight: 500; color: var(--text-secondary); }
.map-select-control { display: block; position: relative; }
.map-filter-bottom .map-select-control select { appearance: none; box-sizing: border-box; width: 100%; height: 44px; padding: 10px 28px 10px 10px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg-secondary); color: var(--text-primary); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color-scheme: light; cursor: pointer; transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.map-filter-bottom .map-select-control select:hover { border-color: var(--border); background: var(--bg); }
.map-select-control > .ui-icon { position: absolute; right: 8px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%) rotate(90deg); pointer-events: none; }
:root[data-theme=dark] .map-filter-bottom select { color-scheme: dark; }
.map-list-heading { padding: 16px 20px 8px; }
.map-list-heading h2 { font-size: 13px; font-weight: 500; }
.private-place-list { display: block; overflow-y: auto; flex: 1; padding: 0 12px 16px; }
.place-card.saved-place-card { padding: 16px; margin-top: 12px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg); }
.saved-place-card[data-selected=true] { border-color: var(--accent); background: var(--accent-soft); }
.saved-place-card h3 { margin: 4px 0 8px; font-size: 16px; }
.saved-place-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; width: 100%; min-height: 44px; padding: 0; font: inherit; color: inherit; }
.saved-place-title > span { min-width: 0; overflow-wrap: anywhere; }
.saved-place-title > .ui-icon { flex-shrink: 0; width: 16px; height: 16px; color: var(--text-secondary); }
.saved-place-card .place-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 8px 0 0; font-size: 13px; }
.saved-place-card .place-badges:empty, .saved-place-card .private-photos:empty { display: none; }
.map-category-filter .ui-icon, .place-category .ui-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.place-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.place-badges > span { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 3px 6px; }
.place-badges .liked { background: var(--task-purple-tint); color: var(--text-primary); }
.map-canvas { min-width: 0; position: relative; overflow: hidden; }
#private-map { height: 100%; margin: 0; border-radius: 0; background: #f0ebd8; }
.map-tools { position: absolute; top: 16px; right: 16px; display: flex; gap: var(--space-1); max-width: calc(100% - 32px); padding: var(--space-1); border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg); }
.map-tools .btn { background: transparent; border-color: transparent; box-shadow: none; font-size: 13px; padding: var(--space-2) var(--space-3); }
.map-point-hint { position: absolute; top: 82px; right: 16px; left: 16px; background: var(--bg); padding: 12px; border-radius: 8px; text-align: center; font-size: 13px; }
.map-sidebar:has(.map-detail:not([hidden])) > :is(.map-filters, .map-list-heading, .private-place-list) { display: none; }
.map-detail { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }
.map-detail-header { display: flex; flex-shrink: 0; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border-light); padding: 8px 12px; }
.map-detail-map { display: none; }
.map-detail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.map-detail-actions { flex-shrink: 0; justify-content: flex-start; padding: 12px 16px; border-top: 1px solid var(--border-light); background: var(--bg); }
.map-detail-actions .btn { min-height: 44px; }
.map-detail-body > h3 { font-size: 13px; margin-top: 24px; font-weight: 500; }
.place-card { border: 0; padding: 0; }
.place-card h3 { font-size: 20px; margin: 12px 0; }
.place-category, .place-address { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.place-note { font-size: 14px; line-height: 1.9; margin: 20px 0; }
.place-address { min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.place-card .private-photos img { width: 112px; height: 112px; }
.place-journal-link { display: grid; gap: 8px; width: 100%; text-align: left; border-bottom: 1px solid var(--border-light); padding: 16px 0; }
.place-journal-link strong { font-size: 14px; font-weight: 500; }
.map-mobile-switch { display: none; }
.map-unavailable { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; padding: 24px; }
.map-unavailable h2 { font-size: 18px; }
.map-unavailable p { font-size: 13px; margin: 0; }
@media (min-width: 1025px) {
  #private-content:has(.private-hours) { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  #private-content:has(.private-hours) .calendar-toolbar { flex-shrink: 0; }
  .calendar-workspace:has(.private-hours) { flex: 1; min-height: 0; align-items: stretch; }
  .calendar-workspace .private-calendar.private-day { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; cursor: default; }
  .calendar-workspace:has(.private-hours) .day-agenda { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
}
@media (max-width: 1200px) and (min-width: 1025px) {
  .calendar-workspace { grid-template-columns: minmax(0, 1fr) 240px; }
  .private-search { width: 200px; }
  .diary-workspace { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .cp-header.private-header { min-height: 64px; padding: 8px 16px; gap: 4px; }
  .private-header h1 { font-size: 18px; }
  .private-header #add-button { font-size: 14px; padding: 8px 12px; }
  .private-header .private-search { display: none; width: 100%; }
  #private-shell.search-open .private-search { display: block; }
  .mobile-search-button { display: inline-flex; width: 44px; padding: 8px; }
  .private-mobile-settings { display: inline-flex; width: 44px; padding: 8px; min-width: 44px; }
  .private-header { gap: 4px; }
  .private-header .private-search input, .map-filters .map-search input[type=search], .map-filter-bottom .map-select-control select { font-size: 16px; }
  .private-search-results { top: 112px; max-height: calc(100dvh - 200px); }
  .mobile-tabbar .m-tab { color: var(--text-secondary); gap: 5px; font-size: 11px; }
  .mobile-tabbar .m-tab.active { color: var(--accent); background: var(--accent-soft); }
  .calendar-toolbar { grid-template-columns: auto minmax(0, 1fr); padding: 12px; gap: 8px; }
  #private-content:has(.private-hours) .calendar-toolbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--border-light); }
  .private-calendar.private-day { overflow: visible; }
  .private-calendar.private-day .day-all-day { top: var(--day-toolbar-height, 122px); z-index: 4; }
  .calendar-toolbar .calendar-heading { grid-column: 1 / -1; grid-row: 1; }
  .calendar-toolbar h2 { font-size: 16px; }
  .calendar-date-nav { grid-column: 1; grid-row: 2; }
  .calendar-toolbar .view-switch { grid-column: 2; grid-row: 2; }
  .view-switch { width: 100%; }
  .calendar-toolbar .view-switch button { padding: 8px; min-width: 44px; }
  .calendar-workspace { display: block; padding: 0; }
  .calendar-workspace:has(.private-week) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 100% auto; }
  .private-week .cal-week-header { min-width: 700px; }
  .week-scroll-hint { display: block; flex-shrink: 0; margin: 0; padding: 0 16px 8px; color: var(--text-secondary); font-size: 12px; }
  .calendar-workspace:has(.private-week) .day-agenda { overflow: visible; }
  .private-calendar { margin: 0 8px; }
  .private-month .private-day { height: 98px; }
  .private-month .private-chip { border-left-width: 2px; font-size: 10px; }
  .calendar-workspace .day-agenda { padding: 20px 16px 32px; background: var(--bg); margin-top: 16px; }
  .calendar-workspace:has(.private-month) .calendar-month-back { display: inline-flex; margin-bottom: 12px; }
  .private-dialog.journal-editor { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .journal-editor #dialog-content { padding: 8px 20px 24px; }
  .diary-workspace { display: block; }
  .diary-list { height: 100%; padding: 20px 16px; border: 0; }
  .diary-detail { display: none; height: 100%; padding: 16px 24px 32px; }
  .diary-workspace.detail-open .diary-list { display: none; }
  .diary-workspace.detail-open .diary-detail { display: block; }
  .diary-back { display: inline-flex; margin-bottom: 24px; padding-left: 0; }
  .diary-detail-heading { padding-bottom: 24px; gap: 16px; }
  .diary-detail-heading h2 { font-size: 22px; }
  .map-workspace { --map-filter-height: 208px; display: block; position: relative; }
  .map-sidebar { position: absolute; inset: 0; background: transparent; z-index: 1; pointer-events: none; }
  .map-filters { pointer-events: auto; background: var(--bg); padding: 12px; border: 0; }
  .map-category-filter { margin: 8px 0; }
  .map-filter-bottom { gap: 8px; }
  .map-list-heading, .private-place-list { display: none; }
  .map-canvas { height: 100%; padding-top: var(--map-filter-height); }
  .map-tools { top: calc(var(--map-filter-height) + 12px); right: 12px; max-width: calc(100% - 24px); }
  .map-tools .btn { min-height: 44px; padding: 8px; font-size: 13px; }
  .map-point-hint { top: calc(var(--map-filter-height) + 74px); }
  .map-sidebar:has(.map-detail:not([hidden])) { background: var(--bg); pointer-events: auto; }
  .map-workspace:has(.map-detail:not([hidden])) > :is(.map-canvas, .map-mobile-switch) { display: none; }
  .map-detail-map { display: inline-flex; }
  .map-mobile-switch { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; box-shadow: none; }
  .map-mobile-switch button { display: flex; align-items: center; justify-content: center; gap: 6px; padding-inline: var(--space-4); white-space: nowrap; }
  .map-workspace[data-mode=list] .map-sidebar { background: var(--bg); pointer-events: auto; }
  .map-workspace[data-mode=list]:not(:has(.map-detail:not([hidden]))) .map-sidebar { bottom: 76px; }
  .map-workspace[data-mode=list] .map-mobile-switch { inset: auto 0 0; height: 76px; transform: none; align-items: center; justify-content: center; padding: 12px; border: 0; border-top: 1px solid var(--border-light); border-radius: 0; background: var(--bg); }
  .map-workspace[data-mode=list] .map-list-heading { display: flex; }
  .map-workspace[data-mode=list] .private-place-list { display: block; padding-bottom: 16px; }
  .map-workspace[data-mode=list] .map-canvas { visibility: hidden; }
  input:not([type=checkbox]):not([type=file]), textarea, select { font-size: 16px; }
}
/* 細部の仕上げ: ブラウザ既定のままの部分をテーマ化し、余白を 8 / 12 / 24 のリズムにそろえる */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-secondary) 40%, transparent) transparent; }
::selection { background: var(--accent-soft); color: var(--text-primary); }
input, textarea { caret-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.record-meta, .hour-label, .private-date, .journal-date, .chip-time, .agenda-progress { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-wrap: balance; }
.diary-excerpt, .place-note, .diary-text-section, .private-muted, .private-empty { text-wrap: pretty; }
h1, h2, h3, .diary-excerpt, .place-note, .diary-text-section { word-break: auto-phrase; }
.calendar-workspace summary, .private-form summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; }
.calendar-workspace summary::-webkit-details-marker, .private-form summary::-webkit-details-marker { display: none; }
.calendar-workspace summary::after, .private-form summary::after { content: ""; flex: none; width: 6px; height: 6px; margin-right: 4px; border-right: 1.5px solid var(--text-secondary); border-bottom: 1.5px solid var(--text-secondary); transform: rotate(45deg) translateY(-2px); transition: transform var(--t-fast) var(--ease-out); }
.calendar-workspace details[open] > summary::after, .private-form details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.calendar-workspace details { padding: 0; border-top: 1px solid var(--border-light); }
.calendar-workspace details[open] { padding-bottom: 8px; }
.calendar-workspace summary { min-height: 44px; cursor: pointer; }
.calendar-workspace .agenda-columns { gap: 24px; }
.calendar-workspace .agenda-links { margin: 16px 0; }
.calendar-workspace .private-empty { margin: 0; padding: 4px 0 8px; }
.agenda-block h3 { margin-bottom: 4px; }
.record-row { padding: 8px 0; }
.diary-detail-heading { align-items: flex-end; padding-bottom: 24px; }
.place-card.saved-place-card h3 { margin: 8px 0 0; }
.saved-place-card .private-photos { margin: 12px 0; }
.place-address { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.view-switch button { min-width: 48px; }
/* 予定の表示: 淡い塗り+左線をやめ、月・週は色の点+文字、日の時間枠は濃い塗り+白文字（Googleカレンダーに合わせる。色は予定=緑・タスク=紫のまま） */
:root { --calendar-green-deep: #3a7d47; }
.private-chip.event, .private-chip.task { background: transparent; border-left: 0; padding-left: 4px; transition: background var(--t-fast) var(--ease-out); }
.private-chip.event:hover { background: var(--calendar-green-tint); }
.private-chip.task:hover { background: var(--task-purple-tint); }
.private-chip::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; background: var(--calendar-green); }
.private-chip.task::before { border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--task-purple); }
.private-chip.task.done::before { background: var(--task-purple); }
.private-chip .chip-time { color: var(--text-secondary); }
.day-time-event .private-chip.event, .day-time-event .private-chip.event:hover { background: var(--calendar-green-deep); }
.day-time-event .private-chip.task, .day-time-event .private-chip.task:hover { background: var(--task-purple); }
.day-time-event .private-chip.event, .day-time-event .private-chip.task { color: #fff; border-radius: 6px; padding: 4px 8px; line-height: 1.35; }
.day-time-event .private-chip::before { display: none; }
.day-time-event .private-chip { flex-direction: row; flex-wrap: wrap; align-items: baseline; align-content: flex-start; column-gap: 8px; padding-top: 3px; padding-bottom: 3px; }
.day-time-event .private-chip .chip-time { order: 1; color: inherit; opacity: .85; font-size: 11px; }
.private-week .private-chip { position: relative; padding-left: 18px; word-break: auto-phrase; }
.private-week .private-chip::before { position: absolute; left: 4px; top: 8px; margin: 0; }
.private-week .private-chip .chip-time { display: block; }
@media (max-width: 1024px) {
  .private-month .private-chip.event, .private-month .private-chip.task { padding-left: 2px; padding-right: 2px; }
  .private-month .private-chip::before { width: 6px; height: 6px; margin-right: 3px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }

/* Handwritten memo section */
.memo-workspace { display: grid; gap: var(--space-4); max-width: 880px; margin: 0 auto; padding: var(--space-4); }
.memo-hero { display: grid; justify-items: start; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.memo-count { margin: 0; font-size: 15px; }
.memo-count strong { font-size: 36px; font-weight: 600; margin-right: 4px; }
.memo-count span { color: var(--text-secondary); font-size: 13px; }
.memo-hero .btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; }
.memo-upload { width: 100%; min-width: 0; }
.memo-upload input { width: 100%; min-width: 0; }
.memo-intent { display: flex; align-items: end; gap: var(--space-2); }
.memo-intent label { flex: 1; display: grid; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.memo-intent input { width: 100%; }
.memo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--space-3); }
.memo-tile { display: grid; align-content: start; gap: 2px; padding: 0; text-align: left; border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--text-secondary); }
.memo-tile strong { color: var(--text-primary); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.memo-tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.memo-tile:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.memo-query { width: 100%; min-height: 44px; }
.memo-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.memo-chip { min-height: 44px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: 13px; cursor: pointer; }
.memo-chip span { margin-left: 4px; color: var(--text-secondary); }
.memo-chip[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.memo-chip:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.memo-section { margin: var(--space-3) 0 var(--space-2); font-size: 14px; color: var(--text-secondary); }
.memo-notes { display: grid; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border-light); }
.memo-notes h3 { margin: 0; font-size: 14px; }
.memo-notes h3 span { margin-left: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 400; }
.memo-note { display: grid; gap: 2px; margin: 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--bg-secondary); line-height: 1.6; overflow-wrap: anywhere; }
.memo-note .record-meta { margin: 0; }
.memo-note-add { display: flex; gap: var(--space-2); }
.memo-note-add input, .memo-note-add select { flex: 1; min-width: 0; }
.memo-detail-photo img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 6px; }

/* Home */
.home-workspace { display: grid; gap: var(--space-4); max-width: 760px; margin: 0 auto; padding: var(--space-4); }
.home-workspace input[type=checkbox] { color-scheme: light; }
:root[data-theme=dark] .home-workspace input[type=checkbox] { color-scheme: dark; }
.home-lead h2 { margin: 0 0 4px; font-family: var(--font-serif, inherit); font-size: 20px; font-weight: 500; }
.home-lead p { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.home-block { display: grid; gap: var(--space-2); min-width: 0; padding-bottom: var(--space-4); border-bottom: 1px solid var(--border-light); }
.home-block > .private-empty { margin: 0; padding: var(--space-2) 0; }
.home-block > .private-muted { margin: 0; }
.home-block h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.home-block h3 span { margin-left: 6px; font-weight: 400; }
.home-today { display: grid; gap: var(--space-2); }
.home-plan h4, .home-events h4 { margin: 0; font-size: 13px; font-weight: 600; }
.home-plan h4 span { margin-left: 6px; color: var(--text-secondary); font-weight: 400; }
.home-events { display: grid; gap: var(--space-1); padding-top: var(--space-2); border-top: 1px solid var(--border-light); }
.home-block-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.home-block-heading .btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px; font-size: 13px; white-space: nowrap; }
.home-workspace .record-open { min-height: 44px; }
.home-workspace .record-title { overflow-wrap: anywhere; }
.home-details.home-block { display: block; }
.home-details:not(.home-block) { border-top: 1px solid var(--border-light); }
.home-details summary { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; list-style: none; cursor: pointer; font-size: 14px; font-weight: 500; }
.home-details summary > span { margin-left: auto; color: var(--text-secondary); font-size: 12px; font-weight: 400; }
.home-details summary::-webkit-details-marker { display: none; }
.home-details summary::after { content: ''; flex: none; width: 6px; height: 6px; margin-right: 4px; border-right: 1.5px solid var(--text-secondary); border-bottom: 1.5px solid var(--text-secondary); transform: rotate(45deg) translateY(-2px); }
.home-details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.home-details summary:focus-visible, .home-row:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; border-radius: var(--radius-lg); }
.home-empty { display: grid; justify-items: start; gap: var(--space-2); }
.home-empty p { margin: 0; }
.home-row { display: grid; grid-template-columns: minmax(104px, .9fr) minmax(0, 1.6fr); align-items: center; gap: var(--space-3); width: 100%; min-height: 44px; padding: 10px 0; text-align: left; border: 0; border-bottom: 1px solid var(--border-light); background: none; cursor: pointer; }
.home-row .record-meta { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
.home-row .record-title { line-height: 1.7; }
.home-row:last-child { border-bottom: 0; }
.home-late { display: flex; align-items: center; gap: var(--space-2); }
.home-late .record-row { flex: 1; min-width: 0; }
.home-late > .btn { flex-shrink: 0; }
.home-rule-line { margin: 0; padding: 4px 0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.home-rule-line::before { content: '・'; color: var(--text-secondary); }
.home-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.home-foot .is-due { color: var(--accent); font-weight: 600; }
.home-lead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.home-lead h2 { margin: 0; }
.home-count { margin: 0; color: var(--text-secondary); font-size: 13px; }
.home-count strong { color: var(--text-primary); font-size: 20px; font-weight: 600; margin: 0 2px; }
.home-lower { display: grid; gap: var(--space-4); }
.home-lower > .home-block { align-content: start; }
.home-rules .home-block-heading .record-meta { margin: 0; }
.home-rules > .btn { justify-self: stretch; }
.home-pair { padding: var(--space-4); border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg); box-shadow: 0 1px 0 var(--border-light); }
.home-pair > h3 { color: var(--text-primary); font-size: 16px; }
.pair-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.pair-card { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 8px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); cursor: pointer; }
.pair-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.pair-card:focus-visible, .weekly-tile:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.pair-photo { display: block; overflow: hidden; border-radius: 6px; background: var(--bg-secondary); }
.pair-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pair-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.pair-meta .record-meta { margin: 0; }
.pair-kind { padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.pair-card strong { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.pair-card .record-meta { margin: 0; overflow-wrap: anywhere; }
.pair-ask { display: grid; align-content: start; gap: var(--space-3); }
.pair-question { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.6; }
.pair-write { min-height: 48px; width: 100%; }
.pair-capture { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0; }
.pair-capture .btn { min-height: 44px; padding: 4px 10px; font-size: 13px; }
.home-step .step-form { display: grid; gap: var(--space-2); }
.step-choice { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 14px; font-weight: 400; cursor: pointer; }
.step-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.step-choice:has(input:focus-visible), .night-choice:has(input:focus-visible) { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.step-choice input, .night-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.step-form:has(input[value=shoot]:checked) .step-keyword { display: none; }
.home-weekly .home-foot .record-meta { margin: 0; }
.night-rule, .weekly-rule, .weekly-write, .pair-task { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); display: grid; gap: var(--space-2); }
.night-rule legend, .weekly-rule legend, .weekly-write legend, .pair-task legend { padding: 0 4px; font-size: 14px; font-weight: 600; line-height: 1.6; }
.pair-task legend span { margin-left: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 400; }
.night-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.night-choice { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 6px; border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 13px; font-weight: 500; text-align: center; cursor: pointer; }
.night-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.night-choice:has(input[value=missed]:checked) { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--bg)); }
.night-choice:has(input:disabled) { opacity: .6; cursor: default; }
.night-step { margin: 0; padding: 8px 10px; border-radius: var(--radius-lg); background: var(--bg-secondary); font-size: 13px; }
.night-rest { align-items: flex-start; padding: 12px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); }
.night-rest span { display: grid; gap: 2px; }
.pair-thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); }
.pair-thumbs figure { margin: 0; display: grid; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.pair-thumbs img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 6px; }
.pair-when { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.weekly-head { display: flex; align-items: center; justify-content: space-between; }
.weekly-head strong { font-size: 13px; color: var(--text-secondary); }
#weekly-body { display: grid; gap: var(--space-3); }
#weekly-body h3, #weekly-body h4 { margin: 0; }
#weekly-body h4 { font-size: 13px; color: var(--text-secondary); }
.weekly-group { display: grid; gap: var(--space-2); }
.weekly-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--space-3); }
.weekly-tile { position: relative; display: grid; align-content: start; gap: 4px; padding: 8px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); cursor: pointer; font-size: 13px; }
.weekly-tile.picked { border-color: var(--accent); background: var(--accent-soft); }
.weekly-tile .record-meta { margin: 0; }
.weekly-rank { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: var(--accent); color: var(--bg); font-size: 12px; font-weight: 600; }
:root[data-theme=dark] .weekly-rank { color: #152530; }
.weekly-tile .weekly-rank { position: absolute; top: 12px; right: 12px; margin: 0; }
.weekly-top { display: grid; gap: var(--space-1); }
.weekly-top-row { display: flex; align-items: center; gap: var(--space-2); }
.weekly-top-row > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.weekly-top-row .btn { min-width: 44px; padding: 4px; }
@media (min-width: 1025px) {
  .home-workspace { max-width: 1040px; }
  .home-pair:not(.home-step):has(.pair-cards) { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: var(--space-6); align-items: start; }
  .home-pair:has(.pair-cards) > h3 { grid-column: 1 / -1; }
  .home-lower { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.rule-edit { display: grid; gap: 8px; padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-light); }
.rule-edit .check-label { min-height: 44px; }
/* Memo processing and search use the existing form and card styles. */
.memo-search-tools { display: flex; gap: .75rem; flex-wrap: wrap; margin-block: .75rem; }
.memo-ai-section { border-top: 1px solid var(--border-color, #d9d9d2); margin-top: 1rem; padding-top: 1rem; }
.memo-ai-details > label, .memo-ai-topic > label { display: flex; flex-direction: column; gap: .4rem; margin-block: .8rem; }
.memo-ai-topic { min-width: 0; margin-block: .8rem; padding: .75rem; }
.memo-ai-topic .check-label { flex-direction: row; }
.memo-ai-details textarea { width: 100%; box-sizing: border-box; }
.memo-ai-details summary { cursor: pointer; padding-block: .6rem; }
.memo-search-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.memo-upload-retry { padding-block: .75rem; }
