* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  color-scheme: light;
  --app-bg: #f3f3f3; --surface: #ffffff; --text: #202020; --muted: #606060; --faint: #808080;
  --border: #d6d6d6; --hover: rgba(0,0,0,.06); --input-bg: #e8e8e8; --sep: #e5e5e5;
  --shadow: 0 8px 28px rgba(0,0,0,.22); --card-shadow: 0 1px 2px rgba(0,0,0,.08); --folder-line: #dcdcdc;
  --note-bg: #fff7d1; --note-bar: #f5d34f; --note-text: #202020;
  --safe-top: env(safe-area-inset-top); --safe-bottom: env(safe-area-inset-bottom);
}
/* dark: follows the phone unless a theme is picked in Settings (data-theme on <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --app-bg: #202020; --surface: #2c2c2c; --text: #f0f0f0; --muted: #b0b0b0; --faint: #8a8a8a;
    --border: #3d3d3d; --hover: rgba(255,255,255,.08); --input-bg: #2c2c2c; --sep: #3d3d3d;
    --shadow: 0 8px 28px rgba(0,0,0,.6); --card-shadow: 0 1px 2px rgba(0,0,0,.4); --folder-line: #3d3d3d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #202020; --surface: #2c2c2c; --text: #f0f0f0; --muted: #b0b0b0; --faint: #8a8a8a;
  --border: #3d3d3d; --hover: rgba(255,255,255,.08); --input-bg: #2c2c2c; --sep: #3d3d3d;
  --shadow: 0 8px 28px rgba(0,0,0,.6); --card-shadow: 0 1px 2px rgba(0,0,0,.4); --folder-line: #3d3d3d;
}

html, body {
  margin: 0; height: 100%;
  font-family: -apple-system, 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px; color: var(--text); background: var(--app-bg);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* text selection and cursor in dark gray instead of the default blue (same as on the computer).
   iPhone tints its selection with the cursor colour, so caret-color is set too. */
::selection { background: #5c5c5c; color: #ffffff; }
input, textarea, #editor { caret-color: #5c5c5c; }
:root[data-theme="dark"] ::selection { background: #8a8a8a; }
:root[data-theme="dark"] input, :root[data-theme="dark"] textarea, :root[data-theme="dark"] #editor { caret-color: #b0b0b0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) ::selection { background: #8a8a8a; }
  :root:not([data-theme="light"]) input, :root:not([data-theme="light"]) textarea, :root:not([data-theme="light"]) #editor { caret-color: #b0b0b0; }
}

svg.fi { width: 20px; height: 20px; flex: none; fill: currentColor; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.icon-btn:active { background: var(--hover); }
.icon-btn svg.fi { width: 22px; height: 22px; }

.btn { padding: 10px 16px; border-radius: 8px; background: var(--input-bg); border: 1px solid var(--border); font-weight: 600; }
.btn.primary { background: var(--text); color: var(--app-bg); border-color: var(--text); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.btn.danger { background: #e34243; border-color: #e34243; color: #fff; } /* delete / warning actions in red (same as Important) */

.screen { min-height: 100%; }

/* ---------- sign in ---------- */
#login { display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--safe-top)) 20px 24px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 30px; margin: 0 0 8px; }
.login-box form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=email], input[type=password], input[type=text], input[type=url] {
  font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 12px; outline: none;
}
input:focus { border-color: var(--muted); }
.msg { min-height: 18px; margin: 0; font-size: 13px; color: var(--muted); }
.msg.error { color: #e34243; }
.login-box form[hidden] { display: none; }
/* the landing page (ezmind.app): logo, name, what it is, SIGN IN → the form under it */
.landing-logo { display: block; width: 72px; height: 72px; border-radius: 18px; }
.login-box h1.landing-name { font-size: 40px; font-weight: 800; letter-spacing: -.5px; margin: 16px 0 10px; }
.landing-name span { background: linear-gradient(90deg, #a78bfa, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-text { font-size: 17px; line-height: 1.5; color: var(--muted); margin: 0 0 24px; }
.btn.landing-signin { height: 48px; font-size: 15px; font-weight: 700; letter-spacing: .08em; border-radius: 10px; }
.btn.landing-signin[hidden] { display: none; }
.landing-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; opacity: .8; }
.login-box form .muted { margin: 0; }
/* two-step sign-in: the 6-digit code, the QR code to scan and the key to type in by hand */
input.mfa-code { font-size: 22px; letter-spacing: .3em; text-align: center; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; outline: none; }
.mfa-qr { display: block; width: 180px; height: 180px; margin: 6px auto; padding: 8px; background: #fff; border-radius: 10px; }
.mfa-key { font-family: ui-monospace, Menlo, monospace; font-size: 13px; user-select: all; -webkit-user-select: all; word-break: break-all; color: var(--text); }
.sheet .mfa-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 10px; }
.sheet .mfa-form .actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- list ---------- */
#list { display: flex; flex-direction: column; }
.list-head { position: sticky; top: 0; z-index: 5; background: var(--app-bg); padding: calc(10px + var(--safe-top)) 16px 8px; }
.title-row { display: flex; align-items: center; gap: 8px; }
.title-row h1 { font-size: 28px; margin: 0; flex: 1; }
/* logo + name on top, then a bit of air before the tab title */
.app-bar { display: flex; align-items: center; gap: 4px; margin: -6px -8px 10px 0; }
.app-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.app-logo { width: 20px; height: 20px; }
/* sync state: cloud icon like on the computer (pulses while syncing, red on a problem) */
.sync-btn.syncing svg { animation: sync-pulse 1s ease-in-out infinite; }
.sync-btn.error, .sync-btn.offline { color: #e34243; }
@keyframes sync-pulse { 50% { opacity: .35; } }
.search { display: flex; flex-direction: row; align-items: center; gap: 8px; background: var(--input-bg); border-radius: 10px; padding: 0 12px; height: 42px; margin-top: 8px; border: 1px solid var(--border); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search svg { color: var(--muted); }
.create-row { display: flex; gap: 8px; margin-top: 10px; }
.create-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 16px 0 14px; min-width: 0; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; }
.create-btn:active { background: var(--hover); }
.create-btn svg.fi { width: 18px; height: 18px; }
/* Agenda: Today and Week/Month – an icon with a small label on the right, no frame */
.create-btn.icon-only { flex-direction: column; gap: 3px; padding: 0 8px; margin-left: auto; border-color: transparent; background: transparent; color: var(--muted); font-weight: 400; }
.create-btn.icon-only + .create-btn.icon-only { margin-left: 0; }
.create-btn.icon-only span { font-size: 11px; line-height: 1; }
.create-btn.icon-only svg.fi { width: 20px; height: 20px; }
.create-btn[hidden] { display: none; }
.card.flash { animation: card-flash 1.2s ease-out; } /* "Today": the card lights up once */
@keyframes card-flash { 0%, 40% { outline: 3px solid #0a84ff; outline-offset: 2px; } 100% { outline: 3px solid transparent; outline-offset: 2px; } }

main#items { padding: 4px 16px calc(88px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 8px; } /* room for the tab bar */
.empty-state { white-space: pre-line; }

/* ---------- tabs: bar at the bottom (phone), rail on the left (iPad) – like Teams ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; padding: 4px 4px calc(4px + var(--safe-bottom));
  background: #e6e6e6; border-top: 1px solid var(--border); /* a shade darker, like the Teams side bar */
}
:root[data-theme="dark"] .tabbar { background: #161616; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar { background: #161616; } }
.tab-btn { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; color: var(--muted); border-radius: 8px; }
.tab-btn .ti { display: flex; }
.tab-btn .ti svg.fi { width: 24px; height: 24px; fill: currentColor; }
.tab-btn .tl { font-size: 11px; }
.tab-btn.active { color: #2b2b2b; }
.tab-btn .badge {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: #5c5c5c; color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
}
.tab-btn .badge.red { background: #e34243; }
:root[data-theme="dark"] .tab-btn.active { color: #f0f0f0; }
:root[data-theme="dark"] .tab-btn .badge:not(.red) { background: #8a8a8a; color: #1f1f1f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tab-btn.active { color: #f0f0f0; }
  :root:not([data-theme="light"]) .tab-btn .badge:not(.red) { background: #8a8a8a; color: #1f1f1f; }
}

/* folder rows are pulled 7 px left so the arrows line up with the note cards; the row highlight sticks out 7 px on both sides
   and the row icons end about 10 px from its right end (same as on the computer) */
.folder { display: flex; flex-direction: column; margin-left: -7px; }
.folder-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 0 0 4px; margin-right: -7px; border-radius: 8px; font-weight: 600; }
.folder-head .fbtn:last-child { margin-right: 1px; }
.folder-head:active { background: var(--hover); }
.folder-head .chev { width: 16px; height: 16px; transition: transform .15s; }
.folder.collapsed .chev { transform: rotate(-90deg); }
.folder-head .fname { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-head .count { font-weight: 400; font-size: 13px; color: var(--faint); }
.folder-head .fspacer { flex: 1; }
.folder-head .fbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted); }
.folder-head .fbtn:active { background: var(--hover); }
.folder-body { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 6px 14px; padding-left: 10px; border-left: 2px solid var(--folder-line); }
.folder.collapsed .folder-body { display: none; }
.folder-empty { font-size: 13px; color: var(--faint); padding: 6px 2px; }

.loose-notes { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Archive ---------- */
.tab-btn.tab-archive { display: none; } /* phone: opened from Settings, the bar keeps its 5 tabs */
.archive-info { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.archive-info span { flex: 1; min-width: 0; }
.archive-info button { flex: none; min-height: 36px; padding: 0 10px; border-radius: 8px; color: #e34243; font-size: 13px; font-weight: 600; }
.archive-info button:active { background: var(--hover); }

/* ---------- iPad / wide screens ---------- */
@media (min-width: 700px) {
  /* the list doesn't stretch over a huge screen */
  .list-head, main#items { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
  .list-head { padding-left: 24px; padding-right: 24px; }
  /* iPadOS blurs a band under its status bar (time, battery) – the header starts below it */
  .list-head { padding-top: calc(40px + var(--safe-top)); }
  main#items { padding-left: 24px; padding-right: 24px; }
  .create-btn { font-size: 14px; }
  /* tabs become a rail on the left, like Teams on a computer */
  #list { padding-left: 80px; }
  .tabbar {
    right: auto; width: 80px; flex-direction: column; gap: 4px;
    /* the grey rail starts below the band iPadOS blurs under its status bar (the blur over the plain page background
       isn't visible); the icons stay where they were */
    top: calc(var(--safe-top) + 28px); border-top-right-radius: 12px;
    padding: 8px 6px calc(12px + var(--safe-bottom));
    border-top: 1px solid var(--border); border-right: 1px solid var(--border);
  }
  .tab-btn { flex: none; height: 62px; justify-content: center; }
  .tab-btn.tab-archive { display: flex; margin-top: auto; } /* iPad: Archive at the bottom of the rail */
  .tab-btn.active::before { content: ''; position: absolute; left: -6px; top: 16px; bottom: 16px; width: 3px; border-radius: 2px; background: currentColor; }
  main#items { padding-bottom: calc(24px + var(--safe-bottom)); }
  /* notes stay one under another, like on the phone – just a bit more air */
  .notes-grid, .folder-body.notes-grid { gap: 10px; }
  /* the open note: a centred note window, not stretched edge to edge */
  #editor-screen {
    left: 0; right: 0; margin: 0 auto; width: min(680px, calc(100% - 48px));
    top: calc(var(--safe-top) + 56px);
    height: min(760px, calc(100% - var(--safe-top) - var(--safe-bottom) - 112px));
  }
  #editor { font-size: 18px; padding: 18px 22px 28px; }
  /* menus without a button to sit next to: a centred box instead of a full-width sheet */
  .sheet:not(.pop) { left: 50%; right: auto; bottom: 24px; width: min(480px, calc(100% - 48px)); transform: translateX(-50%); border-radius: 14px; padding-bottom: 12px; }
}
/* trackpad / mouse on iPad: hover feedback */
@media (hover: hover) {
  .card:hover { filter: brightness(.97); }
  .folder-head:hover, .icon-btn:hover, .fbtn:hover, .sheet .item:hover, .create-btn:hover { background: var(--hover); }
}

.section-title { display: flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; padding: 10px 2px 0; }
.section-title .ssort { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); padding: 6px 4px; }
.section-title .ssort svg.fi { width: 16px; height: 16px; }

.card { position: relative; border-radius: 8px; border-top: 4px solid; padding: 10px 12px 12px; box-shadow: var(--card-shadow); }

/* pull to refresh – the spinner sits under the sticky header (z-index 5) and slides out below it */
#ptr {
  position: fixed; left: 50%; top: 170px; z-index: 4; width: 38px; height: 38px; margin-left: -19px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; transform: translateY(-56px); opacity: 0; pointer-events: none;
}
#ptr .ptr-spinner { width: 18px; height: 18px; border: 2.5px solid var(--border); border-top-color: var(--muted); border-radius: 50%; }
#ptr.ready .ptr-spinner { border-top-color: var(--text); }
#ptr.spin .ptr-spinner { animation: ptr-spin .7s linear infinite; }
#ptr.back, #items.pull-back { transition: transform .22s ease, opacity .22s ease; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* drag & drop (press and hold) */
.card, .folder-head { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.card img { -webkit-touch-callout: none; pointer-events: none; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 50; margin: 0; pointer-events: none; opacity: .95; box-shadow: var(--shadow); border-radius: 8px; }
.folder-head.drag-ghost { background: var(--surface); }
.drag-src { opacity: .35; }
body.dragging, body.dragging * { -webkit-user-select: none !important; user-select: none !important; }
.drop-line { position: fixed; z-index: 49; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--muted); pointer-events: none; }
.drop-into { background: var(--hover); box-shadow: inset 0 0 0 2px var(--muted); border-radius: 8px; }
.card:active { filter: brightness(.96); }
.card .meta { display: flex; justify-content: flex-end; font-size: 12px; opacity: .65; height: 16px; }
.card .preview { line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.card .preview.empty { opacity: .5; font-style: italic; }
.card .line { position: relative; }
.card .line.first { font-weight: 600; }
.card .line.bullet, .card .line.check, .card .line.checked { padding-left: 22px; }
.card .line .mark { position: absolute; left: 2px; top: 0; height: 1.4em; display: flex; align-items: center; }
.card .line.bullet .mark::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: 4px; }
.card .line.check .mark::before, .card .line.checked .mark::before { content: ''; width: 14px; height: 14px; box-sizing: border-box; border: 1.5px solid currentColor; border-radius: 3px; opacity: .75; }
.card .line.checked .mark::before { background: currentColor; opacity: .8; }
/* the tick: the card colour cut out of the filled box (same as on the computer) */
.card .line.checked .mark::after {
  content: ''; position: absolute; left: 0; top: calc(.7em - 7px); width: 14px; height: 14px;
  background: var(--card-bg, #fff);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.3l2.9 2.9 6.1-6.6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.3l2.9 2.9 6.1-6.6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}
.card .line.checked { text-decoration: line-through; opacity: .65; }
.card .thumb { display: block; max-width: 140px; max-height: 80px; border-radius: 6px; margin: 3px 0; border: 1px solid rgba(128,128,128,.35); }

.empty-state { text-align: center; color: var(--faint); margin-top: 40px; line-height: 1.6; }

/* ---------- editor ---------- */
/* the note: a sticky-note card floating over the dimmed list */
.ed-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.38); animation: fade-in .15s ease-out; }
body.note-open { overflow: hidden; }
#editor-screen {
  display: flex; flex-direction: column; min-height: 0; background: var(--note-bg); color: var(--note-text);
  position: fixed; z-index: 20; left: 12px; right: 12px;
  top: calc(var(--safe-top) + 48px);
  height: min(560px, calc(100% - var(--safe-top) - var(--safe-bottom) - 96px));
  border-radius: 12px; overflow: hidden; box-shadow: 0 14px 44px rgba(0,0,0,.38);
  animation: card-in .16s ease-out;
}
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.ed-bar { display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 14px; background: var(--note-bar); color: var(--bar-text, #202020); flex: none; }
.ed-where { font-size: 14px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }
#editor { flex: 1; overflow-y: auto; padding: 14px 16px 24px; outline: none; font-size: 17px; line-height: 1.45; word-break: break-word; -webkit-user-select: text; user-select: text; }
#editor:empty::before { content: 'Take a note…'; opacity: .5; }#editor ul { margin: 0; padding-left: 24px; }
#editor ol { margin: 0; padding-left: 28px; }
#editor ul.checklist { list-style: none; padding-left: 0; }
#editor ul.checklist li { position: relative; padding-left: 30px; }
#editor ul.checklist li::before { content: ''; position: absolute; left: 2px; top: .18em; width: 18px; height: 18px; border: 1.5px solid currentColor; border-radius: 4px; opacity: .75; box-sizing: border-box; }
#editor ul.checklist li[data-checked="true"]::before { background: currentColor; opacity: .85; }
#editor ul.checklist li[data-checked="true"]::after {
  content: ''; position: absolute; left: 2px; top: .18em; width: 18px; height: 18px; background: var(--note-bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.3l2.9 2.9 6.1-6.6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}
#editor ul.checklist li[data-checked="true"] { text-decoration: line-through; opacity: .6; }
/* important item: red exclamation mark between the box and the text */
#editor ul.checklist li[data-important="true"] {
  padding-left: 48px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.6v7' stroke='%23e34243' stroke-width='2.8' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='13.2' r='1.7' fill='%23e34243'/%3E%3C/svg%3E") no-repeat 25px .18em / 18px 18px;
}
/* not done on its day (marked at 20:00): a red dot after its text (as a project's state dot) – no frame */
#editor ul.checklist li[data-missed="true"]::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e34243; margin-left: 8px; vertical-align: .1em; flex: none; align-self: center; pointer-events: none; }
/* a list with highlighted items is only as wide as its longest item, so the highlights end there */

.card .line.missed::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e34243; margin-left: 8px; vertical-align: .1em; flex: none; align-self: center; }

.card .preview { margin-left: -5px; padding-left: 5px; }
#ed-tools .tool[data-action="important"].active { color: #e34243; }
/* move to another day: Next day + month calendar */
.day-pick { width: 280px; max-width: 100%; }
.day-pick .dp-next { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 8px; font-size: 15px; }
.day-pick .dp-next:active { background: var(--hover); }
.day-pick .dp-next svg.fi { width: 20px; height: 20px; }
.day-pick .dp-sub { margin-left: auto; color: var(--muted); font-size: 13px; }
.day-pick .dp-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 4px; padding-top: 8px; border-top: 1px solid var(--border); font-weight: 600; }
.day-pick .dp-nav { width: 40px; height: 36px; border-radius: 8px; font-size: 22px; line-height: 1; }
.day-pick .dp-nav:active { background: var(--hover); }
.day-pick .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.day-pick .dp-wd { font-size: 11px; color: var(--muted); text-align: center; line-height: 20px; }
.day-pick .dp-day { position: relative; height: 36px; border-radius: 8px; font-size: 15px; }
.day-pick .dp-day:active:not(:disabled) { background: var(--hover); }
.day-pick .dp-day:disabled { opacity: .35; }
.day-pick .dp-day.today { box-shadow: inset 0 0 0 1.5px currentColor; font-weight: 600; }
.day-pick .dp-day.has-note::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: currentColor; opacity: .55; }
/* important note: red ! on the card (top left) and a red button in the note's top bar */
.card .imp-note { position: absolute; top: 5px; left: 10px; display: flex; color: #e34243; }
.card .imp-note svg.fi { width: 16px; height: 16px; }
.icon-btn.ed-imp.on { background: #e34243; color: #ffffff; }
.card.important { box-shadow: 0 0 0 2px #e34243, var(--card-shadow); }                 /* red border */
.card.today { box-shadow: 0 0 0 2px #4a4a4a, var(--card-shadow); }                     /* today's day note: dark grey border */
:root[data-theme="dark"] .card.today { box-shadow: 0 0 0 2px #a8a8a8, var(--card-shadow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.today { box-shadow: 0 0 0 2px #a8a8a8, var(--card-shadow); } }
#editor-screen.important { box-shadow: 0 0 0 2.5px #e34243, 0 14px 44px rgba(0,0,0,.38); }
.card .line .imp { display: inline-block; color: #e34243; font-weight: 800; margin-right: 6px; }
#editor a { color: #7536f0; font-weight: 600; text-decoration: none; }
#editor .att {
  display: inline-block; position: relative; max-width: 100%; padding: 6px 12px 6px 32px; margin: 3px 0; vertical-align: middle;
  border: 1px solid rgba(128,128,128,.45); border-radius: 8px; background: rgba(255,255,255,.4);
  font-size: 15px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer;
}
#editor .att::before {
  content: ''; position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M4.83 10.48L10.49 4.83C11.66 3.66 13.56 3.66 14.73 4.83C15.9 6 15.9 7.9 14.73 9.07L8.01 15.79C7.42 16.37 6.47 16.37 5.89 15.79C5.3 15.2 5.3 14.25 5.89 13.67L11.9 7.66C12.09 7.46 12.09 7.14 11.9 6.95C11.7 6.75 11.39 6.75 11.19 6.95L5.18 12.96C4.21 13.94 4.21 15.52 5.18 16.5C6.16 17.47 7.74 17.47 8.72 16.5L15.43 9.78C17 8.22 17 5.68 15.43 4.12C13.87 2.56 11.34 2.56 9.78 4.12L4.12 9.78C3.93 9.97 3.93 10.29 4.12 10.48C4.32 10.68 4.63 10.68 4.83 10.48Z'/></svg>") center / 16px 16px no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M4.83 10.48L10.49 4.83C11.66 3.66 13.56 3.66 14.73 4.83C15.9 6 15.9 7.9 14.73 9.07L8.01 15.79C7.42 16.37 6.47 16.37 5.89 15.79C5.3 15.2 5.3 14.25 5.89 13.67L11.9 7.66C12.09 7.46 12.09 7.14 11.9 6.95C11.7 6.75 11.39 6.75 11.19 6.95L5.18 12.96C4.21 13.94 4.21 15.52 5.18 16.5C6.16 17.47 7.74 17.47 8.72 16.5L15.43 9.78C17 8.22 17 5.68 15.43 4.12C13.87 2.56 11.34 2.56 9.78 4.12L4.12 9.78C3.93 9.97 3.93 10.29 4.12 10.48C4.32 10.68 4.63 10.68 4.83 10.48Z'/></svg>") center / 16px 16px no-repeat;
}
#editor .att.loading { opacity: .5; }
:root[data-theme="dark"] #editor .att { background: rgba(255,255,255,.08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #editor .att { background: rgba(255,255,255,.08); } }
#editor img.shot[data-shot$=".svg"], .card .thumb[src*=".svg?"] { background: #fff; min-width: 40px; min-height: 40px; object-fit: contain; }
.viewer img[src*=".svg?"] { background: #fff; width: 90vw; height: auto; }
#editor img.shot { display: block; max-width: min(100%, 220px); max-height: 160px; margin: 6px 0; border-radius: 8px; border: 1px solid rgba(128,128,128,.35); }
.ed-tools { display: flex; align-items: center; justify-content: space-around; padding: 4px 6px; border-top: 1px solid rgba(128,128,128,.25); flex: none; background: var(--note-bg); }
.tool { width: 42px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--note-text); opacity: .85; }
.tool.active { background: rgba(128,128,128,.25); opacity: 1; }
.link-bubble { position: fixed; z-index: 30; display: inline-flex; gap: 6px; align-items: center; background: #202020; color: #fff; padding: 8px 12px; border-radius: 8px; font-size: 14px; text-decoration: none; box-shadow: var(--shadow); }
.link-bubble svg.fi { width: 16px; height: 16px; }

/* ---------- bottom sheet (menus) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--surface); color: var(--text); border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  padding: 8px 12px calc(16px + var(--safe-bottom)); max-height: 80vh; overflow-y: auto;
}
/* pop-up next to the button that opened it */
.sheet-backdrop.light { background: rgba(0,0,0,.12); }
.sheet.pop {
  right: auto; bottom: auto; border-radius: 12px; padding: 4px 6px 6px;
  border: 1px solid var(--border); max-height: 70vh; overscroll-behavior: contain;
  animation: pop-in .12s ease-out;
}
.sheet.pop .item { padding: 11px 8px; font-size: 15px; }
.sheet.pop h3 { margin: 8px 8px 2px; }
@keyframes pop-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.sheet h3 { font-size: 13px; color: var(--faint); font-weight: 600; margin: 10px 8px 4px; text-transform: uppercase; letter-spacing: .04em; }
.sheet .item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 8px; border-radius: 8px; text-align: left; font-size: 16px; }
.sheet .item:active { background: var(--hover); }
.sheet .item.current::after { content: '✓'; margin-left: auto; }
/* info lines in a sheet (sync: account, state) as a bulleted list */
.sheet .menu-info { margin: 2px 0 6px; padding: 0 12px 0 30px; font-size: 14px; color: var(--muted); line-height: 1.7; list-style: disc; }
.sheet .item.danger { color: #e34243; }
.sheet .colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 8px; }
.sheet .swatch { height: 52px; border-radius: 10px; border: 1px solid rgba(128,128,128,.3); position: relative; }
/* selected colour: a tick, like on the computer (the custom swatch has its palette, so it gets a ring instead) */
.sheet .swatch.current:not(.custom)::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 14px; height: 8px;
  border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: translateY(-2px) rotate(-45deg);
}
.sheet .swatch.custom.current { box-shadow: inset 0 0 0 2px currentColor; }
.sheet .swatch.custom { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sheet .swatch.custom.blank { border-color: #000000; }
.sheet .swatch.custom svg.fi { width: 24px; height: 24px; pointer-events: none; }
.sheet .swatch.custom input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.sheet .form { display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.sheet .actions { display: flex; gap: 8px; justify-content: flex-end; padding: 8px; }

/* ---------- image viewer ---------- */
/* Face ID lock – above everything, also above an open note, sheets and the help */
.app-lock { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom)); background: var(--app-bg); }
.app-lock[hidden] { display: none; }
.app-lock-box { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.app-lock-box .app-logo { width: 48px; height: 48px; margin-bottom: 4px; }
.app-lock-title { font-size: 22px; font-weight: 700; margin: 0; }
.app-lock-box .muted { margin: 0 0 8px; min-height: 18px; }

/* ---------- achievements (ach-phone.js) ---------- */
/* the trophy in the top bar, with a purple dot while something new waits to be seen */
.ach-btn { position: relative; }
.ach-btn .dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #7c3aed; box-shadow: 0 0 0 2px var(--app-bg); }
.ach-btn .dot[hidden] { display: none; }
/* the achievements window (the computer's page in a frame), always dark, over the whole screen */
.ach-overlay { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: #16181d;
  padding: var(--safe-top) 0 var(--safe-bottom); }
.ach-overlay[hidden] { display: none; }
.ach-overlay iframe { flex: 1; width: 100%; border: 0; background: #16181d; }
/* "Achievement unlocked": a dark pill at the bottom, stays until tapped */
.ph-bubble { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-bottom)); z-index: 70;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 5px 18px 5px 6px; border-radius: 30px;
  background: #101216; color: #fff; border: 1px solid #2b2f37; box-shadow: 0 8px 24px rgba(0,0,0,.35); font: inherit; text-align: left; }
.ph-bt { display: flex; flex-direction: column; min-width: 0; }
.ph-b1 { font-size: 11px; color: #b4bcc8; white-space: nowrap; }
.ph-b2 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-medal { position: relative; display: inline-block; flex: none; }
.ph-medal > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ph-medal svg.ph-medal-icon { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; }

/* Settings → Help */
.help-view { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--app-bg); }
.help-view[hidden] { display: none; }
.help-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + var(--safe-top)) 16px 10px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 17px; }
.help-view iframe { flex: 1; width: 100%; border: 0; background: var(--app-bg); padding-bottom: var(--safe-bottom); }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--safe-top) 8px var(--safe-bottom); }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }

.sheet .confirm-warn { color: #e34243; font-weight: 600; margin-top: 2px; } /* deleting a folder/month deletes its notes */

/* ---------- week / month view (Agenda → Week/Month, cal.js) ---------- */
.cal-screen { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; background: var(--app-bg); }
body.cal-open { overflow: hidden; }
.cal-head { flex: none; padding: calc(6px + var(--safe-top)) 12px 8px; border-bottom: 1px solid var(--sep); }
.cal-bar { display: flex; align-items: center; gap: 2px; }
.cal-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; padding-left: 2px; }
#cal-title { font-size: 20px; font-weight: 700; }
.cal-range { font-size: 13px; color: var(--muted); }
svg.rot-l { transform: rotate(90deg); }
svg.rot-r { transform: rotate(-90deg); }
.cal-tools { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cal-seg { display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.cal-seg button { padding: 7px 16px; font-size: 14px; }
.cal-seg button.on { background: var(--input-bg); font-weight: 700; }
.cal-now { margin-left: auto; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border); font-size: 14px; background: var(--surface); }
.cal-search { margin-top: 8px; height: 38px; }
.cal-hits { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cal-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 12px calc(24px + var(--safe-bottom)); }

/* week: the days under each other, each like a small day note */
.cday { background: var(--d-bg); color: var(--d-text); border-radius: 10px; margin-bottom: 10px; box-shadow: var(--card-shadow); overflow: hidden; scroll-margin-top: 4px; }
.cday.today { box-shadow: 0 0 0 2px var(--text), var(--card-shadow); }
.cday-head { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; background: var(--d-bar); color: var(--d-bartext); }
.cday-name { font-size: 13px; font-weight: 800; letter-spacing: .03em; }
.cday-date { font-size: 13px; opacity: .85; }
.cday-count { margin-left: auto; font-size: 12px; opacity: .85; }
.cday-head svg.cday-open { width: 15px; height: 15px; align-self: center; opacity: .75; }
.cday-items { padding: 6px 8px 0; }
.cplain { font-size: 14px; opacity: .7; padding: 2px 4px; }
.citem { display: flex; align-items: flex-start; gap: 10px; padding: 6px 4px; font-size: 16px; line-height: 1.35; border-radius: 6px; }
.citem:active { background: rgba(0,0,0,.06); }
.citem .ct { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.citem.done .ct { text-decoration: line-through; opacity: .55; }
.citem.missed::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e34243; margin-left: 8px; vertical-align: .1em; flex: none; align-self: center; margin-right: 2px; }
.cimp { color: #e34243; }
.cbox { width: 22px; height: 22px; flex: none; margin-top: -1px; border-radius: 5px; border: 2px solid currentColor; opacity: .7; display: inline-flex; align-items: center; justify-content: center; }
.citem.done .cbox { background: currentColor; opacity: .55; }
.citem.done .cbox::after { content: ''; width: 6px; height: 11px; border: solid var(--d-bg); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.cday-add { padding: 4px 8px 10px; }
.cday-add input { width: 100%; font-size: 16px; color: inherit; background: rgba(0,0,0,.05); border: 0; border-radius: 8px; padding: 9px 10px; outline: none; }
:root[data-theme="dark"] .cday-add input { background: rgba(255,255,255,.07); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cday-add input { background: rgba(255,255,255,.07); } }
.cday-add input::placeholder { color: inherit; opacity: .5; }

/* month: a calendar grid, each day with what's left */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mwd { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding-bottom: 2px; }
.mcell { min-height: 64px; display: flex; flex-direction: column; align-items: stretch; gap: 1px; padding: 3px 4px; border-radius: 7px; background: var(--d-bg); color: var(--d-text); border-top: 3px solid var(--d-bar); text-align: left; overflow: hidden; }
.mcell.outside { opacity: .3; }
.mcell.today { box-shadow: 0 0 0 2px var(--text); }
.mtop { display: flex; align-items: center; justify-content: space-between; }
.mnum { font-size: 13px; font-weight: 700; }
.mcount { font-size: 10px; font-weight: 700; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--d-bar); color: var(--d-bartext); display: inline-flex; align-items: center; justify-content: center; }
.mline { font-size: 10px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.mline:nth-child(n+4) { display: none; } /* phone: 2 items per day (child 1 is the number); a wide iPad shows what fits */

/* search: matching items marked, the rest faded */
.cal-screen.searching .citem, .cal-screen.searching .cplain { opacity: .3; }
.cal-screen.searching .citem.hit, .cal-screen.searching .cplain.hit { opacity: 1; }
.cal-screen.searching .citem.hit .ct { background: rgba(255, 214, 0, .55); border-radius: 3px; box-shadow: 0 0 0 2px rgba(255, 214, 0, .55); }
.cal-screen.searching .cday.no-hit, .cal-screen.searching .mcell.no-hit { opacity: .35; }
.cal-screen.searching .mcell.has-hit { box-shadow: 0 0 0 2px #e0b800; }

/* the "move to another day" part of an item's pop-up */
.cal-later { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border); font-size: 14px; background: var(--surface); }
.cal-now[hidden] + .cal-later { margin-left: auto; } /* "This week" hidden → Later on the right on its own */
.cal-later-add { padding: 4px 8px 8px; }
.cal-later-add input { width: 100%; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.cal-pick { padding: 0 8px 8px; }
.cal-pick-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-pick-days button { padding: 8px 0; border-radius: 8px; background: var(--input-bg); font-size: 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal-pick-days button span { font-weight: 400; font-size: 13px; }
.cal-pick-days button:disabled { opacity: .35; }
.cal-pick-date { display: flex; gap: 8px; margin-top: 8px; }
.cal-pick-date input { flex: 1; min-width: 0; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }

/* Agenda / week view: what got done today (only shown when something is) */
.done-today { margin: 4px 2px 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 15px; font-weight: 600; }
.cal-done { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
/* progress of a day note in the editor: a thin bar that fills up with every ticked item, "3 of 5" next to it */
.ed-progress { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 16px 0; color: var(--note-text); }
.ed-progress .pbar { flex: 1; height: 7px; border-radius: 4px; background: color-mix(in srgb, currentColor 14%, transparent); overflow: hidden; }
.ed-progress .pbar span { display: block; height: 100%; width: 0; border-radius: 4px; background: color-mix(in srgb, currentColor 60%, transparent); transition: width .35s ease; }
.ed-progress .ptext { font-size: 13px; opacity: .7; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* iPad: the week / month view and the achievements start below the band iPadOS blurs under its status bar, like the
   list (.list-head above) – here at the end, after their own rules */
@media (min-width: 700px) {
  .cal-head { padding-top: calc(40px + var(--safe-top)); }
  .ach-overlay { padding-top: calc(40px + var(--safe-top)); }
}
/* … and a project's board (its rules come later in this file, so this one is repeated after them – see the end) */

/* a wide iPad (landscape, or a big one upright): the week like on the computer – the 7 days side by side as columns,
   each scrolling on its own, "+ Add item" at the bottom; the header in one row */
@media (min-width: 900px) {
  .cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-left: 16px; padding-right: 16px; }
  .cal-bar { flex: none; }
  .cal-titles { flex: none; flex-direction: row; align-items: baseline; gap: 10px; padding: 0 8px 0 2px; }
  .cal-tools { margin-top: 0; }
  .cal-search { margin-top: 0; flex: 1; min-width: 220px; max-width: 420px; }
  .cal-done { flex-basis: 100%; margin-top: 0; }
  .cal-screen:not(.month) .cal-body { overflow: hidden; padding: 12px 16px calc(16px + var(--safe-bottom)); }
  .cweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 100%; }
  .cweek .cday { display: flex; flex-direction: column; min-height: 0; margin: 0; }
  .cweek .cday-head { position: relative; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px; }
  .cweek .cday-head svg.cday-open { position: absolute; top: 9px; right: 8px; }
  .cweek .cday-count { margin-left: 0; }
  .cweek .cday-items { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 6px 0; }
  .cweek .citem { font-size: 15px; gap: 8px; }
  .cweek .cday-add { padding: 6px 6px 8px; }
}

/* a wide iPad: the month fills the screen's height like on the computer, every day shows as many items as fit */
@media (min-width: 900px) {
  .cal-screen.month .cal-body { overflow: hidden; padding: 12px 16px calc(16px + var(--safe-bottom)); }
  .cal-screen.month .mgrid { height: 100%; grid-template-rows: auto; grid-auto-rows: minmax(0, 1fr); gap: 6px; }
  .cal-screen.month .mcell { min-height: 0; padding: 5px 7px; gap: 2px; border-top-width: 4px; }
  .cal-screen.month .mnum { font-size: 14px; }
  .cal-screen.month .mline { display: block; font-size: 12px; }
}

/* Later as the last column of the week (a wide iPad only – the "Later" button everywhere else) and dragging items */
.clater { display: none; }
.cal-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; background: var(--d-bg); color: var(--d-text);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.28); opacity: .95; padding: 6px 8px; }
@media (min-width: 900px) {
  .cweek { grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.15fr); }
  .cweek .clater { display: flex; border: 1.5px dashed color-mix(in srgb, var(--d-bar) 80%, #000 20%); box-shadow: none; margin-left: 6px; }
  .cweek .clater .cday-date { font-weight: 400; }
  .cal-screen:not(.month) .cal-later { display: none; }
  .cweek .citem { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .cweek .citem.dragging { opacity: .3; }
  .cweek .cday.drop-target { box-shadow: 0 0 0 3px var(--text), var(--card-shadow); }
}
@media (min-width: 900px) { .cweek .citem { font-size: 14px; } .cweek .citem .ct { overflow-wrap: break-word; word-break: normal; } }

/* achievements open: the page under them dark too (iOS tints the band under the status bar from it) */
body.ach-open { background: #16181d; }

/* a card planned as a task on some days ("Add to a day…"): 📅 27. 11. · 28. 11. ✓ */
.card .preview .planned { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13px; opacity: .75; }
.card .preview .planned svg.fi { width: 15px; height: 15px; flex: none; }

/* moving checklist items in an open note (reorder.js): a grip ⋮⋮ on the right of every item, the dragged copy, the
   drop line. The grip is big enough for a finger; the text keeps clear of it. */
#editor ul.checklist li { padding-right: 34px; }

.reorder-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.reorder-grip { position: fixed; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; opacity: .45;
  pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.reorder-grip.active { opacity: .9; }
.reorder-grip svg { width: 11px; height: 18px; }
.reorder-ghost { position: fixed; left: 0; top: 0; padding: 6px 12px 6px 34px; border-radius: 8px; background: var(--note-bg, var(--surface)); box-shadow: 0 8px 22px rgba(0,0,0,.28);
  font-size: 17px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.reorder-ghost::before { content: ''; position: absolute; left: 8px; top: .45em; width: 18px; height: 18px; border: 1.5px solid currentColor; border-radius: 4px; opacity: .75; box-sizing: border-box; }
.reorder-ghost.done { text-decoration: line-through; }
.reorder-line { position: fixed; height: 2px; border-radius: 1px; background: currentColor; opacity: .85; }
.reorder-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
#editor ul.checklist li.reorder-dragging { opacity: .3; }

/* the week on a wide iPad: where a dragged item lands (in its own day too – that changes the order) */
.cal-drop-line { position: fixed; height: 2px; border-radius: 1px; background: currentColor; opacity: .85; pointer-events: none; z-index: 61; display: none; }
.cal-drop-line.on { display: block; }
.cal-drop-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* the week on a wide iPad: ⋮⋮ on the right of every item – "this can be dragged" (it drags at once) */
.cgrip { display: none; }
@media (min-width: 900px) {
  .cweek .cgrip { display: flex; flex: none; align-self: flex-start; align-items: center; justify-content: center; width: 26px; height: 26px; margin: -3px -4px -3px 0;
    opacity: .4; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .cweek .cgrip svg { width: 9px; height: 15px; }
  .cweek .citem.done .cgrip { opacity: .3; }
  .cal-ghost .cgrip { opacity: .7; }
}

/* an idea's state in the Inbox (app.js → cardState): green ✓ = done, orange bell = waiting too long; the state's icon
   first, then the red !; the frame in that colour, split with red (important) – the state on top, red below */
.card .card-badges { position: absolute; top: 5px; left: 10px; display: flex; align-items: center; gap: 5px; }
.card .card-badges .imp-note { position: static; }
.card .state-note { display: flex; }
.card .state-note svg { width: 16px; height: 16px; }
.card .state-note.done { color: #1fd660; }
.card .state-note.stale { color: #f28918; }
.card.ringed { box-shadow: var(--card-shadow); }
.card .state-ring { position: absolute; top: -6px; left: -2px; right: -2px; bottom: -2px; border-radius: 10px; padding: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--ring-top), var(--ring-bottom)); /* the state's colour into red, left → right */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.card .preview .planned .pdone { color: #1fd660; font-weight: 700; } /* a done day (with several planned): only its tick green */
/* the ✓ button in an Inbox idea's top bar: green when it's marked done */
.icon-btn.ed-done.on { background: #1fd660; color: #ffffff; }
/* the Agenda: a day with everything ticked off – its title crossed out, a green ✓ next to it (card and open note) */
.card .preview .line.first .day-done-title { text-decoration: line-through; opacity: .7; }
.card .preview .line.first .day-done-ok { display: inline-flex; vertical-align: -3px; margin-left: 6px; color: #1fd660; }
.card .preview .line.first .day-done-ok svg { width: 18px; height: 18px; }
#editor.day-all-done > :first-child { text-decoration: line-through; text-decoration-thickness: 1.5px; }
#editor.day-all-done > :first-child::after { content: ''; display: inline-block; width: 20px; height: 20px; margin-left: 8px; vertical-align: -3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.6l3.2 3.2L13 4.6' fill='none' stroke='%231fd660' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
/* week / month: a day's header is the same strong colour as everywhere; a day with nothing in it is lighter as a whole */
/* today's colour for a split frame (today + important): the same as .card.today */
:root { --today-ring: #4a4a4a; }
:root[data-theme="dark"] { --today-ring: #a8a8a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --today-ring: #a8a8a8; } }
/* while a checklist turns into lines: no crossed-out look for the browser to copy into the text (app.js → toggleChecklist) */
#editor.no-tick-style ul.checklist li[data-checked="true"] { text-decoration: none; opacity: 1; }

/* ---------- a project as a board (project ⋯ → Show as board, board.js) – the same look as the window on the computer ---------- */
.board-screen { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; background: var(--k-default); color: #202020;
  --k-accent: #5c5c5c; --k-default: #f3f3f3; --k-col: #e8e8e8; --k-card: #ffffff; --k-text: #202020; --k-sub: #606060; --k-line: #d6d6d6; --k-hover: rgba(0,0,0,.08); --k-done: #1fd660; }
:root[data-theme="dark"] .board-screen { --k-accent: #b8b8b8; --k-default: #202020; --k-col: #2c2c2c; --k-card: #383838; --k-text: #f0f0f0; --k-sub: #b0b0b0; --k-line: #3d3d3d; --k-hover: rgba(255,255,255,.08); --k-done: #1fd660; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board-screen { --k-accent: #b8b8b8; --k-default: #202020; --k-col: #2c2c2c; --k-card: #383838; --k-text: #f0f0f0; --k-sub: #b0b0b0; --k-line: #3d3d3d; --k-hover: rgba(255,255,255,.08); --k-done: #1fd660; } }
.bd-head { flex: none; display: flex; align-items: center; gap: 6px; padding: calc(6px + var(--safe-top)) 12px 6px 6px; color: #fff; }
.bd-head .icon-btn { color: #fff; }
.bd-title { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-body { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 4px 12px calc(14px + var(--safe-bottom)); overflow-x: auto; overflow-y: hidden; align-items: flex-start;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.bd-col { flex: none; width: min(86vw, 300px); max-height: 100%; display: flex; flex-direction: column; background: var(--k-col); color: var(--k-text); border-radius: 14px; scroll-snap-align: center; }
@media (min-width: 700px) { .bd-col { width: 280px; scroll-snap-align: start; } .bd-body { scroll-snap-type: none; } }
.bd-chead { display: flex; align-items: center; gap: 6px; padding: 10px 6px 6px 14px; font-size: 15px; font-weight: 700; }
.bd-cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-cdone { color: var(--k-done); display: inline-flex; }
.bd-cdone svg.fi { width: 16px; height: 16px; }
.bd-ccount { font-size: 13px; font-weight: 400; color: var(--k-sub); }
.bd-cmenu { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--k-sub); }
.bd-cmenu svg.fi { width: 18px; height: 18px; }
.bd-cards { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 8px; display: flex; flex-direction: column; gap: 8px; }
.bd-add { margin: 6px 8px 8px; padding: 9px 10px; border-radius: 9px; text-align: left; font-size: 14px; color: var(--k-sub); display: flex; align-items: center; gap: 6px; }
.bd-add:active { background: var(--k-hover); }
.bd-add svg.fi, .bd-addcol svg.fi { width: 16px; height: 16px; }
.bd-addcol { flex: none; width: min(70vw, 240px); border-radius: 14px; background: rgba(255,255,255,.2); color: #fff; padding: 12px 14px; font-size: 15px; text-align: left; display: flex; align-items: center; gap: 6px; scroll-snap-align: center; }
.bd-k { flex: none; background: var(--k-card); color: var(--k-text); border-radius: 9px; box-shadow: 0 1px 0 rgba(0,0,0,.25); padding: 9px 11px 9px 12px; font-size: 15px; line-height: 1.35;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y; }
/* a card's frame (board.js → bdFrameOf), a 2px ring that doesn't move the content: red = important / overdue, orange = due
   today / tomorrow, both = red → orange, done in a "done" column = the EzMind gradient */
.bd-k.f-red::after, .bd-k.f-or::after, .bd-k.f-ro::after, .bd-k.f-ez::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.bd-k.f-red::after { background: #e34243; } .bd-k.f-or::after { background: #f28918; }
.bd-k.f-ro::after { background: linear-gradient(90deg, #e34243, #f28918); } .bd-k.f-ez::after { background: linear-gradient(90deg, #7C3AED, #7DD3FC); }
.bd-k.bd-dragging { opacity: .35; }
.bd-labels { display: flex; gap: 4px; margin-bottom: 6px; }
.bd-labels i { display: block; width: 40px; height: 8px; border-radius: 4px; }
.bd-kt { overflow-wrap: anywhere; }
.bd-kt .ok, .bdc-circle.on { background: var(--k-done); }
.bd-kt .ok { display: inline-flex; width: 17px; height: 17px; border-radius: 50%; color: #fff; align-items: center; justify-content: center; vertical-align: -3px; margin-right: 6px; }
.bd-kt .ok svg.fi { width: 12px; height: 12px; }
.bd-k.done .t { color: var(--k-sub); }
.bd-kt .imp, .bdc-chk .imp { color: #e34243; margin-left: 4px; }
.bd-badges { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--k-sub); }
.bd-badges span { display: inline-flex; align-items: center; gap: 4px; }
.bd-badges svg.fi { width: 14px; height: 14px; }
/* all done: a green pill – icon and number centred, the same space on every side */
.bd-badges b { font-weight: 400; }
.bd-badges .all { background: var(--k-done); color: #fff; border-radius: 4px; height: 20px; box-sizing: border-box; padding: 0 5px; gap: 3px; line-height: 20px; }
.bd-badges .all svg.fi { width: 13px; height: 13px; display: block; }
.bd-badges .all b { font-weight: 600; display: block; line-height: 20px; }
.bd-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; box-shadow: 0 10px 24px rgba(0,0,0,.35) !important; opacity: .95; }
.bd-line { position: fixed; z-index: 61; height: 3px; border-radius: 2px; background: #fff; pointer-events: none; display: none; }
/* the opened card: over the board – the whole screen on a phone, a dialog on an iPad */
.bd-card-back { position: fixed; inset: 0; z-index: 16; background: rgba(0,0,0,.5); }
.bd-card { position: fixed; z-index: 17; inset: 0; background: var(--k-card); color: var(--k-text); display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); }
@media (min-width: 700px) { .bd-card { inset: calc(40px + var(--safe-top)) auto 24px 50%; transform: translateX(-50%); width: min(720px, calc(100vw - 40px)); border-radius: 14px; padding: 0; box-shadow: 0 12px 40px rgba(0,0,0,.4); } }
.bdc-top { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--k-line); }
.bdc-top .icon-btn { color: var(--k-sub); }
.bdc-col { height: 34px; border-radius: 8px; border: 0; padding: 0 10px; font: inherit; font-size: 15px; font-weight: 700; background: var(--k-hover); color: var(--k-text); }
.bdc-main { padding: 14px 18px 28px; }
.bdc-title { display: flex; align-items: flex-start; gap: 10px; }
.bdc-circle { flex: none; width: 24px; height: 24px; margin-top: 6px; border-radius: 50%; border: 2px solid var(--k-sub); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.bdc-circle.on { border-color: var(--k-done); }
.bdc-circle svg.fi { width: 15px; height: 15px; visibility: hidden; }
.bdc-circle.on svg.fi { visibility: visible; }
.bdc-title textarea { flex: 1; font: inherit; font-size: 21px; font-weight: 700; color: inherit; border: 0; outline: 0; resize: none; background: transparent; padding: 2px 4px; border-radius: 6px; overflow: hidden; }
.bdc-title textarea:focus { box-shadow: 0 0 0 2px var(--k-accent); }
.bdc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.bdc-acts button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--k-line); font-size: 14px; color: var(--k-text); }
.bdc-acts button.on { border-color: #e34243; color: #e34243; }
.bdc-acts svg.fi { width: 17px; height: 17px; }
.bd-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 14px 0 8px; }
.bd-card h3 svg.fi { width: 18px; height: 18px; color: var(--k-sub); }
.bd-card h3 .n { font-weight: 400; font-size: 13px; color: var(--k-sub); }
.bdc-desc { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.bdc-desc img { max-width: 100%; border-radius: 6px; }
.bdc-desc .muted { color: var(--k-sub); font-size: 14px; }
.bdc-prog { height: 8px; border-radius: 4px; background: var(--k-hover); overflow: hidden; margin: 0 0 8px; }
.bdc-prog i { display: block; height: 100%; background: var(--k-done); border-radius: 4px; }
.bdc-chk { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 15px; border-bottom: 1px solid var(--k-line); }
.bdc-chk .bx { flex: none; width: 22px; height: 22px; border-radius: 5px; border: 2px solid var(--k-sub); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.bdc-chk .bx svg.fi { width: 14px; height: 14px; visibility: hidden; }
.bdc-chk.on .bx { background: var(--k-done); border-color: var(--k-done); }
.bdc-chk.on .bx svg.fi { visibility: visible; }
.bdc-chk .tx { flex: 1; min-width: 0; outline: 0; padding: 1px 3px; border-radius: 4px; overflow-wrap: anywhere; }
.bdc-chk .tx:focus { box-shadow: 0 0 0 2px var(--k-accent); }
.bdc-chk.on .tx { text-decoration: line-through; color: var(--k-sub); }
.bdc-chk .del { width: 30px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--k-sub); }
.bdc-chk .del svg.fi { width: 15px; height: 15px; }
.bdc-new { display: flex; gap: 8px; margin-top: 10px; }
.bdc-new input { flex: 1; min-width: 0; border: 1px solid var(--k-line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 16px; color: inherit; background: transparent; }
/* a light board background (the default grey, or a light colour picked): dark text on it */
.board-screen.bg-light .bd-head, .board-screen.bg-light .bd-head .icon-btn { color: #202020; }
.board-screen.bg-light .bd-addcol { background: rgba(0,0,0,.08); color: #202020; }
.board-screen.bg-light .bd-line { background: var(--k-accent); }
/* labels on a card: a short bar, or a pill with the label's name */
.bd-labels { flex-wrap: wrap; }
.bd-labels .lbl { display: block; min-width: 40px; height: 8px; border-radius: 4px; }
.bd-labels .lbl.named { height: 18px; line-height: 18px; padding: 0 8px; font-size: 12px; font-weight: 700; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bdc-lab { font-size: 12px; font-weight: 700; color: var(--k-sub); margin: 0 0 6px; }
.bdc-lbls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bdc-lbl { min-width: 52px; height: 34px; border-radius: 6px; padding: 0 12px; font-size: 15px; font-weight: 700; }
.bdc-lbl.plus { min-width: 34px; padding: 0; background: var(--k-hover); color: var(--k-text); display: inline-flex; align-items: center; justify-content: center; }
.bdc-lbl.plus svg.fi { width: 16px; height: 16px; }
.bdc-desc[contenteditable] { min-height: 80px; padding: 10px 12px; border-radius: 8px; background: var(--k-hover); outline: 0; -webkit-user-select: text; user-select: text; }
.bdc-desc[contenteditable]:focus { background: transparent; box-shadow: inset 0 0 0 2px var(--k-accent); }
.bdc-desc[contenteditable]:empty::before { content: attr(data-ph); color: var(--k-sub); }
/* the labels / background pop-ups (in a sheet) */
.bd-pop { display: flex; flex-direction: column; gap: 6px; }
.bd-pop-row { display: flex; align-items: center; gap: 10px; }
.bd-pop-list { display: flex; flex-direction: column; gap: 6px; } /* the labels under "Search labels…" */
.bd-pop-search { margin-bottom: 4px; }
.bd-pop-none { color: var(--muted); font-size: 14px; padding: 6px 2px; }
.bd-pop-check { flex: none; width: 22px; height: 22px; border-radius: 5px; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.bd-pop-check svg.fi { width: 14px; height: 14px; visibility: hidden; }
.bd-pop-check.on { background: var(--k-accent); border-color: var(--k-accent); }
.bd-pop-check.on svg.fi { visibility: visible; }
.bd-pop-bar { flex: 1; min-height: 38px; border-radius: 6px; padding: 0 12px; font-size: 15px; font-weight: 700; text-align: left; display: flex; align-items: center; }
.bd-pop-bar.big { flex: none; width: 100%; }
.bd-pop-edit { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.bd-pop-edit svg.fi { width: 18px; height: 18px; }
.bd-pop-wide { margin-top: 6px; }
.bd-pop-prev { background: var(--input-bg); border-radius: 8px; padding: 18px 24px; }
.bd-pop-name { border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 16px; color: inherit; background: var(--surface); }
.bd-pop-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bd-pop-colors.bg { grid-template-columns: repeat(4, 1fr); }
.bd-pop-colors button { height: 36px; border-radius: 6px; position: relative; }
.bd-pop-colors button.on::after { content: ''; position: absolute; inset: -3px; border: 2px solid var(--k-accent); border-radius: 8px; }
.bd-pop-custom { display: flex; align-items: center; gap: 8px; padding: 8px 4px; font-size: 15px; position: relative; }
.bd-pop-custom svg.fi { width: 18px; height: 18px; }
.bd-pop-custom input { position: absolute; inset: 0; opacity: 0; }
.bd-pop .actions { display: flex; justify-content: space-between; margin-top: 6px; }
.sheet { --k-default: #f3f3f3; --k-accent: #5c5c5c; }
/* To-Do: a project is one row – a tick in a circle, its name, a bar of its cards done; a tap opens its board */
.project-row > .folder-head { min-height: 48px; padding: 0 6px 0 12px; border-radius: 10px; background: var(--surface); box-shadow: var(--card-shadow); margin-bottom: 8px; gap: 10px; }
.project-row svg.picon { width: 22px; height: 22px; flex: none; }
.pprog { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pprog .pbar { width: 54px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.pprog .pbar i { display: block; height: 100%; background: #1fd660; border-radius: 3px; }
.pprog.all .ptext { color: #1fd660; font-weight: 700; }
.archived-project > .folder-head .fname, .archived-project > .folder-head .pprog { opacity: .7; } /* a deleted project in the Archive: a bit greyed */
/* the read-only board of a deleted project: a bar with Restore / Delete forever, nothing to edit */
.bd-arch { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; color: var(--muted); }
.bd-arch span { flex: 1; min-width: 0; }
.bd-arch button { height: 32px; padding: 0 12px; border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; box-shadow: var(--card-shadow); }
.bd-arch button.danger { color: #e34243; }
.board-screen.archived .bd-add, .board-screen.archived .bd-addcol, .board-screen.archived .bd-cmenu,
.board-screen.archived .bd-kdone:not(.on) { display: none; }
/* the row's state as a dot right of its progress – the colour of its frame; nothing going on = no dot (its place kept) */
.pprog .pstate { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.project-row.due-over .pprog .pstate { background: #e34243; }
.project-row.due-soon .pprog .pstate { background: #f28918; }
.project-row.due-both .pprog .pstate { background: linear-gradient(90deg, #e34243, #f28918); }
.project-row.complete .pprog .pstate { background: linear-gradient(90deg, #7C3AED, #5b96ff, #7DD3FC); }
/* boards, refinements (as on the computer): bigger darker badges, deadline, centred labels, bold ticks, icons 20 px */
.board-screen { --k-badge: #505050; }
:root[data-theme="dark"] .board-screen { --k-badge: #c8c8c8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board-screen { --k-badge: #c8c8c8; } }
.bd-badges { font-size: 13px; color: var(--k-badge); gap: 4px 12px; margin-top: 7px; }
.bd-badges svg.fi { width: 16px; height: 16px; }
.bd-badges b { font-weight: 500; }
.bd-badges .all svg.fi { width: 15px; height: 15px; }
.bd-badges .due-over, .bd-badges .due-soon, .bd-badges .due-done { color: #fff; height: 20px; box-sizing: border-box; padding: 0 5px; gap: 3px; border-radius: 4px; }
.bd-badges .due-over { background: #e34243; } .bd-badges .due-soon { background: #f28918; } .bd-badges .due-done { background: var(--k-done); }
.bd-badges .due-over svg.fi, .bd-badges .due-soon svg.fi, .bd-badges .due-done svg.fi { width: 15px; height: 15px; }
.bd-badges .due-over b, .bd-badges .due-soon b, .bd-badges .due-done b { font-weight: 600; line-height: 20px; display: block; }
.bd-labels .lbl.named { display: inline-flex; align-items: center; justify-content: center; line-height: normal; box-sizing: border-box; }
.bdc-lbl { display: inline-flex; align-items: center; justify-content: center; line-height: normal; }
.bd-kt .ok svg.fi.tick { width: 12px; height: 12px; }
.bdc-circle svg.fi.tick { width: 15px; height: 15px; }
.bdc-chk .bx svg.fi.tick { width: 14px; height: 14px; }
.bdc-acts svg.fi { width: 20px; height: 20px; }
.bd-card h3 svg.fi { color: var(--k-text); width: 20px; height: 20px; }
.bdc-due { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 6px; background: var(--k-hover); color: var(--k-text); font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.bdc-due svg.fi { width: 18px; height: 18px; }
.bdc-due span { font-size: 12px; font-weight: 700; border-radius: 3px; padding: 1px 5px; color: #fff; }
.bdc-due.due-over span { background: #e34243; } .bdc-due.due-soon span { background: #f28918; } .bdc-due.due-done span { background: var(--k-done); }
.bdc-desc img { display: block; max-width: min(100%, 260px); max-height: 180px; margin: 4px 0; border-radius: 6px; border: 1px solid rgba(128,128,128,.35); }
.bdc-desc .att { display: inline-block; max-width: 100%; padding: 4px 10px; margin: 2px 0; border: 1px solid rgba(128,128,128,.45); border-radius: 6px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* boards, round 3: "+ Add a card" / "+ Add an item" as in the week view, labels pop-up, column dragging */
.bd-add { margin: 6px 8px 8px; padding: 0; }
.bd-add input, .bdc-new input { width: 100%; box-sizing: border-box; height: 38px; border: 0; border-radius: 8px; padding: 0 11px; font: inherit; font-size: 16px; color: var(--k-text); background: var(--k-hover); outline: none; }
.bd-add input::placeholder, .bdc-new input::placeholder { color: var(--k-sub); }
.bd-add input:focus, .bdc-new input:focus { background: var(--k-card); box-shadow: inset 0 0 0 2px var(--k-accent); }
.bdc-new { display: block; margin-top: 10px; }
.bd-pop-wide { width: 100%; text-align: center; justify-content: center; margin-top: 6px; }
.bd-pop .btn.bd-pop-wide:not(.danger) { background: var(--input-bg); color: var(--text); border-color: transparent; }
.bd-pop .btn.danger.bd-pop-wide { background: #e34243; border-color: #e34243; color: #fff; }
.bd-pop-custom { justify-content: center; }
.bdc-chk .bx svg.fi.tick { width: 16px; height: 16px; }
.bd-labels .lbl.named { display: inline-block; height: 18px; line-height: 18px; padding: 0 8px; text-align: center; }
.bd-ccount { font-weight: 700; color: var(--k-text); }
.bd-colghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; margin: 0; overflow: hidden; box-shadow: 0 14px 32px rgba(0,0,0,.3); opacity: .96; transform-origin: 30% 20%; }
.bd-col.bd-coldragging { background: rgba(0,0,0,.14); }
.bd-col.bd-coldragging > * { visibility: hidden; }
.bd-chead { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.bd-pop label.bd-pop-custom { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; } /* the icon next to "Any color…", not above it */
/* boards, round 4: a column's own color, a bigger count, label names in the optical middle */
.bd-ccount { font-size: 15px; }
.bd-col.bd-col-dark .bd-chead, .bd-col.bd-col-dark .bd-ccount, .bd-col.bd-col-dark .bd-cmenu { color: #fff; }
.bd-col[style*="background"] .bd-add input { background: rgba(255,255,255,.45); }
.bd-col.bd-col-dark .bd-add input { background: rgba(255,255,255,.2); color: #fff; }
.bd-col.bd-col-dark .bd-add input::placeholder { color: rgba(255,255,255,.8); }
.bd-col[style*="background"] .bd-add input:focus { background: var(--k-card); color: var(--k-text); }
.bd-labels .lbl.named { line-height: 17px; padding-bottom: 1px; }
.bdc-lbl { line-height: normal; }
/* done: a circle in the card's top right corner (always shown on a phone / iPad), green with a tick when done */
.bd-k { position: relative; padding-right: 40px; }
.bd-kdone { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; padding: 0; background: none; display: inline-flex; align-items: center; justify-content: center; }
.bd-kdone::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px solid var(--k-sub); opacity: .55; }
.bd-kdone svg.fi.tick { position: relative; width: 12px; height: 12px; visibility: hidden; color: #fff; }
.bd-kdone.on::before { background: var(--k-done); border-color: var(--k-done); opacity: 1; }
.bd-kdone.on svg.fi.tick { visibility: visible; }
.bd-ghost .bd-kdone:not(.on) { visibility: hidden; }
/* To-Do: a project with a card past its deadline → red frame; one due today / tomorrow → orange */
.project-row.due-over > .folder-head { box-shadow: 0 0 0 2px #e34243, var(--card-shadow); }
.project-row.due-soon > .folder-head { box-shadow: 0 0 0 2px #f28918, var(--card-shadow); }
/* an important / overdue card and one due today / tomorrow at once: a 2px frame red → orange */
.project-row.due-both > .folder-head { border: 2px solid transparent; padding-left: 10px; padding-right: 4px;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(90deg, #e34243, #f28918) border-box; }
/* a project with every card done: a 2px frame in the EzMind gradient (the app icon's purple → light blue) */
.project-row.complete > .folder-head { border: 2px solid transparent; padding-left: 10px; padding-right: 4px;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(90deg, #7C3AED, #7DD3FC) border-box; }
/* columns: a light shadow, as on kanban boards */
.bd-col { box-shadow: 0 2px 6px rgba(0,0,0,.16), 0 1px 2px rgba(0,0,0,.2); }
:root[data-theme="dark"] .bd-col { box-shadow: 0 2px 6px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bd-col { box-shadow: 0 2px 6px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.5); } }
.bd-col.bd-coldragging { box-shadow: none; }

/* iPad: a project's board starts below the band iPadOS blurs under its status bar, like the week view (.cal-head) */
@media (min-width: 700px) {
  .bd-head { padding-top: calc(40px + var(--safe-top)); }
}

/* a project's card in the Important tab (bdCard overview): as on its board – the board's card colours, its project's name on top */
.bd-k-overview { --k-card: var(--surface); --k-text: var(--text); --k-sub: var(--muted); --k-done: #1fd660; --k-badge: var(--muted); --k-line: var(--border); margin-bottom: 10px; box-shadow: var(--card-shadow); }
.bd-kproj { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.bd-kproj svg.fi { width: 14px; height: 14px; }

/* ---------- a project's board: its own icon, ⋯, its numbers (board.js) ---------- */
.bd-head .bd-icon { display: inline-flex; flex: none; }
.bd-head .bd-icon .pi { width: 20px; height: 20px; display: block; }
.bd-head .bd-icon img.pi { border-radius: 5px; object-fit: cover; }
.bd-head .bd-title { flex: 1; min-width: 0; }
.bd-head .bd-more { margin-left: auto; flex: none; }
.board-screen.archived .bd-more { display: none; }
.bd-stats { flex: none; display: flex; gap: 14px; padding: 0 14px 8px; font-size: 12px; color: #fff; opacity: .8; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.bd-stats::-webkit-scrollbar { display: none; }
.bd-stats b { font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-stats .over b { color: #ff6b6b; }
.board-screen.bg-light .bd-stats { color: #202020; }
.board-screen.bg-light .bd-stats .over b { color: #e34243; }
.bd-stats[hidden] { display: none; }
/* its cards in the Important tab: the project's icon */
.bd-kproj .pi { width: 14px; height: 14px; flex: none; }
.bd-kproj img.pi { border-radius: 3px; object-fit: cover; }
/* ⋯ → Change icon */
.bd-icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.bd-icons button { height: 44px; border-radius: 8px; background: var(--input-bg); color: var(--text); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.bd-icons button svg { width: 24px; height: 24px; }
.bd-icons button.on::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--k-accent); border-radius: 8px; }
.bd-own { display: flex; align-items: center; gap: 10px; padding: 8px 2px 0; font-size: 15px; }
.bd-own .pi { width: 28px; height: 28px; flex: none; }
.bd-own img.pi { border-radius: 6px; object-fit: cover; }
.bd-pop-note { font-size: 13px; color: var(--muted); padding: 4px 2px 0; line-height: 1.35; }
/* a PNG / JPG → the square for the icon */
.bd-crop { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; }
.bd-crop-box { width: 100%; box-sizing: border-box; background: var(--surface); color: var(--text); border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; }
.bd-crop-title { font-size: 16px; font-weight: 700; text-align: center; }
.bd-crop-stage { position: relative; overflow: hidden; border-radius: 8px; align-self: center; touch-action: none; background: repeating-conic-gradient(#ccc 0 25%, #eee 0 50%) 0 0 / 16px 16px; }
.bd-crop-stage img { width: 100%; height: 100%; display: block; pointer-events: none; }
.bd-crop-frame { position: absolute; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); outline: 2px solid #fff; }
.bd-crop-corner { position: absolute; right: 3px; bottom: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.bd-crop-prev { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; min-width: 0; }
.bd-crop-prev canvas { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.bd-crop-prev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-crop-btns { display: flex; gap: 10px; }
.bd-crop-btns .btn { flex: 1; height: 44px; font-size: 16px; font-weight: 700; }
/* a card → Plan in agenda: Today / Tomorrow, the month, Confirm */
.bd-plan { gap: 4px; }
.bd-plan-quick { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 8px; font-size: 16px; color: var(--text); text-align: left; }
.bd-plan-quick svg.fi { width: 20px; height: 20px; flex: none; }
.bd-plan-quick .sub { margin-left: auto; color: var(--muted); font-size: 14px; }
.bd-plan-quick.on { background: var(--input-bg); box-shadow: inset 0 0 0 2px var(--k-accent); }
.bd-plan-quick:disabled { opacity: .4; }
.bd-cal-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; margin: 8px 0 4px; border-top: 1px solid var(--border); padding-top: 10px; }
.bd-cal-head button { width: 40px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.bd-cal-head button:disabled { opacity: .3; }
.bd-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.bd-cal .wd { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 0; }
.bd-cal button { height: 40px; border-radius: 8px; font-size: 15px; color: var(--text); position: relative; }
.bd-cal button:disabled { opacity: .3; }
.bd-cal button.today { box-shadow: inset 0 0 0 1.5px var(--muted); }
.bd-cal button.on { background: var(--k-accent); color: #fff; }
.bd-cal button.has::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--muted); }
.bd-cal button.on.has::after { background: currentColor; }
.bd-confirm { width: 100%; height: 46px; margin-top: 10px; font-size: 16px; font-weight: 700; }
.bd-confirm:disabled { opacity: .4; }
/* a chevron turned to point left / right (the month's ‹ ›) */
svg.fi.rot-left { transform: rotate(90deg); }
svg.fi.rot-right { transform: rotate(-90deg); }
