/* App page layout. Reusable controls live in components.css; rendered notes keep their own portable reading.css styles. */
body.notefriends-brand {
  margin: 0;
  background: var(--nf-paper);
  background-image: radial-gradient(#d9d1bf60 .6px, transparent .7px);
  background-size: 22px 22px;
  color: var(--nf-pencil);
  font-family: var(--nf-font-ui);
}
.notefriends-brand a { color: inherit; }
/* Phones only: a slim header that opens the sidebar drawer. Wide screens have the sidebar's own toggle. */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 64px; box-sizing: border-box; padding: 0 max(3vw,16px); background: var(--nf-paper); }
.topbar { display: none; }
.topbar-mark img { display: block; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; text-decoration: none; }
.wordmark img { display: block; flex: none; }
.edition,.pane-label { font-family: var(--nf-font-label); letter-spacing: .08em; font-size: 11px; }
.edition { color: var(--nf-pencil-muted); }
/* The account sits at the foot of the sidebar: the email opens Set password and Connected apps, beside Sign in/out. */
.sidebar-foot { flex: none; display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--nf-line); }
.sidebar-foot .account-menu { position: relative; flex: 1 1 auto; min-width: 0; }
.sidebar-foot .account-menu summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; border-radius: var(--nf-radius); list-style: none; }
.sidebar-foot .account-menu summary::-webkit-details-marker { display: none; }
.sidebar-foot .account-menu summary:hover { background: var(--nf-sheet); }
.sidebar-foot .account-menu > button { width: 100%; justify-content: flex-start; margin: 4px 0 0; }
#account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.notefriends-brand #account-button { flex: none; min-height: 40px; margin-left: auto; padding: 6px 12px; white-space: nowrap; font-size: 12px; }
#signin-status,#password-status { margin: 8px 0 0; }
.signin-password { margin-top: 12px; }
.signin-password .link-row { margin-top: 6px; }
.signin-modes { display: flex; flex-wrap: wrap; margin-top: 8px; }
/* The shell: a full-height notes sidebar on the left, the open note on the right (sidebar.js). Collapsed, the
   sidebar is a rail with the brand mark and the toggle. */
