/* Duo New Tab © 2026 DevRoshdi. All rights reserved. See LICENSE.txt. */
/*
 * Notes, styled after Notes in iPadOS 27: grouped folder sidebar, note list with date groups, a white
 * page with a bold first line, Liquid Glass toolbar buttons floating over it, and Notes' yellow tint.
 */
.napp {
  --n-bg: #fff;
  --n-side: #f2f2f7;
  --n-row: #fff;
  --n-text: #000;
  --n-sub: rgba(60, 60, 67, 0.6);
  --n-sep: rgba(60, 60, 67, 0.18);
  --n-tint: #e3a600;
  --n-sel: #ffd426;
  --n-sel-text: #000;
  --n-fill: rgba(120, 120, 128, 0.12);
  --n-glass: rgba(255, 255, 255, 0.72);
  /* Where the window's toolbars start: at the top (the status bar steps aside for apps). */
  --n-top: 6px;
  position: fixed; inset: 0; z-index: 39; padding: 0; color: var(--n-text);
}
/* A floating window: only the window itself takes the pointer; the Home Screen shows around it. */
.napp.windowed { --n-top: 6px; pointer-events: none; }
.napp.windowed > * { pointer-events: auto; }
body.mode-dark .napp {
  --n-bg: #000;
  --n-side: #000;
  --n-row: #1c1c1e;
  --n-text: #fff;
  --n-sub: rgba(235, 235, 245, 0.6);
  --n-sep: rgba(84, 84, 88, 0.55);
  --n-tint: #ffd60a;
  --n-sel: #ffd60a;
  --n-sel-text: #000;
  --n-fill: rgba(120, 120, 128, 0.24);
  --n-glass: rgba(44, 44, 46, 0.72);
}
/* While an app fills the screen the status bar uses the app's colours. */
body.app-open:not(.app-windowed) .statusbar { color: var(--label, #000); }
body.app-open.mode-light:not(.app-windowed) .statusbar { color: #000; }
body.app-open.mode-dark:not(.app-windowed) .statusbar { color: #fff; }

/*
 * Opening an app: the Home Screen zooms in past the glass and fades as the app grows out of its
 * icon, and zooms back out as the app shrinks into it. Behind a floating window only the wallpaper
 * stays, as with iPadOS windowed apps.
 */
/*
 * Not quite 0: at 0 the browser stops drawing the Home Screen and lets go of its glass, and drawing
 * every blur again at once when the app closed held the screen still for up to half a second.
 */
body.ready.app-open:not(.app-windowed) .stage { opacity: 0.004; scale: 1.09; pointer-events: none; transition: opacity 0.26s ease, scale 0.45s var(--smooth); }
body.app-open:not(.app-windowed) .today-view { opacity: 0; pointer-events: none; }
/* With a floating window the Home Screen stays usable behind it; Spotlight and Control Center come over it. */
body.app-windowed .spotlight, body.app-windowed .cc { z-index: 41; }
.today-view { transition: opacity 0.3s ease; }

.n-win {
  position: absolute; inset: 0; display: grid; grid-template-columns: 0 0 minmax(0, 1fr); background: var(--n-bg);
  overflow: hidden; transform-origin: center; transition: grid-template-columns 0.45s var(--smooth), transform 0.15s ease;
  font: 17px/1.35 var(--font);
}
.napp.windowed .n-win {
  inset: auto; border-radius: 26px;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 24px 70px rgba(0, 0, 0, 0.32), 0 6px 18px rgba(0, 0, 0, 0.12);
}
body.mode-dark .napp.windowed .n-win { box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.16), 0 24px 70px rgba(0, 0, 0, 0.6), 0 6px 18px rgba(0, 0, 0, 0.3); }
.n-win.moving { cursor: grabbing; }
.n-win.moving, .n-win.resizing { user-select: none; }
.napp.windowed .n-win.moving { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 34px 90px rgba(0, 0, 0, 0.38), 0 8px 22px rgba(0, 0, 0, 0.14); }

/*
 * Window controls (iPadOS 26 and later): close, minimize and full screen, as red, yellow and green
 * circles at the top left of the window; their symbols show when the pointer is over them.
 */
/*
 * In full screen they rest folded, as three small dots in a faint capsule, and spring open (one after
 * another) when the pointer comes near. In a window they are always open.
 */
.n-ctrl {
  position: absolute; z-index: 6; top: calc(var(--n-top) + 18px); left: 20px; display: flex; align-items: center; gap: 8px;
  height: 14px; padding: 0; border-radius: 7px;
  transition: gap 0.42s var(--spring-pop), padding 0.42s var(--spring-pop), background 0.25s ease, translate 0.42s var(--spring-pop);
}
.napp:not(.windowed) .n-ctrl:not(.open) { gap: 4px; padding: 0 6px; translate: 0 0; background: var(--n-fill); }
/* An invisible margin so the pointer opens them a little before reaching the dots. */
.n-ctrl::before { content: ""; position: absolute; inset: -12px -14px; }
.n-light {
  position: relative; display: grid; place-items: center; width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%;
  cursor: pointer; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
  transition: width 0.42s var(--spring-pop), height 0.42s var(--spring-pop), filter 0.15s, scale 0.3s var(--spring-pop), background 0.25s ease;
}
.n-light.l-min { transition-delay: 0.025s; }
.n-light.l-full { transition-delay: 0.05s; }
.napp:not(.windowed) .n-ctrl:not(.open) .n-light { width: 7px; height: 7px; transition-delay: 0s; }
.napp:not(.windowed) .n-ctrl:not(.open) .n-light .n-ico { opacity: 0; transition-delay: 0s; }
.n-ctrl.open .n-light:hover, .napp.windowed .n-light:hover { scale: 1.12; }
/* A bigger target than the dot itself. */
.n-light::before { content: ""; position: absolute; inset: -5px -4px; border-radius: 50%; }
.n-light.l-close { background: #ff5f57; }
.n-light.l-min { background: #febc2e; }
.n-light.l-full { background: #28c840; }
.n-light:active { filter: brightness(0.82); scale: 0.92; }
.n-light:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.n-light .n-ico { width: 10px; height: 10px; stroke: rgba(0, 0, 0, 0.62); stroke-width: 2.8; opacity: 0; scale: 0.6; transition: opacity 0.15s ease 0.1s, scale 0.3s var(--spring-pop) 0.1s; }
.n-ctrl:hover .n-ico, .n-ctrl:focus-within .n-ico, .n-ctrl.open .n-ico { opacity: 1; scale: 1; }

/* The corner grabber of a floating window: drag it to resize. */
.n-grip { display: none; position: absolute; z-index: 6; right: 0; bottom: 0; width: 36px; height: 36px; cursor: nwse-resize; touch-action: none; }
.napp.windowed .n-grip { display: block; }
.n-grip::after {
  content: ""; position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; box-sizing: border-box;
  border: solid rgba(60, 60, 67, 0.36); border-width: 0 4px 4px 0; border-bottom-right-radius: 22px; opacity: 0; transition: opacity 0.2s;
}
body.mode-dark .n-grip::after { border-color: rgba(235, 235, 245, 0.4); }
.n-win:hover .n-grip::after, .n-win.resizing .n-grip::after { opacity: 1; }

/* The green button's menu: Move & Resize, Arrange, Full Screen. */
.n-arrange {
  position: fixed; z-index: 60; width: 252px; padding: 12px 12px 6px; border-radius: 22px; color: var(--n-text);
  font: 15px/1.3 var(--font); transform-origin: 28px 0; animation: nArrIn 0.32s var(--spring-pop) both;
}
.n-arrange.out { animation: nArrOut 0.18s ease both; pointer-events: none; }
@keyframes nArrIn { from { opacity: 0; transform: scale(0.82) translateY(-6px); } }
@keyframes nArrOut { to { opacity: 0; transform: scale(0.94); } }
.n-arr-h { margin: 2px 4px 8px; font-size: 12.5px; font-weight: 600; color: var(--n-sub); }
.n-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.n-tile {
  position: relative; height: 40px; padding: 0; border: 0; border-radius: 10px; background: var(--n-fill); color: var(--n-sub); cursor: pointer;
  transition: background 0.15s, color 0.15s, scale 0.25s var(--spring-pop);
}
.n-tile:hover:not(:disabled) { background: rgba(10, 132, 255, 0.16); color: #0a84ff; }
.n-tile:active:not(:disabled) { scale: 0.92; }
.n-tile:disabled { opacity: 0.4; cursor: default; }
.n-tile span { position: absolute; inset: 9px 10px; border: 1.5px solid currentColor; border-radius: 4px; }
.n-tile span::after { content: ""; position: absolute; inset: 1.5px; border-radius: 2px; background: currentColor; }
.n-tile.t-center span::after { inset: 1.5px 25%; }
.n-tile.t-left span::after { right: 50%; }
.n-tile.t-right span::after { left: 50%; }
.n-tile.t-tl span::after { right: 50%; bottom: 50%; }
.n-tile.t-tr span::after { left: 50%; bottom: 50%; }
.n-tile.t-bl span::after { right: 50%; top: 50%; }
.n-tile.t-br span::after { left: 50%; top: 50%; }
.n-arr-sep { height: 0.5px; margin: 0 -12px 6px; background: var(--n-sep); }
.n-arr-row {
  display: flex; align-items: center; justify-content: space-between; width: calc(100% + 8px); height: 40px; margin: 0 -4px; padding: 0 8px;
  border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; cursor: pointer;
}
.n-arr-row:hover { background: var(--n-fill); }
.n-arr-row .n-ico { width: 18px; height: 18px; }

/*
 * The app windows' layer (js/appwin.js orders the windows inside it): over the Home Screen and over
 * the status bar, which stays where it is and shows wherever no window covers it (a full-screen app or
 * a Split View covers it all). Only the windows themselves take the pointer.
 */
.ft-apps { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.napp:not(.windowed) { pointer-events: auto; }
/* One home bar on screen, the top window's. */
.napp:not(.top) > .n-home { display: none; }
/* A window that is not in front: grey controls (they light up under the pointer), as on iPadOS. */
.napp.windowed:not(.front) .n-ctrl:not(:hover) .n-light { background: #c7c7cc; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
body.mode-dark .napp.windowed:not(.front) .n-ctrl:not(:hover) .n-light { background: #4a4a4e; }
.napp.windowed:not(.front) .n-win { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 14px 44px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08); }
body.mode-dark .napp.windowed:not(.front) .n-win { box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 14px 44px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25); }

/* Split View: the divider between two windows tiled left and right; drag it to resize both. */
.ft-split {
  position: fixed; width: 22px; margin-left: -11px; display: grid; place-items: center; cursor: col-resize;
  pointer-events: auto; touch-action: none; outline: none;
}
.ft-split[hidden] { display: none; }
.ft-split span {
  width: 5px; height: 54px; border-radius: 3px; background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.3); transition: height 0.3s var(--spring-pop), background 0.2s ease;
}
.ft-split:hover span, .ft-split:focus-visible span, .ft-split.dragging span { height: 76px; background: #fff; }
body.split-resizing { cursor: col-resize; user-select: none; }
body.split-resizing .napp .n-win { transition: none; }

/* While an app is leaving, nothing in it takes the pointer. */
.napp.leaving, .napp.leaving * { pointer-events: none !important; }
.n-win.cols-2 { grid-template-columns: 0 minmax(300px, 340px) minmax(0, 1fr); }
.n-win.cols-3 { grid-template-columns: minmax(240px, 280px) minmax(300px, 340px) minmax(0, 1fr); }
.n-win > * { min-width: 0; min-height: 0; overflow: hidden; }
/* Each column keeps its place, also when the folders are laid over the list (a medium window). */
.n-win > .n-side { grid-column: 1; grid-row: 1; }
.n-win > .n-list { grid-column: 2; grid-row: 1; }
.n-win > .n-main { grid-column: 3; grid-row: 1; }

.n-ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* The … glyph is three round dots. */
.n-ico.n-dots { stroke-width: 3.6; }
.n-btn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 20px;
  background: transparent; color: var(--n-tint); cursor: pointer; transition: background 0.15s, scale 0.25s var(--spring-pop);
}
.n-btn:hover { background: var(--n-fill); }
.n-btn:active { scale: 0.9; }
/* Liquid Glass capsules that float over the page. */
.n-glass {
  background: var(--n-glass); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.08);
}
body.mode-dark .n-glass { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 6px 20px rgba(0, 0, 0, 0.4); }
.n-group, .n-pill { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 24px; }
.n-spacer { flex: 1; }

/* ----- sidebar ----- */

/* The window controls sit above the sidebar's title, so the sidebar starts one toolbar lower. */
.n-side { display: flex; flex-direction: column; background: var(--n-side); border-right: 0.5px solid var(--n-sep); padding-top: calc(var(--n-top) + 50px); }
.n-side-head { padding: 8px 20px 6px; }
.n-side-title { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.n-side-scroll { flex: 1; overflow-y: auto; padding: 4px 14px 20px; scrollbar-width: none; }
.n-side-h { margin: 18px 8px 6px; font-size: 20px; font-weight: 700; }
.n-side-group { border-radius: 12px; background: var(--n-row); overflow: hidden; }
body.mode-dark .n-side-group { background: #1c1c1e; }
.n-side-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 46px; padding: 0 14px; border: 0;
  background: none; color: var(--n-text); font: inherit; font-size: 17px; text-align: left; cursor: pointer;
}
.n-side-row + .n-side-row::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; height: 0.5px; background: var(--n-sep); }
.n-side-row .n-ico { color: var(--n-tint); }
.n-side-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-side-count { color: var(--n-sub); font-size: 16px; }
.n-side-row.sel { background: var(--n-sel); color: var(--n-sel-text); }
.n-side-row.sel .n-ico, .n-side-row.sel .n-side-count { color: var(--n-sel-text); }
.n-side-row.sel::before, .n-side-row.sel + .n-side-row::before { display: none; }
.n-side-input { flex: 1; min-width: 0; height: 32px; border: 0; border-radius: 8px; padding: 0 8px; background: var(--n-fill); color: var(--n-text); font: inherit; outline: 0; }
.n-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 4px; }
.n-chip { height: 32px; padding: 0 12px; border: 0; border-radius: 16px; background: var(--n-row); color: var(--n-text); font: inherit; font-size: 15px; cursor: pointer; }
body.mode-dark .n-chip { background: #1c1c1e; }
.n-chip.sel { background: var(--n-sel); color: var(--n-sel-text); }
.n-side-foot { display: flex; padding: 8px 14px 18px; }

/* ----- note list ----- */

.n-list { display: flex; flex-direction: column; background: var(--n-side); border-right: 0.5px solid var(--n-sep); padding-top: var(--n-top); }
body.mode-dark .n-list { background: #000; }
.n-list-bar { display: flex; align-items: center; gap: 8px; height: 50px; box-sizing: border-box; padding: 0 12px; transition: padding-left 0.45s var(--smooth); }
/* The first column's toolbar makes room for the window controls. */
.n-win.cols-2 .n-list-bar, .n-win.narrow.cols-3 .n-list-bar { padding-left: 84px; }
.n-win.cols-1 .n-bar { padding-left: 88px; }
.n-list-bar .n-btn { border-radius: 20px; }
.n-list-head { padding: 4px 20px 8px; }
.n-list-title { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-list-count { color: var(--n-sub); font-size: 15px; }
.n-search {
  display: flex; align-items: center; gap: 6px; margin: 0 16px 10px; height: 38px; padding: 0 10px; border-radius: 19px; background: var(--n-fill); color: var(--n-sub);
}
.n-search .n-ico { width: 18px; height: 18px; }
.n-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--n-text); font: inherit; font-size: 17px; user-select: text; }
.n-search input::placeholder { color: var(--n-sub); }
.n-list-scroll { flex: 1; overflow-y: auto; padding: 0 14px 30px; --scroll-inset-bottom: 22px; }
.n-group-h { display: flex; align-items: center; gap: 6px; margin: 14px 6px 6px; font-size: 20px; font-weight: 700; }
.n-group-h .pin { width: 18px; height: 18px; color: var(--n-tint); }
.n-group-rows { border-radius: 12px; background: var(--n-row); overflow: hidden; }
.n-row {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0;
  background: none; color: var(--n-text); font: inherit; text-align: left; cursor: pointer;
}
.n-row + .n-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 0.5px; background: var(--n-sep); }
.n-row.sel { background: var(--n-sel); color: var(--n-sel-text); border-radius: 10px; }
.n-row.sel::before, .n-row.sel + .n-row::before { display: none; }
.n-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.n-row-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-row-sub { display: flex; gap: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.n-row-date { flex: none; }
.n-row-prev { color: var(--n-sub); overflow: hidden; text-overflow: ellipsis; }
.n-row.sel .n-row-prev { color: rgba(0, 0, 0, 0.6); }
.n-row-folder { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--n-sub); }
.n-row-folder .n-ico { width: 14px; height: 14px; }
.n-row.sel .n-row-folder { color: rgba(0, 0, 0, 0.55); }
.n-row-thumb { flex: none; width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.n-hint { margin: 6px 8px 10px; font-size: 13px; color: var(--n-sub); text-align: center; }
.n-list-empty { margin: 40px 0; text-align: center; color: var(--n-sub); font-size: 17px; }

/* ----- note ----- */

.n-main { position: relative; display: flex; flex-direction: column; background: var(--n-bg); }
/*
 * The note's toolbar is a Liquid Glass header across the column, from the top of the window (status
 * bar included) to just below the buttons, as in iOS 26 and later: once the note scrolls beneath it,
 * the text shows through frosted and the glass fades out softly below the buttons (the scroll edge
 * effect), so nothing is ever sharp behind the window controls or the buttons.
 */
.n-bar {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: calc(var(--n-top) + 50px); box-sizing: border-box; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: var(--n-top) 16px 0;
  transition: padding-left 0.45s var(--smooth);
}
.n-bar::before {
  content: ""; position: absolute; inset: 0 0 -26px; z-index: -1; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--n-bg) 62%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent);
  transition: opacity 0.25s ease;
}
.n-main.scrolled .n-bar::before { opacity: 1; }
/* A very light line at the foot of the glass, to set the toolbar apart from the note beneath. */
.n-bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0.5px; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--n-text) 12%, transparent); transition: opacity 0.25s ease;
}
.n-main.scrolled .n-bar::after { opacity: 1; }
.n-scroll { flex: 1; overflow-y: auto; padding: calc(var(--n-top) + 60px) 0 60px; --scroll-inset-top: calc(var(--n-top) + 50px); --scroll-inset-bottom: 22px; }
.n-date { text-align: center; font-size: 13px; color: var(--n-sub); margin-bottom: 12px; }
.n-editor {
  max-width: 820px; margin: 0 auto; padding: 0 48px 200px; min-height: 60vh; outline: 0;
  font-size: 17px; line-height: 1.45; user-select: text; -webkit-user-select: text; caret-color: var(--n-tint); word-wrap: break-word;
}
.n-main.no-note .n-editor, .n-main.no-note .n-date { display: none; }
.n-main:not(.no-note) .n-empty { display: none; }
.n-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--n-sub); font-size: 20px; pointer-events: none; }
/* The first line of a note is its title. */
.n-editor > :first-child { font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.n-editor h1 { font-size: 28px; font-weight: 700; margin: 0; line-height: 1.2; }
.n-editor h2 { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.25; }
.n-editor h3 { font-size: 18px; font-weight: 700; margin: 0; }
.n-editor pre { font: 15px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; margin: 0; white-space: pre-wrap; }
.n-editor blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--n-sep); color: var(--n-sub); }
.n-editor ul, .n-editor ol { margin: 0; padding-left: 28px; }
.n-editor ul.dashed { list-style: none; }
.n-editor ul.dashed > li::before { content: "–"; position: absolute; margin-left: -20px; }
.n-editor ul.checklist { list-style: none; padding-left: 32px; }
.n-editor ul.checklist > li { position: relative; padding: 3px 0; }
/* Checklist circles: tap to tick (yellow with a white check). */
.n-editor ul.checklist > li::before {
  content: ""; position: absolute; left: -32px; top: 5px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.6px solid #c7c7cc; box-sizing: border-box; cursor: pointer;
}
.n-editor ul.checklist > li.checked::before {
  border-color: var(--n-tint); background: var(--n-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.n-editor ul.checklist > li.checked { color: var(--n-sub); }
.n-editor hr { border: 0; height: 1px; background: var(--n-sep); margin: 14px 0; }
.n-editor img { display: block; max-width: 100%; max-height: 70vh; border-radius: 10px; margin: 6px 0; }
.n-editor table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.n-editor td, .n-editor th { border: 1px solid var(--n-sep); padding: 8px 10px; min-width: 60px; vertical-align: top; }
.n-editor a { color: var(--n-tint); }
.n-tag { color: var(--n-tint); font-weight: 500; }
.n-editor[contenteditable="false"] { opacity: 0.75; }

/* ----- home indicator ----- */

.n-home { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 220px; height: 22px; display: grid; place-items: center; cursor: grab; z-index: 3; touch-action: none; }
.n-home span { width: 140px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.75); }
body.mode-dark .n-home span { background: rgba(255, 255, 255, 0.75); }
.n-home:hover span { width: 150px; }


/* A narrow window (or a small screen) shows one column at a time: the folders, the list or the note. */
.n-win.narrow.cols-2 { grid-template-columns: 0 minmax(0, 1fr) 0; }
.n-win.narrow.cols-3 { grid-template-columns: minmax(0, 1fr) 0 0; }
/* A medium window: the list and the note; the folders slide in over the list. */
.n-win.medium.cols-3 { grid-template-columns: 0 minmax(300px, 340px) minmax(0, 1fr); }
.n-win.medium > .n-side {
  position: absolute; z-index: 4; top: 0; bottom: 0; left: 0; width: 290px;
  transform: translateX(-102%); transition: transform 0.42s var(--smooth), box-shadow 0.42s ease;
}
.n-win.medium.cols-3 > .n-side { transform: none; box-shadow: 0 0 0 0.5px var(--n-sep), 12px 0 40px rgba(0, 0, 0, 0.28); }
.n-win.medium.cols-3 .n-list-bar { padding-left: 84px; }
.n-win.narrow .n-editor { padding: 0 20px 200px; }
.n-win.narrow .n-bar { gap: 6px; padding-right: 10px; }
.n-win.narrow .n-pill .n-btn, .n-win.narrow .n-group .n-btn { width: 36px; }

/* ---------- Notes widget, as in iPadOS ---------- */

.w-notes { padding: 0 !important; color: var(--w-text); }
.nw-head {
  display: flex; align-items: center; gap: 6px; padding: calc(var(--pitch) * 0.05) calc(var(--pitch) * 0.08);
  background: #ffcc00; color: #fff; font-size: clamp(11px, 8cqmin, calc(14px * var(--k))); font-weight: 600;
}
.nw-head svg { width: 1.15em; height: 1.15em; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nw-head .nw-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-compose { display: grid; place-items: center; width: 1.8em; height: 1.8em; margin: -0.3em -0.3em -0.3em 0; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.nw-compose:hover { background: rgba(255, 255, 255, 0.25); }
.nw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: calc(var(--pitch) * 0.06) calc(var(--pitch) * 0.08) calc(var(--pitch) * 0.07); }
.nw-one { flex: 1; display: flex; flex-direction: column; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.nw-title { font-size: clamp(12px, 9cqmin, calc(16px * var(--k))); font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-prev { margin-top: 2px; font-size: clamp(11px, 8cqmin, calc(14px * var(--k))); color: var(--w-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-time { margin-top: auto; font-size: clamp(10px, 7.5cqmin, calc(13px * var(--k))); color: var(--w-muted); }
.nw-rows { display: flex; flex-direction: column; }
.nw-row {
  display: flex; align-items: baseline; gap: 8px; width: 100%; padding: calc(6px * var(--k)) 0; border: 0; border-bottom: 0.5px solid var(--w-sep);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.nw-row:last-child { border-bottom: 0; }
.nw-row .nw-title { flex: 1; min-width: 0; -webkit-line-clamp: 1; font-size: clamp(12px, 6.5cqmin, calc(15px * var(--k))); }
.nw-row .nw-time { margin: 0; flex: none; }
.nw-empty { margin: auto; color: var(--w-muted); font-size: calc(13px * var(--k)); text-align: center; }
.wgt-card:has(.w-notes) .widget-body { padding: 0; }

/* The Notes app icon: white page, yellow top, a row of binding dots and two ruled lines. */
.tile.builtin-notes { background: #fff; }
/* The dots under the yellow top, for the Dark style (the Clear and Tinted styles have none). */
.tile.builtin-notes::before {
  content: ""; position: absolute; left: 0; right: 0; top: 26%; height: calc(var(--icon) * 0.035); display: none;
  background: repeating-linear-gradient(90deg, #a0a0a6 0 calc(var(--icon) * 0.03), transparent calc(var(--icon) * 0.03) calc(var(--icon) * 0.075));
}
body.icons-dark .tile.builtin-notes::before { display: block; }
body.icons-dark .tile.builtin-notes { background: linear-gradient(#ffd60a 0 26%, #1c1c1e 26%); }
body.icons-clear .tile.builtin-notes, body.icons-tinted .tile.builtin-notes { background: linear-gradient(rgba(255, 255, 255, 0.85) 0 26%, rgba(255, 255, 255, 0.18) 26%); }

/* A very small widget (a narrow window's 7 × 5 grid): the note's title and time only, on one line each. */
@container (max-height: 90px) {
  .nw-one .nw-prev { display: none; }
  .nw-one .nw-title { -webkit-line-clamp: 1; }
}

/* ----- the Format panel (Aa), as in Notes on iPad ----- */

.n-fmt {
  --f-bg: rgba(255, 255, 255, 0.9); --f-text: #000; --f-seg: rgba(120, 120, 128, 0.12); --f-line: rgba(255, 255, 255, 0.9);
  --f-on: #e8ad00; --f-x: rgba(120, 120, 128, 0.14);
  position: absolute; z-index: 30; width: min(372px, calc(100% - 16px)); padding: 16px 18px 18px; border-radius: 34px;
  display: flex; flex-direction: column; gap: 12px; color: var(--f-text); font: 17px/1.2 var(--font);
  background: var(--f-bg); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 18px 50px rgba(0, 0, 0, 0.22);
  user-select: none;
}
@starting-style { .n-fmt { opacity: 0; scale: 0.6; } }
.n-fmt { transition: opacity 0.18s ease, scale 0.38s var(--spring-pop); }
body.mode-dark .n-fmt {
  --f-bg: rgba(36, 36, 38, 0.88); --f-text: #fff; --f-seg: rgba(255, 255, 255, 0.09); --f-line: rgba(0, 0, 0, 0.5);
  --f-on: #e2ab00; --f-x: rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 18px 50px rgba(0, 0, 0, 0.55);
}
.n-fmt button { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.n-fmt-head { display: flex; align-items: center; justify-content: space-between; padding-left: 2px; }
.n-fmt-title { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.n-fmt-x { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--f-x) !important; }
.n-fmt-x .n-ico { width: 20px; height: 20px; stroke-width: 2.2; }
/* Title, Heading, Subheading, Body, Monostyled: each in its own style; the current one in a yellow capsule. */
.n-fmt-styles { display: flex; align-items: center; gap: 2px; margin: 0 -18px; padding: 2px 18px; overflow-x: auto; scrollbar-width: none; }
.n-fmt-styles::-webkit-scrollbar { display: none; }
.n-fmt-style { flex: none; height: 44px; padding: 0 14px !important; border-radius: 22px; white-space: nowrap; font-weight: 700 !important; transition: background 0.18s, color 0.18s; }
.n-fmt-style.s-h1 { font-size: 26px !important; letter-spacing: -0.02em; }
.n-fmt-style.s-h2 { font-size: 21px !important; letter-spacing: -0.01em; }
.n-fmt-style.s-h3 { font-size: 17px !important; }
.n-fmt-style.s-div { font-size: 17px !important; font-weight: 400 !important; }
.n-fmt-style.s-pre { font: 400 15px ui-monospace, "SF Mono", Menlo, Consolas, monospace !important; }
.n-fmt-style.on { background: var(--f-on); color: #fff; }
/* Groups of joined buttons, a hairline between each, as iPad draws them. */
.n-fmt-row { display: flex; align-items: center; gap: 12px; }
/* Each group as wide as its buttons need (js/notes.js sets flex to how many it holds). */
.n-fmt-seg { display: flex; gap: 1.5px; border-radius: 22px; overflow: hidden; background: var(--f-line); }
.n-fmt-b { flex: 1; display: grid; place-items: center; min-width: 44px; height: 46px; background: var(--f-seg) !important; transition: background 0.15s, color 0.15s; }
body:not(.mode-dark) .n-fmt-b { background: rgba(120, 120, 128, 0.12) !important; }
.n-fmt-b:hover { filter: brightness(1.15); }
.n-fmt-b.on { background: var(--f-on) !important; color: #fff; }
.n-fmt-b b, .n-fmt-b i, .n-fmt-b u, .n-fmt-b s { font-size: 21px; line-height: 1; }
.n-fmt-b b { font-weight: 800; }
.n-fmt-b i { font-family: Georgia, "Times New Roman", serif; font-size: 23px; }
.n-fmt-b .n-ico { width: 24px; height: 24px; }
.n-fmt-dot { display: block; width: 24px; height: 24px; border-radius: 50%; background: currentColor; }
.n-fmt-dot.c-blue { color: #0a84ff; } .n-fmt-dot.c-mint { color: #00c7be; } .n-fmt-dot.c-orange { color: #ff9f0a; }
.n-fmt-dot.c-pink { color: #ff375f; } .n-fmt-dot.c-purple { color: #bf5af2; }
/* The colours, in a small list over the top of the panel (inside it, so it never runs off the window). */
.n-fmt-colors {
  position: absolute; z-index: 2; top: 10px; right: 12px; width: 200px; padding: 6px; border-radius: 26px;
  background: var(--f-bg); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 0 0 0.5px rgba(127, 127, 127, 0.25), 0 14px 40px rgba(0, 0, 0, 0.35);
}
@starting-style { .n-fmt-colors { opacity: 0; scale: 0.8; } }
.n-fmt-colors { transform-origin: 80% 85%; transition: opacity 0.15s ease, scale 0.3s var(--spring-pop); }
.n-fmt-colors button { display: flex; align-items: center; gap: 14px; width: 100%; height: 44px; padding: 0 12px !important; border-radius: 16px; text-align: left; }
.n-fmt-colors button:hover { background: var(--f-x); }
.n-fmt-colors button.on { font-weight: 600; }
.n-fmt-colors .n-fmt-dot { width: 22px; height: 22px; }

/* Text colours, highlights and paragraph indents in a note. */
.n-editor .n-c-blue { color: #0a84ff; } .n-editor .n-c-mint { color: #00c7be; } .n-editor .n-c-orange { color: #ff9f0a; }
.n-editor .n-c-pink { color: #ff375f; } .n-editor .n-c-purple { color: #bf5af2; }
.n-editor .n-hl-blue { background: rgba(10, 132, 255, 0.32); } .n-editor .n-hl-mint { background: rgba(0, 199, 190, 0.32); }
.n-editor .n-hl-orange { background: rgba(255, 159, 10, 0.32); } .n-editor .n-hl-pink { background: rgba(255, 55, 95, 0.32); }
.n-editor .n-hl-purple { background: rgba(191, 90, 242, 0.32); }
.n-editor [class*="n-hl-"], .n-editor span[style*="background"] { border-radius: 4px; padding: 0 1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.n-editor .n-in1 { padding-left: 30px; } .n-editor .n-in2 { padding-left: 60px; } .n-editor .n-in3 { padding-left: 90px; }
