.library {
  margin:0; height:100vh; height:100dvh; display:grid; grid-template-columns:clamp(188px,27vw,330px) minmax(0,1fr);
  color:#1b1e25; background:white; font:16px/1.4 -apple-system,BlinkMacSystemFont,"Inter","Segoe UI",sans-serif;
}
.library * {box-sizing:border-box}
.library [hidden] {display:none!important}
.library h1,.library h2,.library p {margin:0}
.library button,.library input,.library a {font:inherit}
.library button {cursor:pointer; color:inherit; background:transparent; border:0}
.library :focus-visible {outline:2px solid #2964d8; outline-offset:2px}
.sidebar,.notes-panel {overflow:auto; overscroll-behavior:contain}
.sidebar {display:flex;flex-direction:column; padding:30px 18px 18px;background:#f6f7f9;border-right:1px solid #e8eaee}
.sidebar h1 {font-size:clamp(24px,2.6vw,34px);letter-spacing:-.045em;padding:0 10px}
.sidebar input {min-width:0;width:100%;border:1px solid #c9ced7;border-radius:9px;background:white;color:inherit;padding:10px 12px}
#search {margin:24px 0}
.sidebar nav {display:grid; gap:3px}
.sidebar nav button {display:flex;align-items:center;gap:10px;width:100%;text-align:left;border-radius:8px;padding:10px;overflow-wrap:anywhere}
.sidebar nav button:hover,.sidebar footer button:hover {background:#e9ecf1}
.sidebar nav button[aria-current=true] {background:#dce8fc;font-weight:600}
.project-head {margin:25px 0 8px;display:flex;align-items:center;justify-content:space-between;padding-left:10px}
.project-head h2 {font-size:15px;color:#647084;font-weight:600}
.project-head button {font-size:23px;width:42px;height:42px;color:#566173}
#project-form {display:flex;gap:3px;margin-bottom:8px}
.project-dot {width:10px;height:10px;border-radius:50%;flex:none}
.sidebar footer {margin-top:auto;padding:20px 9px 0;color:#606b7c;font-size:12px}
.sidebar footer button,.sidebar footer a {padding:5px 0;color:#365b92}
.sidebar footer a {display:inline-block}
#status {display:block;font-size:12px}
.notes-panel {padding:30px clamp(16px,3vw,42px)}
.notes-panel header {display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:22px}
.notes-panel h2 {font-size:clamp(24px,3.4vw,43px);letter-spacing:-.045em;line-height:1.1;overflow-wrap:anywhere}
.library .new-note {background:#386ef1;color:white;border-radius:13px;padding:9px 16px;font-weight:600;white-space:nowrap}
.note-row {display:flex;align-items:center;gap:clamp(10px,2vw,26px);padding:9px 2px 9px 20px;border-bottom:1px solid #eaecf0;text-decoration:none;color:inherit;min-height:82px}
.note-row:hover {background:#fafbfe}
.thumb {background:white;width:48px;height:62px;border:1px solid #cbd0d8;border-radius:3px;flex:none}
.note-text {min-width:0;flex:1}
.note-title,.note-project {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.note-title {font-weight:600}
.note-project,.note-row time {font-size:14px;color:#657082}
.note-row time {white-space:nowrap;font-variant-numeric:tabular-nums}
#empty,#error {padding:16px 0;color:#626c7c}
@media(max-width:560px){
  .library {grid-template-columns:minmax(112px,33%) minmax(0,1fr);font-size:14px}
  .sidebar {padding:18px 6px 10px}.sidebar h1 {padding:0 5px}
  .notes-panel {padding:17px 9px}.notes-panel header {flex-wrap:wrap}
  .library .new-note {padding:7px 10px}.note-row {gap:7px;flex-wrap:wrap;position:relative}
  .thumb {width:32px;height:42px}.note-text {padding-bottom:14px}.note-row time {position:absolute;left:59px;bottom:8px;font-size:11px}
  .note-project {font-size:12px}.project-head {padding-left:5px}.sidebar nav button {padding:8px 4px}
}

.notebook-editor .v15-toolbar #notebookBack {width:auto;min-width:46px;padding:0 7px;font:500 13px system-ui,sans-serif;white-space:nowrap}
.notebook-editor .workspace {padding-top:54px!important}

/* Keep Home Screen app content clear of screen cutouts. */
.library {box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.notebook-editor .app {padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}

/* A single editable title precedes the first sheet and scrolls with it. */
.notebook-title {position:sticky;left:0;width:min(100%,var(--paper-width,816px));margin:0 auto;box-sizing:border-box;height:60px;padding:10px 24px 8px;background:#fff;border-bottom:1px solid #e8eaee;touch-action:manipulation}
.notebook-title input {display:block;width:100%;min-width:0;box-sizing:border-box;border:0;border-bottom:1px solid #dfe3eb;border-radius:0;padding:3px 0 5px;background:transparent;color:#1b1e25;font:600 clamp(22px,3.5vw,30px)/1.25 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:-.025em;touch-action:manipulation;user-select:text;-webkit-user-select:text}
.notebook-title input:hover {border-bottom-color:#99abc7}
.notebook-title input:focus {position:relative;z-index:61;background:#fff;outline:none;border-bottom:2px solid #386ef1}

#noteStatus {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Swipe reveals a rectangular destructive action without moving the list. */
.swipe-item {position:relative;overflow:hidden;isolation:isolate}
.swipe-content {position:relative;z-index:1;transition:transform 160ms ease;touch-action:pan-y}
.swiping .swipe-content {transition:none}
.swipe-open>.swipe-content {transform:translateX(-84px)}
.library .swipe-delete {position:absolute;inset:0 0 0 auto;width:84px;display:flex;align-items:center;justify-content:center;background:#d92d32;color:#fff;border-radius:0;font-weight:600;z-index:0;touch-action:manipulation}
.library .swipe-delete:hover {background:#b91f26}
.library .swipe-delete:disabled {opacity:.6}
.note-row {background:#fff;cursor:pointer;-webkit-touch-callout:none}
.note-row .note-title {cursor:grab;touch-action:none;-webkit-user-drag:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.project-item>.swipe-content {background:#f6f7f9;min-height:44px;border-radius:0}
.sidebar .project-item>.swipe-content:hover {background:#e9ecf1}
.sidebar .project-item>.swipe-content[aria-current=true] {background:#dce8fc}
.sidebar.accepts-note [data-filter]:not([data-filter=all]) {outline:1px dashed #9aafce;outline-offset:-2px}
.sidebar [data-filter].drop-target {background:#dce8fc!important;outline:2px solid #386ef1!important;outline-offset:-2px}
.dragging-note,.dragging-note * {cursor:grabbing!important}
.library-notice {position:fixed;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:100;display:flex;align-items:center;gap:16px;max-width:calc(100vw - 24px);padding:12px 16px;border-radius:10px;background:#263447;color:#fff;box-shadow:0 4px 18px #17253a26;font-size:14px}
.library .library-notice button {color:#fff;font-weight:600;padding:6px;white-space:nowrap;min-height:32px}
@media(prefers-reduced-motion:reduce){.swipe-content{transition:none}}

@media(hover:hover) and (pointer:fine){.note-row .note-title[draggable=true]{-webkit-user-drag:element}}

/* iPad list gestures must never enter Safari's text-selection mode. */
.library {user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.library input {user-select:text;-webkit-user-select:text;-webkit-touch-callout:default}
.library .note-row,.library .note-row *,.note-drag-preview,.note-drag-preview * {user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.library button.note-title {display:block;width:100%;max-width:100%;min-width:0;margin:0;padding:0;border:0;border-radius:0;appearance:none;-webkit-appearance:none;background:transparent;color:inherit;text-align:left;font:inherit;font-weight:600;line-height:inherit;cursor:grab}



.note-row.pressing-note {background:#f3f6fc}
.drag-placeholder {background:#edf2f8;outline:1px dashed #bdcbe0;outline-offset:-1px}
.drag-placeholder>.swipe-delete {visibility:hidden}
.note-row.lifted-source {opacity:0}
.note-drag-preview {position:fixed;left:0;top:0;z-index:1000;display:flex;align-items:center;margin:0;border:1px solid #afc3e0;border-radius:10px;background:#fff!important;box-shadow:0 12px 32px #1b355d38,0 2px 6px #1b355d1f;opacity:.94;will-change:transform;transition:none;box-sizing:border-box}
.note-drag-preview,.note-drag-preview * {pointer-events:none!important;touch-action:none!important}
.note-drag-preview.over-project {border-color:#386ef1;box-shadow:0 12px 32px #2458db33,0 0 0 2px #386ef133}

html[data-account-pending] body { visibility: hidden; }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#account-menu { position: relative; }
#account-menu summary { list-style: none; cursor: pointer; }
#account-menu summary::-webkit-details-marker { display: none; }
#account-avatar {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  overflow: hidden; background: #dfe9ff; color: #243963; font-weight: 600;
}
.account-actions {
  position: absolute; right: 0; z-index: 5; display: grid; gap: .45rem; min-width: 11rem;
  padding: .7rem; background: white; border: 1px solid #d9dde5; border-radius: .5rem;
}
.account-actions button { width: 100%; text-align: left; }
body.login [hidden] { display: none; }
body.login {
  display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 1rem;
  box-sizing: border-box; background: #f6f7f9; color: #1b1e25; font-family: system-ui, sans-serif;
}
.login main {
  max-width: 25rem; padding: 2rem; background: white; border: 1px solid #d9dde5; border-radius: .75rem;
}
.login h1 { margin: 0 0 1rem; font-size: 1.5rem; }
.login button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer;
  padding: 0 12px; color: #1f1f1f; background: white; border: 1px solid #747775;
  border-radius: 4px; font: 500 14px/20px "Google Sans", system-ui, sans-serif;
}

.account-actions a { color: #28497d; padding: .25rem .5rem; }
.notebook-title-row { display: flex; align-items: center; gap: .7rem; }
.notebook-title-row #noteTitle { flex: 1; }
.publish-dialog button {
  font: 500 14px system-ui, sans-serif;
  color: #2458b0; background: #eaf1ff; border: 1px solid #c5d5f1;
  border-radius: .45rem; padding: .42rem .65rem; cursor: pointer; white-space: nowrap;
}
.publish-dialog {
  width: min(26rem, calc(100vw - 2rem)); box-sizing: border-box; border: 1px solid #ccd4df;
  border-radius: .8rem; padding: 1.25rem; color: #1b1e25; background: white;
  font: 14px/1.5 system-ui, sans-serif;
}
.publish-dialog::backdrop { background: #14203270; }
.publish-dialog [hidden] { display: none; }
.publish-dialog h2,.profile h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.publish-dialog fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.publication-name,.publication-actions { display: flex; align-items: center; gap: .5rem; }
.publication-name input,.profile input {
  min-width: 0; border: 1px solid #aebccd; border-radius: .4rem; padding: .45rem .55rem;
  color: inherit; background: white; font: inherit;
}
.publication-name input { flex: 1; }
.publication-url { overflow-wrap: anywhere; color: #526078; min-height: 1em; }
.publication-auto { display: flex; align-items: center; gap: .4rem; }
.publication-actions { justify-content: flex-end; flex-wrap: wrap; }
#publication-link button { margin-inline-start: .45rem; }
.profile input { display: block; margin-block: .4rem; width: min(100%, 20rem); }
.profile main p,.profile p { overflow-wrap: anywhere; }
