/* Extension-only styles */

/* Features that arrive in later steps */
.no-history [data-feature="history"],
.no-backups [data-feature="backups"],
.no-reminders [data-feature="reminders"] { display: none !important; }

/* The side panel is narrow: keep the toolbar to one tidy wrapping block */
.mode-panel .toolbar { flex-wrap: wrap; row-gap: 4px; }

/* Version in the bottom bar, so it's easy to see an update has arrived */
#app-version { color: #61afef; }

/* Password box */
#lock-msg.err { color: #e06c75; }

/* Backups page: backup files */
.bf-last { margin-bottom: 10px; }
.bf-big { font-size: 16px; font-weight: 600; color: #98c379; margin-bottom: 2px; }
.bf-opt { align-items: flex-start; }
.bf-opt .bk-meta { font-weight: normal; margin-top: 2px; }
.bf-folder-row { margin: 4px 0 6px 26px; align-items: center; }
.rm-msg.ok { color: #98c379; }
.rm-msg.err { color: #e06c75; }
#settings-modal .ret-actions { margin: 10px 0; }
.set-time { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.set-time select { background: #111; color: #ddd; border: 1px solid #444; border-radius: 4px; padding: 5px 8px; font-size: 13px; }

/* Reminders */
.rm-how { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 10px 0 4px; font-size: 13px; }
.rm-how label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.rm-how label.off { opacity: .45; cursor: default; }
.rm-head { margin: 16px 0 8px; }
.phone-steps { margin: 6px 0 8px 18px; padding: 0; font-size: 13px; line-height: 1.7; }
.phone-topic { background: #111; border: 1px solid #333; padding: 2px 6px; border-radius: 3px; color: #e5c07b; user-select: all; }
.rm-how input[type="checkbox"] { width: auto; margin: 0; padding: 0; flex: none; }
.rm-how label { white-space: nowrap; font-size: 13px; color: #ccc; }

/* Notes background */
#editor { background-size: cover; background-position: center; background-repeat: no-repeat; }
#editor.has-bg-img .tb { text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.nbg-scope { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; margin: 4px 0 8px; }
.nbg-scope label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.nbg-scope input { width: auto; margin: 0; }
.nbg-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.nbg-swatch { width: 74px; height: 42px; border: 2px solid #3a3a3a; border-radius: 6px; padding: 0; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.nbg-swatch span { font-size: 10px; color: #bbb; padding-bottom: 3px; font-weight: normal; }
.nbg-swatch.on { border-color: #61afef; }
#nbg-dim { width: 160px; }
#settings-modal .modal-box, #reminder-modal .modal-box { max-height: calc(100vh - 40px); overflow-y: auto; }

/* Website (phone) — the extension-only parts */
.mode-site .ext-only { display: none !important; }

/* Sync */
.sync-devices { margin: 8px 0; }
.sync-dev { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid #2a2a2a; font-size: 13px; }
.sync-dev span:first-child { flex: 1; min-width: 160px; }
.link-box { text-align: center; }
#link-qr { width: 220px; height: 220px; margin: 8px auto; background: #fff; border-radius: 6px; }
#link-qr svg { width: 100%; height: 100%; display: block; }
.link-code { font-family: Consolas, monospace; font-size: 22px; letter-spacing: 2px; color: #e5c07b; background: #111; border: 1px solid #333; border-radius: 6px; padding: 8px 12px; display: inline-block; user-select: all; margin: 4px 0; }
#link-url { word-break: break-all; }

/* =====================================================================
   SETTINGS — big, clear, one topic at a time
   ===================================================================== */
:is(#settings-modal, #share-modal) .set-box { width: min(620px, calc(100vw - 24px)); max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 0 0 18px; text-align: left; font-size: 15px; }
.set-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "back x" "title title"; align-items: center; gap: 10px; padding: 12px 16px; background: #252525; border-bottom: 1px solid #383838; }
.set-head.home { grid-template-areas: "title x"; }
.set-head.home .set-back { display: none; }
.set-head h2 { grid-area: title; margin: 0; font-size: 20px; font-weight: 700; color: #fff; line-height: 1.3; }
.set-head .set-back { grid-area: back; }
.set-head .set-x { grid-area: x; }
:is(#settings-modal, #share-modal) .set-back { justify-self: start; width: auto; margin: 0; background: #2f3a46; color: #cfe6ff; border: 1px solid #45586c; border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
:is(#settings-modal, #share-modal) .set-back:hover { background: #3a4a5a; }
:is(#settings-modal, #share-modal) .set-x { justify-self: end; width: 40px; height: 40px; margin: 0; border-radius: 50%; background: #333; color: #ddd; border: 1px solid #444; font-size: 16px; cursor: pointer; padding: 0; }
:is(#settings-modal, #share-modal) .set-x:hover { background: #444; color: #fff; }
.set-home, .set-page { padding: 14px 16px 4px; }
#set-close { margin: 14px 16px 0; width: calc(100% - 32px); }

/* Message line under the header */
.set-msg { display: none; margin: 12px 16px 0; padding: 10px 14px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.set-msg.show { display: block; background: #2a2a2a; color: #ddd; }
.set-msg.show.ok { background: #1f3324; color: #b5e3a8; border: 1px solid #3c6b42; }
.set-msg.show.err { background: #3a2224; color: #f2b8bd; border: 1px solid #7a3a40; }

/* Tiles on the first page */
:is(#settings-modal, #share-modal) .set-tile { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #2b2b2b; border: 1px solid #3a3a3a; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; color: #eee; font-weight: normal; }
:is(#settings-modal, #share-modal) .set-tile:hover { background: #333a42; border-color: #4d6177; }
:is(#settings-modal, #share-modal) .set-tile-icon { font-size: 28px; width: 40px; text-align: center; flex: none; }
:is(#settings-modal, #share-modal) .set-tile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
:is(#settings-modal, #share-modal) .set-tile-title { font-size: 17px; font-weight: 700; color: #fff; }
:is(#settings-modal, #share-modal) .set-tile-status { font-size: 14px; display: flex; align-items: center; gap: 7px; color: #aaa; overflow: hidden; text-overflow: ellipsis; }
:is(#settings-modal, #share-modal) .set-tile-go { font-size: 30px; color: #777; flex: none; line-height: 1; }
.set-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #777; }
:is(#settings-modal, #share-modal) .set-tile-status.set-ok { color: #98c379; } .set-tile-status.set-ok .set-dot { background: #98c379; }
:is(#settings-modal, #share-modal) .set-tile-status.set-warn { color: #e5c07b; } .set-tile-status.set-warn .set-dot { background: #e5c07b; }
:is(#settings-modal, #share-modal) .set-tile-status.set-off .set-dot { background: transparent; border: 2px solid #888; width: 8px; height: 8px; }
:is(#settings-modal, #share-modal) .set-tile-status.set-info .set-dot { background: #61afef; }

/* The coloured status box at the top of each page */
.set-banner { display: flex; align-items: center; gap: 14px; border-radius: 12px; padding: 14px 16px; margin: 4px 0 14px; border: 1px solid; }
.set-banner-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; flex: none; }
.set-banner-title { font-size: 17px; font-weight: 700; }
.set-banner-sub { font-size: 14px; margin-top: 3px; opacity: .9; line-height: 1.4; }
.set-banner.set-ok { background: #1f3324; border-color: #3c6b42; color: #cdeec4; } .set-ok .set-banner-icon { background: #98c379; color: #142016; }
.set-banner.set-off { background: #2a2a2a; border-color: #444; color: #ddd; } .set-off .set-banner-icon { background: transparent; border: 3px solid #888; color: transparent; width: 30px; height: 30px; }
.set-banner.set-warn { background: #3a3120; border-color: #7a6436; color: #f3dfb0; } .set-warn .set-banner-icon { background: #e5c07b; color: #2a2010; }
.set-banner.set-info { background: #1e2a36; border-color: #3d5670; color: #cfe3f7; } .set-info .set-banner-icon { background: #61afef; color: #0f1a24; font-style: italic; font-family: Georgia, serif; }

.set-text { font-size: 15px; line-height: 1.55; color: #ccc; margin: 0 0 12px; }
.set-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #8fa3b8; margin: 20px 0 10px; font-weight: 700; }

/* Big buttons */
.set-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
:is(#settings-modal, #share-modal) .set-btn { width: auto; min-height: 48px; padding: 10px 18px; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer; border: 1px solid #4a4a4a; background: #353535; color: #eee; }
:is(#settings-modal, #share-modal) .set-btn:hover { background: #404040; }
:is(#settings-modal, #share-modal) .set-btn:disabled { opacity: .6; cursor: default; }
:is(#settings-modal, #share-modal) .set-btn-primary { background: #2f7de1; border-color: #4b93ef; color: #fff; }
:is(#settings-modal, #share-modal) .set-btn-primary:hover { background: #3b8bf0; }
:is(#settings-modal, #share-modal) .set-btn-danger { background: #8a2f36; border-color: #a8434b; color: #fff; }
:is(#settings-modal, #share-modal) .set-btn-quiet { background: transparent; border-color: #555; color: #bbb; font-weight: 600; }
:is(#settings-modal, #share-modal) .set-btn-quiet:hover { background: #2c2c2c; color: #fff; }
:is(#settings-modal, #share-modal) .set-btn-small { min-height: 36px; padding: 5px 14px; font-size: 14px; width: auto; flex: none; }

/* "Which is this?" choices */
.set-choice { display: flex; gap: 14px; align-items: flex-start; background: #262c33; border: 1px solid #3b4856; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.set-choice-icon { font-size: 30px; flex: none; width: 40px; text-align: center; }
.set-choice-body { flex: 1; min-width: 0; }
.set-choice-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.set-choice-text { font-size: 14px; color: #bbb; line-height: 1.45; margin-bottom: 12px; }

/* Numbered steps */
.set-steps { list-style: none; counter-reset: s; margin: 0 0 12px; padding: 0; }
.set-steps li { counter-increment: s; position: relative; padding: 4px 0 12px 46px; font-size: 15px; line-height: 1.55; color: #ddd; min-height: 34px; }
.set-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: #2f7de1; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 16px; }

/* Time choices */
.set-select-row { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.set-select-label { font-size: 15px; color: #ddd; font-weight: 600; }
.set-select { font-size: 16px; padding: 10px 12px; border-radius: 10px; background: #1b1b1b; color: #fff; border: 1px solid #555; max-width: 100%; }

/* Devices */
.sync-devices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sync-dev { display: flex; align-items: center; gap: 12px; background: #2a2a2a; border: 1px solid #3a3a3a; border-radius: 10px; padding: 10px 12px; border-bottom: 1px solid #3a3a3a; }
.sync-dev.current { border-color: #3c6b42; background: #223024; }
.sync-dev-icon { font-size: 24px; flex: none; }
.sync-dev-info { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.sync-dev-name { font-size: 15px; font-weight: 700; color: #fff; }
.sync-dev-seen { font-size: 13px; color: #aaa; }

/* Phone topic + background swatches, bigger */
:is(#settings-modal, #share-modal) .phone-topic { font-size: 15px; padding: 4px 8px; display: inline-block; margin-top: 4px; }
:is(#settings-modal, #share-modal) .nbg-swatch { width: 84px; height: 54px; border-radius: 10px; }
:is(#settings-modal, #share-modal) .nbg-swatch span { font-size: 12px; }
:is(#settings-modal, #share-modal) .nbg-scope { font-size: 15px; margin: 4px 0 12px; gap: 22px; }
:is(#settings-modal, #share-modal) .nbg-scope input { width: 18px; height: 18px; }
:is(#settings-modal, #share-modal) .sb-btn { min-height: 42px; font-size: 15px; padding: 8px 16px; border-radius: 10px; }

/* "Add another device" box */
.link-step { display: flex; gap: 12px; align-items: flex-start; text-align: left; font-size: 15px; line-height: 1.5; margin: 12px 0 6px; color: #ddd; }
.link-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #2f7de1; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }

@media (max-width: 480px) {
    .set-head h2 { font-size: 18px; }
    .set-choice { flex-direction: column; gap: 6px; }
    :is(#settings-modal, #share-modal) .set-buttons .set-btn { width: 100%; }
}

/* Sharing */
.tl-shared { font-size: 12px; margin-left: 4px; opacity: .9; }
.set-input { font-size: 16px; padding: 10px 12px; border-radius: 10px; background: #1b1b1b; color: #fff; border: 1px solid #555; width: 100%; box-sizing: border-box; }
.share-link { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #1b1b1b; border: 1px solid #444; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.share-link-text { flex: 1; min-width: 200px; word-break: break-all; font-size: 14px; color: #e5c07b; user-select: all; }
.share-qr { width: 200px; height: 200px; margin: 6px 0 12px; background: #fff; border-radius: 8px; }
.share-qr svg { width: 100%; height: 100%; display: block; }
.share-code { font-size: 20px; }

/* 💬 Send feedback */
.fb-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 6px; }
.fb-kind { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 92px; padding: 12px 10px; border-radius: 12px; background: #262c33; border: 2px solid #3b4856; color: #eee; font-size: 16px; font-weight: 700; cursor: pointer; text-align: center; }
.fb-kind:hover { border-color: #5a6c80; }
.fb-kind.on { background: #1f3a5c; border-color: #4b93ef; color: #fff; }
.fb-kind-icon { font-size: 28px; line-height: 1; }
.fb-text { min-height: 130px; resize: vertical; font-family: inherit; line-height: 1.4; }

/* 🔒 When to ask for the password */
.ask-choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.ask-choice { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 12px; background: #262c33; border: 2px solid #3b4856; color: #eee; cursor: pointer; width: 100%; }
.ask-choice:hover { border-color: #5a6c80; }
.ask-choice.on { background: #1f3a5c; border-color: #4b93ef; }
.ask-icon { font-size: 26px; line-height: 1; }
.ask-body { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.ask-title { font-size: 17px; font-weight: 700; }
.ask-text { font-size: 14px; color: #c3cad3; line-height: 1.35; }
.ask-tick { font-size: 22px; font-weight: 800; color: #8ec5ff; min-width: 22px; text-align: center; }

/* 🧮 Calculator */
/* Sits beside the note (wide screens) or along the bottom (phones / the side panel) — the note stays in view and can still be typed in */
.calc-pane { display: none; }
/* The dock (dock.js): the column beside the note holding the calculator / emotes / AI — pinned ones stacked */
#dock { display: none; order: 99; flex: 0 0 360px; width: 360px; min-height: 0; flex-direction: column; overflow-y: auto; background: #23262b; }
#dock.on { display: flex; }
#dock > * + * { border-top: 1px solid #3a3f47; }
.calc-head h3 { flex: 1; min-width: 0; }
.calc-head .calc-x + .calc-x { margin-left: 6px; }
.dock-pin { font-size: 16px; filter: grayscale(1); opacity: .55; }
.dock-pin:hover { opacity: .9; }
.dock-pin.on { filter: none; opacity: 1; background: #4a3f22; border-color: #e5c07b; }
body.calc-open .calc-pane { display: block; flex: none; background: #23262b; border-left: 2px solid #98c379; }
.calc-box { padding: 14px; box-sizing: border-box; outline: none; }
body.calc-open #calc-open { background: #2b4a2f; }
.calc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calc-head h3 { margin: 0; font-size: 19px; color: #fff; }
.calc-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #555; background: #333; color: #eee; font-size: 18px; cursor: pointer; }
.calc-x:hover { background: #444; }
.calc-screen { background: #121417; border: 1px solid #333840; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; text-align: right; min-height: 82px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.calc-sum { color: #9aa3ad; font-size: 17px; min-height: 22px; word-break: break-all; line-height: 1.3; }
.calc-answer { color: #fff; font-size: 42px; font-weight: 700; line-height: 1.15; word-break: break-all; font-variant-numeric: tabular-nums; }
.calc-answer.calc-error { color: #f0a8a2; font-size: 22px !important; font-weight: 600; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calc-key { height: 60px; border-radius: 12px; border: 1px solid #454b54; background: #353a42; color: #fff; font-size: 26px; font-weight: 600; cursor: pointer; font-family: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.calc-key:hover { background: #3f454e; }
.calc-key:active, .calc-key.pressed { transform: scale(.96); filter: brightness(1.25); }
.calc-fn { background: #2b3036; color: #cfd6de; font-size: 22px; }
.calc-op { background: #3d4f66; border-color: #55708f; color: #dcecff; font-size: 30px; }
.calc-eq { background: #2f7de1; border-color: #4b93ef; color: #fff; font-size: 30px; }
.calc-eq:hover { background: #3b8bf0; }
.calc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.calc-act { min-height: 48px; border-radius: 10px; border: 1px solid #4a4f57; background: #30353c; color: #eee; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.calc-act:hover:not(:disabled) { background: #3a4048; }
.calc-act:disabled { opacity: .45; cursor: default; }
#calc-insert:not(:disabled) { background: #2b4a2f; border-color: #4f8a56; color: #d4f5d0; }
.calc-msg { color: #e5c07b; font-size: 14px; margin-top: 8px; min-height: 0; }
.calc-msg:empty { display: none; }
.calc-hist-title { color: #8fa3b8; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px; }
.calc-hist-row { display: flex; justify-content: space-between; gap: 10px; width: 100%; background: transparent; border: none; border-top: 1px solid #333840; color: #ddd; padding: 8px 4px; font-size: 15px; cursor: pointer; text-align: left; font-family: inherit; }
.calc-hist-row:hover { background: #2b2f35; }
.calc-hist-sum { color: #9aa3ad; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-hist-ans { font-weight: 700; white-space: nowrap; }
@media (max-width: 700px) {
  #dock.on { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 75vh; box-shadow: 0 -8px 24px rgba(0,0,0,.5); z-index: 80; padding-bottom: env(safe-area-inset-bottom); }
  body.dock-on #main { margin-bottom: var(--dock-h, 0px); }
  body.calc-open .calc-pane { border-left: none; border-top: 2px solid #98c379; }
  .calc-box { padding: 8px 10px 10px; max-width: 480px; margin: 0 auto; }
  .calc-head { margin-bottom: 6px; }
  .calc-head h3 { font-size: 15px; }
  .calc-x { width: 36px; height: 36px; font-size: 16px; }
  .calc-screen { min-height: 0; padding: 6px 12px; margin-bottom: 8px; }
  .calc-sum { font-size: 14px; min-height: 18px; }
  .calc-answer { font-size: 30px; }
  .calc-keys { gap: 6px; }
  .calc-key { height: 48px; font-size: 22px; }
  .calc-op, .calc-eq { font-size: 26px; }
  .calc-actions { margin-top: 8px; gap: 6px; }
  .calc-act { min-height: 44px; }
  #calc-history-wrap { display: none !important; }
}

/* 😀 Emotes — beside the note on wide screens, along the bottom on phones (like the calculator) */
.emote-pane { display: none; }
body.emote-open .emote-pane { display: flex; flex-direction: column; flex: 1 0 380px; min-height: 380px; background: #23262b; border-left: 2px solid #e5c07b; }
body.emote-open #emote-open { background: #4a3f22; }
.emote-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 12px 12px 8px; box-sizing: border-box; gap: 8px; }
.emote-wrap .calc-head { margin-bottom: 0; }
.emote-search { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 15px; border-radius: 8px; border: 1px solid #4a5260; background: #1b1d21; color: #eee; }
.emote-search:focus { outline: none; border-color: #e5c07b; }
.emote-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.emote-tabs.dim { opacity: .5; }
.emote-tab { background: none; border: none; font-size: 20px; padding: 4px 5px; border-radius: 6px; cursor: pointer; line-height: 1; }
.emote-tab:hover { background: #33404d; }
.emote-skins { display: flex; align-items: center; gap: 2px; font-size: 12px; color: #9aa3ad; }
.emote-skins span { margin-right: 4px; }
.emote-skin { background: none; border: 2px solid transparent; border-radius: 6px; font-size: 18px; padding: 1px 3px; cursor: pointer; line-height: 1.1; }
.emote-skin.on { border-color: #e5c07b; }
.emote-list { flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; }
.emote-sec-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: space-between; position: sticky; top: 0; background: #23262b; z-index: 1; padding: 6px 2px 4px; font-size: 12px; font-weight: 600; color: #b8c4d0; }
.emote-mine-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.emote-tool { background: #2c323a; border: 1px solid #4a5260; color: #ddd; font-size: 12px; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-weight: 400; }
.emote-tool:hover, .emote-tool.on { border-color: #e5c07b; color: #fff; }
.emote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; margin-bottom: 8px; }
.emote-b { height: 40px; background: none; border: 2px solid transparent; border-radius: 8px; font-size: 26px; line-height: 1; cursor: pointer; padding: 0; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; display: flex; align-items: center; justify-content: center; flex-direction: column; overflow: hidden; }
.emote-b:hover { background: #33404d; }
.emote-b img { max-width: 32px; max-height: 32px; }
.emote-b.manage { height: 56px; border-color: #4a5260; }
.emote-mine-name { font-size: 9px; color: #b8c4d0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; }
.emote-choose .emote-b { opacity: .35; }
.emote-choose .emote-b.on { opacity: 1; border-color: #98c379; }
.emote-b:disabled { cursor: default; }
.emote-none, .emote-wait { grid-column: 1 / -1; color: #9aa3ad; font-size: 13px; padding: 8px 4px; line-height: 1.45; }
.emote-foot { font-size: 12px; color: #9aa3ad; min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid #333a42; padding-top: 6px; }
.emote-box2 { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.emote-box2[hidden], .emote-list[hidden] { display: none; }
.emote-box2-h { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.emote-note { font-size: 13px; color: #b8c4d0; line-height: 1.45; }
.emote-note.bad, .emote-msg.bad { color: #e06c75; }
.emote-msg { font-size: 13px; color: #b8c4d0; }
.emote-lab { font-size: 12px; color: #9aa3ad; margin-top: 4px; }
.emote-input { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 15px; border-radius: 8px; border: 1px solid #4a5260; background: #1b1d21; color: #eee; }
.emote-linkbox { font-size: 13px; }
.emote-row { display: flex; flex-wrap: wrap; gap: 8px; }
.emote-act { min-height: 42px; padding: 8px 14px; border-radius: 8px; border: 1px solid #4a5260; background: #2c323a; color: #eee; font-size: 14px; cursor: pointer; }
.emote-act.ok { border-color: #98c379; background: #2b3a2c; }
.emote-act.bad { border-color: #e06c75; background: #3a2b2d; }
.emote-act:disabled { opacity: .5; cursor: default; }
.emote-big { width: 72px; height: 72px; object-fit: contain; }
.emote-linkrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: #b8c4d0; }
/* in the note */
#editor .tb img.emote { height: 1.6em; width: auto; max-width: 5em; vertical-align: -0.4em; margin: 0 1px; cursor: pointer; }
.emote-pop { display: none; position: fixed; z-index: 2000; background: #22262c; border: 1px solid #4a5260; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); padding: 4px; min-width: 200px; max-width: min(360px, calc(100vw - 8px)); font-size: 14px; color: #ddd; }
.emote-pop-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 5px; cursor: pointer; }
.emote-pop-row.on, .emote-pop-row:hover { background: #33404d; }
.emote-pop-row img { width: 22px; height: 22px; object-fit: contain; }
.emote-pop-ch { font-size: 20px; width: 22px; text-align: center; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.emote-pop-code { color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emote-pop-tag { margin-left: auto; font-size: 10px; color: #e5c07b; border: 1px solid #e5c07b; border-radius: 4px; padding: 0 4px; }
.emote-pop-tip { font-size: 11px; color: #7f8a96; padding: 4px 8px 2px; }
.emote-card { position: fixed; z-index: 2000; background: #22262c; border: 1px solid #4a5260; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.5); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 240px; }
.emote-card-name { font-size: 14px; color: #eee; }
@media (max-width: 700px) {
  body.emote-open .emote-pane { flex: none; height: 50vh; min-height: 0; border-left: none; border-top: 2px solid #e5c07b; }
  .emote-wrap { padding: 8px 10px; gap: 6px; }
  .emote-wrap .calc-head h3 { font-size: 15px; }
  .emote-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .emote-b { height: 44px; font-size: 28px; }
  .emote-foot { white-space: normal; }
  .emote-foot:not(.said) { display: none; }
}

/* ✨ AI helper — beside the note on wide screens, along the bottom on phones (like the calculator) */
.ai-pane { display: none; }
body.ai-open .ai-pane { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 0; background: #23262b; border-left: 2px solid #c678dd; }
body.ai-open #ai-open { background: #3e2a48; }
.ai-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 12px 12px 10px; box-sizing: border-box; gap: 8px; }
.ai-wrap .calc-head { margin-bottom: 0; }
.ai-wrap .calc-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ai-intro { margin: 0; color: #ccc; font-size: 15px; line-height: 1.5; }
.ai-big { min-height: 52px; border-radius: 12px; font-size: 17px; font-weight: 700; cursor: pointer; font-family: inherit; border: 1px solid #a35cbf; background: #7d3c98; color: #fff; }
.ai-big:hover { background: #8e48aa; }
.ai-src { font-size: 13px; color: #c9b3d6; background: #2c2533; border: 1px solid #4a3a55; border-radius: 8px; padding: 7px 10px; line-height: 1.35; }
.ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ai-act { min-height: 44px; border-radius: 10px; border: 1px solid #4a4f57; background: #30353c; color: #eee; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; text-align: left; padding: 6px 10px; }
.ai-act:hover:not(:disabled) { background: #3a4048; border-color: #c678dd; }
.ai-act:disabled, .ai-send:disabled { opacity: .5; cursor: default; }
.ai-translate { grid-column: 1 / -1; display: flex; gap: 6px; }
.ai-translate .ai-act { flex: 0 0 auto; }
.ai-lang { flex: 1; min-width: 0; border-radius: 10px; border: 1px solid #4a4f57; background: #1b1d21; color: #eee; font-size: 14px; padding: 0 8px; }
.ai-ask { display: flex; gap: 6px; align-items: stretch; margin: 0; }
.ai-q { flex: 1; min-width: 0; resize: vertical; min-height: 44px; box-sizing: border-box; padding: 9px 10px; font-size: 15px; font-family: inherit; border-radius: 10px; border: 1px solid #4a5260; background: #1b1d21; color: #eee; }
.ai-q:focus { outline: none; border-color: #c678dd; }
.ai-send { flex: none; min-width: 64px; border-radius: 10px; border: 1px solid #a35cbf; background: #7d3c98; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.ai-out:empty { display: none; }
.ai-out { background: #1b1d21; border: 1px solid #3b4049; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-out-title { font-size: 12px; font-weight: 700; color: #c9b3d6; text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-answer { white-space: pre-wrap; word-wrap: break-word; color: #eee; font-size: 15px; line-height: 1.5; max-height: 45vh; overflow-y: auto; user-select: text; }
.ai-wait { display: flex; align-items: center; gap: 10px; color: #ccc; font-size: 15px; }
.ai-wait .ai-small { margin-left: auto; }
.ai-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #4a3a55; border-top-color: #c678dd; animation: ai-spin .8s linear infinite; flex: none; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-err { color: #f3c1bc; font-size: 14px; line-height: 1.45; }
.ai-note { color: #e5c07b; font-size: 13px; }
.ai-out-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-small { min-height: 38px; padding: 4px 12px; border-radius: 9px; border: 1px solid #4a4f57; background: #30353c; color: #eee; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; }
.ai-small:hover { background: #3a4048; }
.ai-small.ai-primary { background: #7d3c98; border-color: #a35cbf; color: #fff; }
.ai-small.ai-primary:hover { background: #8e48aa; }
.ai-msg { font-size: 14px; color: #e5c07b; line-height: 1.4; }
.ai-msg.ok { color: #98c379; }
.ai-msg:empty { display: none; }
.ai-foot { font-size: 12px; color: #7f8a96; line-height: 1.4; }
.ai-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.ai-pick-b { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 60px; padding: 10px 14px; border-radius: 12px; border: 2px solid #3b4856; background: #262c33; color: #fff; cursor: pointer; font-family: inherit; text-align: left; }
.ai-pick-b:hover { border-color: #c678dd; }
.ai-pick-b.on { border-color: #c678dd; background: #3e2a48; }
.ai-pick-name { font-size: 18px; font-weight: 700; }
.ai-pick-by { font-size: 13px; color: #bbb; }
:is(#set-ai, #set-cloud) .set-steps a { color: #8ec5ff; }
#ai-key { margin-bottom: 4px; }
@media (max-width: 700px) {
  body.ai-open .ai-pane { flex: none; max-height: 60vh; border-left: none; border-top: 2px solid #c678dd; }
  .ai-wrap { padding: 8px 10px; gap: 6px; }
  .ai-wrap .calc-head h3 { font-size: 15px; }
  .ai-act { min-height: 40px; font-size: 13px; }
  .ai-answer { max-height: 28vh; }
  .ai-foot { display: none; }
}

/* 🧮 the scientific keys: under the main ones, smaller */
.calc-sci { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.calc-key.calc-sk { height: 38px; font-size: 16px; font-weight: 600; border-radius: 9px; background: #2b3036; color: #cfd6de; border-color: #3d434b; font-family: "Cambria Math", "STIX Two Math", Georgia, serif; }
.calc-key.calc-sk:hover { background: #353b43; }
@media (max-width: 700px) {
  .calc-sci { grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 6px; }
  .calc-key.calc-sk, #dock.multi .calc-sk { height: 30px; font-size: 14px; border-radius: 7px; padding: 0; }
}

/* More than one pane in the dock: the calculator gets more compact, so they all fit better */
#dock.multi .calc-box { padding: 10px 12px; }
#dock.multi .calc-head { margin-bottom: 6px; }
#dock.multi .calc-screen { min-height: 0; padding: 6px 12px; margin-bottom: 8px; }
#dock.multi .calc-answer { font-size: 30px; }
#dock.multi .calc-keys { gap: 6px; }
#dock.multi .calc-key:not(.calc-sk) { height: 44px; font-size: 21px; }
#dock.multi .calc-sk { height: 32px; font-size: 15px; }
#dock.multi .calc-actions { margin-top: 8px; }
#dock.multi .calc-act { min-height: 40px; }
#dock.multi #calc-history-wrap { display: none !important; }
#dock.multi .emote-list { min-height: 160px; }
@media (max-width: 700px) {
  #dock.multi.on { max-height: 65vh; }
  #dock.multi .emote-pane { height: 34vh; }
}
.ai-plans { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.ai-plan { background: #262c33; border: 1px solid #3b4856; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #ccc; line-height: 1.45; display: flex; flex-direction: column; gap: 2px; }
.ai-plan b { color: #fff; font-size: 15px; }

/* 💬 Chat beside a shared group (in the dock) */
.chat-pane { display: none; }
body.chat-open .chat-pane { display: flex; flex-direction: column; flex: 1 0 420px; min-height: 420px; background: #23262b; border-left: 2px solid #61afef; }
body.chat-open #chat-open { background: #1e3247; }
#chat-open.chat-has-new { background: #2f7de1; color: #fff !important; font-weight: 700; }
.chat-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 12px 12px 8px; box-sizing: border-box; gap: 8px; }
.chat-wrap .calc-head { margin-bottom: 0; }
.chat-wrap .calc-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-body { flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.chat-empty { color: #9aa3ad; font-size: 14px; line-height: 1.5; padding: 10px 4px; }
.chat-day { align-self: center; font-size: 11px; color: #8fa3b8; background: #2b3036; border-radius: 999px; padding: 2px 10px; margin: 6px 0 2px; }
.chat-msg { align-self: flex-start; max-width: 85%; background: #30353c; border: 1px solid #3d434b; border-radius: 12px 12px 12px 4px; padding: 6px 10px; }
.chat-msg.mine { align-self: flex-end; background: #1e3a5c; border-color: #2f5b8c; border-radius: 12px 12px 4px 12px; }
.chat-msg.pending { opacity: .6; }
.chat-head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: #9aa3ad; }
.chat-head b { color: #cfe3f7; font-size: 13px; }
.chat-msg.mine .chat-head b { color: #9fd0ff; }
.chat-text { white-space: pre-wrap; word-wrap: break-word; color: #eee; font-size: 15px; line-height: 1.4; user-select: text; }
.chat-form { display: flex; gap: 6px; margin: 0; }
.chat-input { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 140px; box-sizing: border-box; padding: 9px 10px; font-size: 15px; font-family: inherit; border-radius: 10px; border: 1px solid #4a5260; background: #1b1d21; color: #eee; }
.chat-input:focus { outline: none; border-color: #61afef; }
.chat-send { flex: none; min-width: 64px; border-radius: 10px; border: 1px solid #4b93ef; background: #2f7de1; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.chat-line { font-size: 13px; color: #e5c07b; }
.chat-line:empty { display: none; }
.chat-foot { font-size: 11px; color: #7f8a96; }
@media (max-width: 700px) {
  body.chat-open .chat-pane { flex: none; height: 55vh; min-height: 0; border-left: none; border-top: 2px solid #61afef; }
  #dock.multi .chat-pane { height: 40vh; }
  .chat-wrap { padding: 8px 10px; gap: 6px; }
  .chat-wrap .calc-head h3 { font-size: 15px; }
  .chat-foot { display: none; }
}

/* ☑ To-do list group, always at the top */
.tl-row.tl-todo .tl-todo-icon { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: #98c379; flex: 0 0 auto; }
.tl-row.tl-todo .tl-name { color: #c8f0b8; font-weight: 700; }
#tab-list > .tl-row.tl-todo, #tab-list > .tl-current-group:first-child { border-bottom: 1px solid #3a3f47; margin-bottom: 4px; padding-bottom: 2px; }

/* 👥 Shared groups: easy to spot */
.tl-shared-pill { margin-left: 6px; font-size: 11px; font-weight: 800; color: #0d1a26; background: #61afef; border-radius: 999px; padding: 1px 7px; white-space: nowrap; flex: 0 0 auto; }
.tl-current-group.shared { border-left: 3px solid #61afef; border-radius: 4px; background: rgba(97,175,239,0.06); }
.tl-current-group.shared .tl-row:not(.tl-group) .tl-name::after { content: ' 👥'; font-size: 11px; opacity: .8; }
.crumb-shared { margin-left: auto; display: inline-flex; gap: 6px; flex: 0 1 auto; min-width: 0; }
.crumb-shared-btn { background: #61afef; color: #0d1a26; border: none; border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 800; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; font-family: inherit; }
.crumb-shared-btn:hover { background: #82c1f5; }
.crumb-names-btn { background: transparent; color: #9fd0ff; border: 1px solid #61afef; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: inherit; }
.crumb-names-btn.on { background: #1e3a5c; }

/* Who wrote what (shared groups): names in a strip on the right of the note */
#editor-col { position: relative; }
body.authors-on #editor .tb { padding-right: 96px; }
.authors-layer { position: absolute; right: 8px; width: 88px; pointer-events: none; overflow: hidden; z-index: 3; }
.author-tag { position: absolute; right: 0; max-width: 86px; font-size: 11px; font-weight: 700; line-height: 1.5; padding: 0 6px; border: 1px solid; border-radius: 999px; background: rgba(20,22,26,0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  body.authors-on #editor .tb { padding-right: 70px; }
  .authors-layer { width: 64px; right: 4px; }
  .author-tag { max-width: 62px; font-size: 10px; }
  .crumb-names-btn { display: none; }
  .crumb-shared-btn { font-size: 12px; padding: 3px 9px; }
}
.chat-emo { flex: none; width: 44px; border-radius: 10px; border: 1px solid #4a5260; background: #2b3036; font-size: 22px; cursor: pointer; }
.chat-emo:hover { background: #353b43; }
img.chat-emote { height: 1.8em; width: auto; max-width: 6em; vertical-align: -0.5em; margin: 0 1px; }
.crumb-todo { color: #98c379; font-size: 20px; }
#crumb .crumb-group, #crumb .crumb-tab { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#crumb .crumb-shared { flex: 0 1 auto; min-width: 96px; }
#crumb .crumb-shared-btn { max-width: 100%; min-width: 0; }

/* ☑ To-do: ticked items struck through and faded; a hand over the boxes; the "Add a task" bar */
#editor.todo-hover { cursor: pointer; }
.todo-layer { position: absolute; left: 0; right: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.todo-dim { position: absolute; background: rgba(26,26,26,0.45); }
.todo-strike { position: absolute; height: 2px; background: #98c379; opacity: .85; border-radius: 1px; }
.todo-bar { display: flex; gap: 8px; padding: 10px 18px; background: #23292f; border-bottom: 1px solid #3a3f47; margin: 0; flex-wrap: wrap; }
.todo-bar[hidden] { display: none; }
.todo-add { flex: 1 1 220px; min-width: 0; padding: 10px 12px; font-size: 16px; border-radius: 10px; border: 1px solid #4f8a56; background: #1b1d21; color: #eee; font-family: inherit; }
.todo-add:focus { outline: none; border-color: #98c379; }
.todo-add-btn { padding: 0 18px; min-height: 42px; border-radius: 10px; border: 1px solid #4f8a56; background: #2b4a2f; color: #d4f5d0; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.todo-clear-btn { padding: 0 14px; min-height: 42px; border-radius: 10px; border: 1px solid #4a4f57; background: #30353c; color: #ddd; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.todo-clear-btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 700px) { .todo-bar { padding: 8px 10px; } }
.crumb-chat-btn { background: transparent; color: #9fd0ff; border: 1px solid #61afef; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: inherit; }
.crumb-chat-btn.chat-has-new { background: #2f7de1; color: #fff; }
body.chat-open .crumb-chat-btn { background: #1e3a5c; }
/* unread chat messages: a little number on the group in the list */
.tl-chat-new { margin-left: 5px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: #e5534b; color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
/* chat and emote picker together: the chat keeps most of the room */
body.emote-open #dock.multi.on .chat-pane { flex: 1 1 auto; min-height: 300px; }
body.chat-open #dock.multi.on .emote-pane { flex: 0 0 300px; min-height: 300px; }
@media (max-width: 700px) { body.chat-open #dock.multi.on .emote-pane { flex: none; height: 30vh; min-height: 0; } body.emote-open #dock.multi.on .chat-pane { height: 34vh; min-height: 0; } }

/* 🔑 Username and password */
.login-card { background: #262c33; border: 1px solid #3b4856; border-radius: 12px; padding: 14px 16px; margin: 4px 0 14px; }
.login-card[hidden] { display: none; }
.login-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.login-field { display: block; margin: 8px 0; }
.login-label { display: block; font-size: 13px; color: #aab4c0; margin-bottom: 4px; }
.login-note { font-size: 13px; color: #9aa3ad; line-height: 1.45; margin: 6px 0; }
.login-more { background: #22272d; border: 1px solid #3b4856; border-radius: 12px; padding: 10px 16px; margin: 0 0 14px; }
.login-more summary { cursor: pointer; font-weight: 700; color: #cfe3f7; font-size: 15px; padding: 4px 0; }
.login-field .set-input { text-align: left; letter-spacing: normal; font-size: 16px; }
