/* authored. journal shell: top bar, phone tab bar, shared entry pieces. */
main#view { max-width: 1180px; margin: 0 auto; }
body.signed-out .footer { border-top: 0; }

/* Desktop top bar extras */
.topbar .add-btn { background: var(--bar-ink); color: var(--bar); border-color: transparent; padding: 9px 14px; }
.topbar .add-btn:hover { opacity: 0.92; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #C2412D; display: inline-block; }

/* The account menu behind the initials, top right (app.js accountMenu). */
.topbar .who { position: relative; }
.topbar .who button.me {
  width: 36px; height: 36px; padding: 0; flex: none; justify-content: center; border-radius: 50%;
  font: 500 12px/1 var(--mono); letter-spacing: 0.02em;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.topbar .who button.me:hover, .topbar .who button.me[aria-expanded="true"] { background: color-mix(in srgb, currentColor 24%, transparent); }
.me-menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 60; min-width: 240px; padding: 6px 0;
  background: var(--card, var(--bg)); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift); overflow: hidden; font-size: 15px;
}
.me-menu a, .me-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 18px;
  text-decoration: none; font: inherit; color: inherit; background: none; border: 0; border-radius: 0; cursor: pointer; box-shadow: none;
}
.me-menu a:hover, .me-menu button:hover, .me-menu a:focus-visible, .me-menu button:focus-visible { background: var(--accent-soft); outline: none; transform: none; }
.me-menu a[aria-current="page"] { font-weight: 500; }
.me-menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.me-menu-head { padding: 10px 18px 12px; display: flex; flex-direction: column; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.me-menu-head .muted { font-size: 13px; overflow-wrap: anywhere; }
.menu-icon { width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.menu-icon[data-icon="settings"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M10.3 3h3.4l.5 2.4 1.7 1 2.3-.8 1.7 2.9-1.8 1.6v2l1.8 1.6-1.7 2.9-2.3-.8-1.7 1-.5 2.4h-3.4l-.5-2.4-1.7-1-2.3.8-1.7-2.9 1.8-1.6v-2L3.4 8.5l1.7-2.9 2.3.8 1.7-1z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.menu-icon[data-icon="help"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M9.6 9.6a2.5 2.5 0 1 1 3.4 2.3c-.6.3-1 .8-1 1.5v.6'/%3E%3Ccircle cx='12' cy='16.8' r='.4' fill='black'/%3E%3C/svg%3E"); }
.menu-icon[data-icon="contact"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3.5' y='5.5' width='17' height='13'/%3E%3Cpath d='M3.5 6.5l8.5 6.5 8.5-6.5'/%3E%3C/svg%3E"); }
.menu-icon[data-icon="admin"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M4 7h10M18 7h2M4 17h2M10 17h10'/%3E%3Ccircle cx='16' cy='7' r='2'/%3E%3Ccircle cx='8' cy='17' r='2'/%3E%3C/svg%3E"); }
.menu-icon[data-icon="signout"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M10 4H4.5v16H10M15 8l4 4-4 4M19 12H9'/%3E%3C/svg%3E"); }

/* Phone tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: end;
  padding: 6px 8px max(8px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tabbar[hidden] { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; text-decoration: none; color: var(--muted); font-size: 11px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab-icon { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.tab-icon[data-icon="today"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M5 4h14v16H5z'/%3E%3Cpath d='M8 9h8M8 13h8M8 17h5'/%3E%3C/svg%3E"); }
.tab-icon[data-icon="calendar"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3.5' y='5' width='17' height='15'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.tab-icon[data-icon="search"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5'/%3E%3C/svg%3E"); }
.tab-icon[data-icon="ask"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E"); }
.tab-record { justify-self: center; width: 62px; height: 62px; margin-top: -22px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 18px rgba(20, 24, 43, 0.25); }
.tab-record-dot { width: 22px; height: 22px; border-radius: 50%; background: #C2412D; border: 3px solid var(--accent-ink); }
body.is-phone main#view { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
body.is-phone .footer { display: none; }
body.is-bare main#view { padding: 0; max-width: none; min-height: 100vh; }

/* Entry cards (day, search, calendar) */
.entry-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.entry-card { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.entry-card:hover .entry-title { text-decoration: underline; text-underline-offset: 3px; }
.entry-thumb { width: 72px; height: 72px; object-fit: cover; flex: none; border: 1px solid var(--line); background: var(--surface); }
.entry-card-body { min-width: 0; flex: 1; }
.entry-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.entry-title { font-size: 16px; font-weight: 500; line-height: 1.3; margin-bottom: 4px; }
.entry-summary { margin: 0 0 8px; color: var(--ink-60); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.entry-topics { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.small { font-size: 12px; padding: 4px 8px; }
.chip.topic { text-decoration: none; color: inherit; }
.chip.topic.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip .count { font: 500 11px/1 var(--mono); color: var(--muted); }
.chip.topic.active .count { color: inherit; opacity: 0.7; }
a.cite { font-size: 0.9em; padding: 1px 6px; border: 1px solid var(--accent-line); border-radius: 999px; text-decoration: none; white-space: nowrap; background: var(--accent-soft); }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.confirm p { font-size: 16px; margin-bottom: 20px; }
.file-view { white-space: pre-wrap; word-break: break-word; font: 400 13px/1.55 var(--mono); background: var(--surface); border: 1px solid var(--line); padding: 14px; max-height: 65vh; overflow: auto; margin: 0; }