.shell { display: grid; grid-template-columns: 280px minmax(0,1fr); align-items: start; transition: grid-template-columns .2s ease; }
body[data-sidebar=closed] .shell { grid-template-columns: 50px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; border-right: 1px solid var(--nf-line); background: var(--nf-paper); overflow: hidden; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 64px; flex: none; box-sizing: border-box; padding: 0 10px 0 14px; }
.notefriends-brand .sidebar-head #sidebar-toggle { border-color: transparent; background: transparent; padding: 9px; }
.sidebar-body { flex: 1 1 auto; min-height: 0; overflow: hidden auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 14px 20px; }
/* Collapsed: the logo sits where the toggle is; hovering or focusing the rail swaps the logo for the toggle. */
body[data-sidebar=closed] .sidebar-head { display: grid; justify-items: center; justify-content: center; height: auto; padding: 10px 0 0; }
body[data-sidebar=closed] .sidebar-head > * { grid-area: 1 / 1; }
body[data-sidebar=closed] .sidebar-head .wordmark { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
body[data-sidebar=closed] .sidebar-head #sidebar-toggle { opacity: 0; }
body[data-sidebar=closed] .sidebar-head:is(:hover,:focus-within) #sidebar-toggle { opacity: 1; }
body[data-sidebar=closed] .sidebar-head:is(:hover,:focus-within) .wordmark { visibility: hidden; }
body[data-sidebar=closed] :is(.wordmark-name,.sidebar-body,.sidebar-foot) { display: none; }
.notefriends-brand .sidebar-scrim { display: none; }
.sidebar-note { margin: 0; color: var(--nf-pencil-muted); font-size: 13px; line-height: 1.6; }
.my-notes-create { display: flex; flex-wrap: wrap; gap: 8px; }
.notefriends-brand .my-notes-create button { flex: 1 1 auto; margin: 0; }
.my-notes { flex: 1 0 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; }
.my-notes h2 { margin: 0; font: 11px var(--nf-font-label); letter-spacing: .08em; text-transform: uppercase; color: var(--nf-pencil-muted); }
#my-notes-status { margin: 0; color: var(--nf-pencil-muted); font-size: 12px; line-height: 1.5; }
#my-notes-status:empty { display: none; }
#my-notes-groups h3 { margin: 14px 0 0; font-size: 13px; }
.project-actions { gap: 6px; }
.notefriends-brand .project-actions button { min-height: 36px; padding: 6px 10px; margin: 0; font-size: 12px; }
.project-form { flex-wrap: wrap; align-items: center; margin-top: 16px; }
.project-form label { flex-basis: 100%; font-size: 12px; color: var(--nf-pencil-muted); }
.project-form input { flex: 1 1 0; min-width: 0; }
/* The note fills the right side edge to edge; the reading column centres itself. */
main { min-width: 0; width: 100%; box-sizing: border-box; margin: 0; padding: 0; }
.template-shelf { display: flex; flex-direction: column; gap: 6px; }
.template-shelf select { width: 100%; }
.template-shelf label,.block-control { font-size: 12px; color: var(--nf-pencil-muted); }
.workspace { min-height: 100vh; min-height: 100dvh; background: var(--nf-sheet); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--nf-line); background: var(--nf-sheet); }
.toolbar .save-line { flex: 1 1 200px; min-width: 0; color: var(--nf-pencil-muted); font-size: 12px; }
.file-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.notefriends-brand #dev-source { font-family: var(--nf-font-label, monospace); }.notefriends-brand #dev-source[aria-pressed=true] { background: var(--nf-pencil); color: var(--nf-sheet); }
.block-control { display: flex; align-items: center; gap: 8px; }
.block-control select { max-width: 150px; }
.appearance-panel { border-bottom: 1px solid var(--nf-line); padding: 0 20px; background: var(--nf-paper); }
.appearance-panel summary { cursor: pointer; padding: 14px 0; font-size: 13px; font-weight: 600; }
.appearance-help { margin: 0 0 12px; color: var(--nf-pencil-muted); font-size: 12px; }
.appearance-panel summary span { color: var(--nf-pencil-muted); font-weight: 400; margin-left: 12px; font-size: 12px; }
.appearance-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding-bottom: 18px; }
.appearance-controls label,.looks legend { font: 11px var(--nf-font-label); color: var(--nf-pencil-muted); }
.appearance-controls label { display: flex; flex-direction: column; gap: 7px; }
.panes { display: grid; grid-template-columns: 1fr; }
.panes:not([data-source]) .editor-pane { display: none; }
.panes[data-source] { grid-template-columns: 1fr 1fr; }
.editor-pane { border-right: 1px solid var(--nf-line); background: var(--nf-sheet); min-width: 0; }
.preview-pane { min-width: 0; }
.pane-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 20px 24px; color: var(--nf-pencil-muted); font-size: 10px; }
.crumbs { justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 4px; padding: 10px 24px 0; }
.pane-label span:last-child { letter-spacing: 0; text-transform: none; }
.notefriends-brand textarea { display: block; width: 100%; min-height: 480px; padding: 10px 26px 30px; border: 0; resize: vertical; background: transparent; color: var(--nf-pencil); font: 14px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace; }
.notefriends-brand textarea:focus-visible { outline-offset: -4px; }
.template-hint { margin: 0; color: var(--nf-pencil-muted); font-size: 12px; line-height: 1.5; }
.workspace-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--nf-line); padding: 14px 20px; color: var(--nf-pencil-muted); font-size: 11px; }
.sharing-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#people h2 { margin: 16px 0 0; font-size: 18px; }
#people h3 { margin: 16px 0 0; font-size: 14px; }
.bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 24px 24px; border-top: 1px solid var(--nf-line); color: var(--nf-pencil-muted); font-size: 12px; }
.bottom p { margin: 0; line-height: 1.7; }
.bottom a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.workspace > .notice { margin: 12px 16px 0; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; }
.notice #project-delete { margin-left: auto; }
/* NF-035: picture upload progress and failure, under the toolbar like the other notices. */
.upload-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; }
.upload-status[data-kind=error] { border-color: #963b25; color: #963b25; }
.upload-status #upload-text { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.upload-status progress { flex: 0 1 10rem; height: 8px; accent-color: var(--nf-pencil); }
.upload-actions { display: flex; gap: 8px; }
.upload-actions button { min-height: 44px; }
body[data-reader] .template-shelf, body[data-reader] .appearance-panel, body[data-reader] #share, body[data-reader] #add-block, body[data-reader] #open, body[data-reader] #delete-shared { display: none; }
[hidden] { display: none!important; }
@media(max-width: 750px) {
  /* Phones: a plain header that scrolls away with the note, like a chat app: menu left, brand centred, new note right. */
  .topbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 56px; padding: 0 12px; position: static; }
  .notefriends-brand .topbar .icon-button { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; border-color: var(--nf-line); background: var(--nf-sheet); }
  .topbar-mark { justify-self: center; display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; font-weight: 600; }
  .topbar-mark span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Phones: the full sidebar is a drawer over the note, closed until the header button opens it. */
  .shell,body[data-sidebar=closed] .shell { display: block; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(320px, 86vw); height: auto; box-shadow: 4px 0 0 #29272310; transition: transform .2s ease; }
  body[data-sidebar=closed] .sidebar { transform: translateX(-100%); visibility: hidden; }
  body[data-sidebar=open].notefriends-brand .sidebar-scrim { display: block; position: fixed; z-index: 35; inset: 0; width: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: rgb(41 39 35 / .3); }
  .edition { display: none; }
  .notefriends-brand #share { padding: 8px 10px; font-size: 12px; }

  .notefriends-brand select { font-size: 16px; padding: 8px; min-width: 0; }
  .toolbar { padding: 12px; gap: 10px; }.notefriends-brand .toolbar button { padding: 8px 10px; }
  /* PC-050: labels stay on one line; whole buttons wrap instead. */
  .file-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }.notefriends-brand .toolbar button,.export-menu summary { white-space: nowrap; }
  .toolbar .save-line { flex-basis: 100%; font-size: 13px; }
  .workspace > .notice { margin: 12px 12px 0; }
  .block-control { grid-column: 1/-1; justify-content: space-between; }.block-control select { flex: 1; max-width: 175px; }
  .export-menu summary { padding: 8px 10px; }.export-options { max-width: 260px; }
  .appearance-panel { padding: 0 14px; }.appearance-panel summary span { display: none; }
  .appearance-controls { gap: 12px; }
  .appearance-controls label { flex: 1 1 calc(50% - 6px); min-width: 0; }.appearance-controls select { width: 100%; }
  .panes,.panes[data-source] { grid-template-columns: 1fr; }.editor-pane { border-right: 0; border-bottom: 1px solid var(--nf-line); }
  .notefriends-brand textarea { min-height: 300px; padding: 10px 20px 24px; font-size: 16px; }
  .pane-label { padding: 18px 20px; gap: 8px; }.workspace-footer { padding: 14px; }
  /* PC-018: helper text and labels stay readable on phones. */
  .template-shelf label,.block-control,.appearance-help,.look-custom,.link-row label,.my-note-open span:last-child,.bottom,.workspace-footer,.notefriends-brand .crumbs button { font-size: 13px; }
  .appearance-controls label,.looks legend,.appearance-controls .look { font-size: 13px; }
  .notice { padding: 16px; }.bottom { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; }
}
@media(max-width: 360px) {
  .appearance-controls label { flex-basis: 100%; }
}
@media print {
  .shell { display: block!important; }
  .topbar,.sidebar,.sidebar-scrim,.template-shelf,.toolbar,.appearance-panel,.editor-pane,.pane-label,.workspace-footer,.bottom,.notice,#message,.crumbs,.skip { display: none!important; }
  .panes { display: block!important; }.preview-pane { display: block!important; }
  .workspace { border: 0; box-shadow: none; }body.notefriends-brand { background: white; }main { padding: 0; }.prose { padding: 0!important; }
}

.captcha{display:flex;justify-content:center}
#trial{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem}
#trial p{margin:0}

.legal{max-width:42rem;margin:2rem auto;padding:0 1rem 3rem;line-height:1.6}
.legal h2{margin-top:2rem}
/* NF-094: edit history under the workspace. */
.note-history summary { cursor: pointer; font-weight: 600; }
.note-history #history-list > li { flex-wrap: wrap; }
.note-history #history-list ul { flex-basis: 100%; margin: 4px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.note-history #history-list ul li { display: list-item; border: 0; padding: 0; }

#preview { min-height: 320px; }





/* PC-045: one blanket reduced-motion guard, so transitions and animations added later are covered too. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }
