:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  --bg: #0f1117;
  --panel: #1a1d27;
  --line: #2d3347;
  --text: #e2e8f0;
  --muted: #aab4c7;
  --accent: #00e676;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); }
.top { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .8rem; padding: .45rem clamp(.65rem, 2vw, 1.5rem); border-bottom: 1px solid var(--line); background: #141822; }
.top a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); }
.pad-logo { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; width: 32px; height: 32px; padding: 6px; background: var(--accent); border-radius: 8px; }
.pad-logo i { background: #0c3c28; border-radius: 2px; }
.pad-logo i:first-child { grid-row: span 2; }
.top .toolbar { flex: 1; min-width: min(100%, 23rem); gap: .35rem .55rem; }
.tool-group { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; min-width: 0; }
.top .tool-group label { gap: .35rem; padding-left: .4rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.top .tool-group :is(button, select) { min-height: 34px; padding: .28rem .55rem; font-size: .85rem; }
.top .tool-group button { display: inline-flex; align-items: center; justify-content: center; gap: .36rem; white-space: nowrap; }
.tool-icon { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.top .tool-select { border: 1px solid #333b51; border-radius: 9px; background: #1b2130; }
.top .tool-select:focus-within { border-color: var(--accent); }
.top .tool-select select { border: 0; background: transparent; }
.top .tool-select option { background: var(--panel); }
.top .edit-switch { position: relative; min-height: 34px; padding-inline: .45rem; cursor: pointer; white-space: nowrap; }
.edit-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.edit-switch-track {
  position: relative;
  flex: none;
  width: 2rem;
  height: 1.125rem;
  border: 1px solid #778399;
  border-radius: 999px;
  background: #30394b;
}
.edit-switch-track::before {
  content: "";
  position: absolute;
  inset: 2px auto auto 2px;
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  background: #d8deea;
}
.edit-switch input:checked + .edit-switch-track { border-color: var(--accent); background: var(--accent); }
.edit-switch input:checked + .edit-switch-track::before { transform: translateX(.875rem); background: #102b20; }
.edit-switch input:focus-visible + .edit-switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.top select { color: var(--text); }
#boards { width: clamp(7rem, 17vw, 15rem); }
#views { max-width: 9rem; }
.file-tools { padding: .18rem; background: #1b2130; border-radius: 10px; }
.top .file-tools button:not(.danger) { background: transparent; border-color: transparent; }
.top .file-tools button:hover:not(:disabled) { background: #273249; }
.top #new-board { color: #b9f7d6; background: #17382e; border-color: #295744; }
#share-pad { display: inline-flex; align-items: center; gap: .6rem; margin-inline-start: auto; background: #17382e; color: #c3f8dc; border-color: #397757; text-align: left; line-height: 1.15; }
#share-pad small { display: block; font-size: .7rem; margin-top: .2rem; color: #b4dcc6; }
.share-panel, .share-panel label { display: grid; gap: .65rem; }
.share-panel input { width: 100%; min-width: 0; }
button:disabled { opacity: .5; cursor: default; }
body { --editor-width: min(22rem, 42vw); min-height: 100dvh; display: flex; flex-direction: column; }
body.creating-pad { padding-right: var(--editor-width); }
.canvas-actions {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: 1.25rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
  max-width: calc(100% - 2rem);
}
.canvas-actions button {
  border-radius: 999px;
  padding: .8rem 1.15rem;
  box-shadow: 0 4px 16px #0003;
}
.canvas-zoom { display: flex; align-items: center; border-radius: 999px; background: var(--ink); box-shadow: 0 4px 16px #0003; }
.canvas-zoom button { padding-inline: .65rem; box-shadow: none; font-variant-numeric: tabular-nums; }
.creating-pad .canvas-actions, .editing-map .canvas-actions { display: none; }
.creating-pad :is(#content, #new-post, #status) { display: none; }
.creating-pad #editor {
  position: fixed;
  inset: 0 0 0 auto;
  width: var(--editor-width);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  z-index: 4;
}
.editor-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.creating-pad #edit-form { height: 100%; grid-template-rows: auto minmax(0, 1fr); padding: 0; gap: 0; }
.creating-pad .editor-heading { padding: .5rem .65rem; border-bottom: 1px solid var(--line); }
.creating-pad .editor-heading h2 { font-size: 1rem; }
.creating-pad .editor-fields { overflow-y: auto; overscroll-behavior: contain; padding: .6rem .65rem; gap: .45rem; }
.creating-pad #editor :is(input, textarea, button) { padding: .35rem .5rem; }
.creating-pad #editor label { gap: .25rem; }
.creating-pad #editor textarea { height: 3.5rem; }
.creating-pad .type-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; }
.creating-pad .type-preview { gap: .25rem; padding: .25rem; font-size: .75rem; overflow-wrap: anywhere; }
.creating-pad .background-category { margin: .35rem 0 .2rem; }
.creating-pad .background-options span { min-height: 2.15rem; font-size: .75rem; text-align: center; }
@media (max-width: 680px) {
  body.creating-pad { padding-right: 0; }
  .creating-pad #editor { inset: auto 0 0; width: 100%; height: 58dvh; border-radius: 16px 16px 0 0; }
}
.top strong { letter-spacing: .09em; }
.top strong span { color: var(--accent); }
.top span, .intro p, #status, small { color: var(--muted); }
main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#no-pads { margin: 1rem; }
.toolbar, .actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.toolbar label { display: flex; align-items: center; gap: .6rem; min-width: 0; }
select { max-width: min(60vw, 22rem); text-overflow: ellipsis; }
[data-theme="forest"] { --paper: #d8efe3; --wash: #98c9b2; --ink: #16382c; }
[data-theme="ocean"] { --paper: #dceff9; --wash: #95c6ed; --ink: #163954; }
[data-theme="lavender"] { --paper: #eee7ff; --wash: #c5b3f3; --ink: #38265d; }
[data-theme="dune"] { --paper: #fff1d6; --wash: #eec58b; --ink: #563819; }
[data-theme="coral"] { --paper: #ffe7e0; --wash: #edaeac; --ink: #602b37; }
[data-theme="mosaic"] {
  --paper: #ffe9b7; --wash: #f0bd79; --ink: #512b19;
  --art: conic-gradient(from 45deg, #f4c46a 0 25%, #f9e0a3 0 50%, #e99567 0 75%, #f8d489 0) 0 0 / 92px 92px;
}
[data-theme="confetti"] {
  --paper: #ffe8f1; --wash: #ffe8f1; --ink: #4b2945;
  --art: radial-gradient(circle at 16px 18px, #f29bb6 0 4px, transparent 5px) 0 0 / 64px 64px,
    radial-gradient(circle at 48px 38px, #f4bb67 0 5px, transparent 6px) 0 0 / 64px 64px,
    radial-gradient(circle at 27px 45px, #a99ae3 0 3px, transparent 4px) 0 0 / 64px 64px,
    linear-gradient(#fff3f7, #ffe1ef);
}
[data-theme="tiles"] {
  --paper: #ccefe5; --wash: #b1ded0; --ink: #163c3d;
  --art: radial-gradient(circle at 100% 100%, transparent 49%, #68b7a7 50% 53%, #c2e4d5 54% 62%, transparent 63%) 0 0 / 52px 52px,
    radial-gradient(circle at 0 0, transparent 49%, #7aaabf 50% 53%, #cee8ec 54% 62%, transparent 63%) 0 0 / 52px 52px,
    linear-gradient(120deg, #e4f3d6, #c3e9eb);
}
[data-theme="wood"] {
  --paper: #f5ddbd; --wash: #ddb481; --ink: #52341f;
  --art: repeating-linear-gradient(90deg, transparent 0 119px, #9c633050 120px 121px) 0 0,
    repeating-radial-gradient(ellipse at 10% 80%, #a76f3a21 0 1px, transparent 2px 6px) 0 0 / 190px 1300px,
    linear-gradient(100deg, #f5dfbf, #e9c49a 49%, #f4d9ad);
}
[data-theme="paper"] {
  --paper: #fff8e8; --wash: #eddec5; --ink: #483929;
  --art: linear-gradient(90deg, transparent 0 28px, #dc96987a 29px 30px, transparent 31px),
    repeating-linear-gradient(0deg, transparent 0 24px, #93a9bb58 25px 26px),
    linear-gradient(125deg, #fff9ec, #f2e4ca);
}
[data-theme="shore"] {
  --paper: #fdf0d1; --wash: #b9e7e6; --ink: #203e49;
  --art: radial-gradient(circle at 76% 21%, #fff1bd 0 3%, transparent 3.3%),
    radial-gradient(ellipse 110% 48% at 27% 107%, #e8be8c 0 80%, #fff8e4 81% 83%, #9fdad3 84% 90%, transparent 91%),
    linear-gradient(#f6c7be 0%, #fce8c4 34%, #acd6db 35%, #76c0c2 71%, #c6e7d8);
}
[data-theme="cork"] {
  --paper: #e2b584; --wash: #bb8356; --ink: #412b20;
  --art: radial-gradient(ellipse at 3px 5px, #80512e75 0 1px, transparent 2px) 0 0 / 11px 9px,
    radial-gradient(ellipse at 9px 12px, #a66b48 0 1px, transparent 2.5px) 2px 1px / 17px 15px,
    radial-gradient(ellipse at 5px 2px, #f3c994 0 1px, transparent 3px) 0 0 / 13px 7px,
    linear-gradient(125deg, #eac194, #c38b60);
}
[data-theme="metal"] {
  --paper: #dbe2e9; --wash: #b1becb; --ink: #263a49;
  --art: repeating-linear-gradient(0deg, #52657b18 0 1px, transparent 1px 3px, #fff5 3px 4px) 0 0,
    linear-gradient(110deg, #a5b3c4, #f2f5f7 36%, #aebccc 68%, #dde5ed);
}
[data-theme="doodles"] {
  --paper: #fff1d8; --wash: #ffe5dc; --ink: #483243;
  --art: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMjAiIGhlaWdodD0iMTYwIiB2aWV3Qm94PSIwIDAgMjIwIDE2MCI+CiAgPGcgc3Ryb2tlLXdpZHRoPSIyLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+CiAgICA8cGF0aCBkPSJtMzcgMTUgNSAxMCAxMiAyLTkgOCAyIDExLTEwLTUtMTAgNSAyLTExLTktOCAxMi0yeiIgZmlsbD0iI2ZmZGI3OSIgc3Ryb2tlPSIjZDg5YTQ3Ii8+CiAgICA8cGF0aCBkPSJNMTEyIDEyMmMtNS05LTE4LTQtMTMgNmwxMyAxMiAxMy0xMmM1LTEwLTgtMTUtMTMtNnoiIGZpbGw9IiNmZmM1Y2QiIHN0cm9rZT0iI2NlNzg4ZCIvPgogICAgPHBhdGggZD0iTTE1OCA0NGEyMiAyMiAwIDAgMSA0NCAwbS0zNiAwYTE0IDE0IDAgMCAxIDI4IDBtLTIwIDBhNiA2IDAgMCAxIDEyIDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2I1OGFkNCIvPgogICAgPHBhdGggZD0iTTMyIDExM2MtMTIgMC0xMi0xNS0xLTE1IDEtMTQgMjEtMTUgMjMtMSAxNC0zIDE4IDE2IDQgMTZ6IiBmaWxsPSIjYzNlNmZjIiBzdHJva2U9IiM3YWFhYzQiLz4KICAgIDxwYXRoIGQ9Im0xNjcgMTExIDE1LTE2IDE4IDEwLTE3IDE2eiIgZmlsbD0iI2JkZThjOCIgc3Ryb2tlPSIjNzZhZDkwIi8+CiAgICA8cGF0aCBkPSJtOTEgNDQgNCA1IDctNG00MyAzMiA0IDUgNy00bTQxIDU4IDQgNSA3LTRtLTE5MSAwIDQgNSA3LTQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RmYWE3NiIvPgogICAgPGNpcmNsZSBjeD0iMTE4IiBjeT0iMjIiIHI9IjMiIGZpbGw9IiM5YWNlYmEiLz4KICAgIDxjaXJjbGUgY3g9Ijc1IiBjeT0iNzUiIHI9IjMiIGZpbGw9IiNlOWE0YWYiLz4KICA8L2c+Cjwvc3ZnPgo=") repeat 0 0 / 220px 160px #fff3df;
}
[data-theme="graph"] {
  --paper: #f2f9ff; --wash: #daeaf9; --ink: #243d54;
  --art: linear-gradient(#6c9fbe44 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, #6c9fbe44 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(120deg, #fbfeff, #deedf9);
}
[data-theme="chalk"] {
  --paper: #a6c4af; --wash: #8db09f; --ink: #163e31;
  --art: repeating-linear-gradient(155deg, transparent 0 19px, #e7f5e726 20px, transparent 25px 37px),
    radial-gradient(ellipse at top left, #c9dbbf, #88b09c);
}
[data-theme="mist"] { --paper: #dee3ef; --wash: #c1c9dd; --ink: #28344e; --art: linear-gradient(150deg, #f1f4fa, var(--wash)); }
[data-theme="clay"] { --paper: #f5e4db; --wash: #d7ab98; --ink: #54372e; --art: linear-gradient(135deg, #f7eee8, var(--wash)); }
[data-theme="sage"] { --paper: #dce7d8; --wash: #b6c9af; --ink: #2b4538; --art: var(--paper); }
[data-theme="ice"] { --paper: #e4f2f7; --wash: #b8dbe8; --ink: #233e54; --art: radial-gradient(ellipse at top left, #f3fbff, var(--wash)); }
[data-theme="pearl"] { --paper: #f3eee8; --wash: #e1d9ee; --ink: #45384e; --art: linear-gradient(135deg, #fff8ed, var(--wash)); }
[data-theme="orbit"] {
  --paper: #202943; --ink: #22334d;
  --art: radial-gradient(circle at 76% 22%, #eee4ff 0 1px, transparent 2px),
    radial-gradient(circle at 13% 30%, #fff 0 1px, transparent 2px),
    radial-gradient(ellipse at 61% 115%, #1f385c 0 29%, #79bce3 30%, #b4dafa 31%, transparent 32%),
    linear-gradient(152deg, #080e1e, #283459);
}
[data-theme="galaxy"] {
  --paper: #312347; --ink: #40264d;
  --art: radial-gradient(circle at 35% 26%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 72% 60%, #f9eaff 0 1px, transparent 2px),
    radial-gradient(ellipse at 52% 46%, #f2cbdc, transparent 17%),
    radial-gradient(ellipse at 47% 63%, #c77ba2, transparent 34%),
    radial-gradient(ellipse at 64% 45%, #6166ae, transparent 52%),
    linear-gradient(130deg, #13122c, #321e49);
}
[data-theme="aurora"] {
  --paper: #183a45; --ink: #173d37;
  --art: radial-gradient(ellipse 80% 30% at 52% 9%, #6ce6b4, transparent 72%),
    radial-gradient(ellipse 65% 40% at 69% 35%, #448ba2, transparent 74%),
    linear-gradient(155deg, #101832, #123b41 70%, #122433);
}
[data-theme="graphite"] { --paper: #303742; --ink: #2b3441; --art: linear-gradient(145deg, #161a20, #444e5c); }
[data-theme="savanna"] {
  --paper: #f1d4ab; --ink: #583a28;
  --art: radial-gradient(circle at 74% 32%, #fff0af 0 7%, transparent 7.5%),
    radial-gradient(ellipse 85% 50% at 13% 125%, #855540 0 98%, transparent 100%),
    radial-gradient(ellipse 85% 50% at 90% 120%, #b17a4f 0 98%, transparent 100%),
    linear-gradient(#e6a287, #f6c792 64%, #d39c6b);
}
[data-theme="woodland"] {
  --paper: #bbd2c5; --ink: #1e4238;
  --art: radial-gradient(ellipse 78% 52% at 5% 126%, #204b40 0 98%, transparent 100%),
    radial-gradient(ellipse 83% 53% at 95% 123%, #416d5e 0 98%, transparent 100%),
    radial-gradient(ellipse 68% 52% at 39% 115%, #79a291 0 98%, transparent 100%),
    linear-gradient(#dfebdf, #90b3a7);
}
[data-theme="deep"] {
  --paper: #17536b; --ink: #184356;
  --art: radial-gradient(ellipse at 54% -10%, #a3e7d9, transparent 58%), linear-gradient(#246c87, #091c35);
}
[data-theme="volcano"] {
  --paper: #422b3d; --ink: #533141;
  --art: radial-gradient(ellipse 65% 52% at 60% 119%, #281d31 0 98%, transparent 100%),
    radial-gradient(ellipse at 61% 69%, #f08b6b, transparent 46%), linear-gradient(#211d39, #613749);
}
.background-options :is([data-theme="orbit"], [data-theme="galaxy"], [data-theme="aurora"], [data-theme="graphite"], [data-theme="deep"], [data-theme="volcano"]) {
  color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 8px #000;
}
.board-surface {
  --panel: #fffdf9;
  --line: #0003;
  --muted: var(--ink);
  color: var(--ink);
  flex: 1;
  min-width: 0;
  padding: clamp(.75rem, 1.6vw, 1.35rem);
  padding-bottom: 5rem;
  background: var(--art,
    radial-gradient(circle, #0002 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(135deg, var(--paper) 12%, var(--wash)));
}
.pad-heading {
  width: fit-content;
  max-width: min(100%, 64ch);
  background: #fffdf9ed;
  border-radius: 10px;
  padding: .45rem .7rem;
  box-shadow: 0 4px 14px #17233426;
}
.board-surface .primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.board-surface .primary:hover { filter: brightness(1.2); }
.canvas-zoom .primary { background: transparent; border-color: transparent; box-shadow: none; }
.canvas-zoom .primary:hover:not(:disabled) { background: #ffffff26; filter: none; }
.canvas-zoom .primary:focus-visible { outline-color: #fff; outline-offset: -3px; }
.board-surface :focus-visible { outline-color: var(--ink); }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.15rem, 1.7vw, 1.55rem); line-height: 1.2; }
#edit-pad { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; overflow-wrap: anywhere; }
.edit-pad-icon { display: inline-block; margin-inline-start: .45em; font-size: .75em; }
.intro p { margin-top: .2rem; font-size: .85rem; }
.intro p:empty { display: none; }
button, input, textarea, select { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; }
button { cursor: pointer; }
.danger, .danger:hover { color: #ffc0b8; border-color: #b15c54; }
.danger:hover { background: #472525; }
#delete-status:empty { display: none; }
button:hover, button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.primary, .primary:hover { background: var(--accent); color: #092218; border-color: var(--accent); font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#status:not(:empty) {
  position: fixed;
  inset: auto auto 1.25rem 1rem;
  z-index: 3;
  max-width: min(60vw, 28rem);
  padding: .55rem .75rem;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 4px 14px #0003;
}
#content { margin-top: .8rem; }
.wall { columns: 16rem; column-gap: 1rem; }
.wall article { break-inside: avoid; margin-bottom: 1rem; }
article, .lane, .empty, .map { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; min-width: 0; }
article { border-top: 3px solid var(--ink); box-shadow: 0 2px 5px #1723341a, 0 7px 16px #17233424; }
.pad-card { position: relative; container-type: inline-size; width: var(--card-width, 100%); max-width: 100%; }
.pad-card h3 { font-size: clamp(1rem, calc(.85rem + 1.3cqw), 1.5rem); }
.pad-card p { font-size: clamp(.875rem, calc(.78rem + .8cqw), 1.125rem); }
.pad-card .post-image { width: 100%; height: auto; aspect-ratio: auto; max-height: 26rem; }
.pad-card:has(.resize-card) { padding-bottom: 2rem; }
.resize-card { position: absolute; bottom: .2rem; right: .2rem; padding: 0; width: 1.65rem; height: 1.65rem; cursor: nwse-resize; touch-action: none; }
.wall:has(.pad-card[style*="--card-width"]) { display: flex; flex-wrap: wrap; align-items: start; gap: 1rem; columns: auto; }
.wall:has(.pad-card[style*="--card-width"]) article { width: var(--card-width, 16rem); margin: 0; }
.board-surface .lane { background: transparent; border-color: transparent; }
.lane h2 { width: fit-content; padding: .25rem .55rem; border-radius: 8px; background: var(--panel); box-shadow: 0 3px 10px #17233420; }
article p { margin-top: .5rem; white-space: pre-wrap; }
.post-image { display: block; width: min(100%, 32rem); aspect-ratio: 16 / 10; object-fit: contain; border-radius: 8px; margin-top: .45rem; }
.post-link { display: block; color: inherit; margin-top: .45rem; }
.edit-post { display: block; margin-top: .45rem; padding: .24rem .5rem; font-size: .8rem; }
.image-editor { display: grid; gap: .4rem; }
.image-editor button { justify-self: start; }
article small { display: block; margin-bottom: .4rem; }
.columns { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(13rem, 30%, 20rem); gap: 1rem; align-items: start; overflow-x: auto; padding-bottom: .5rem; }
.board-surface.kanban-surface {
  --ink: #25354a;
  --paper: #e8eff2;
  background: linear-gradient(155deg, #f0d5e4 0%, #ece3f2 42%, #cee7ef 76%, #cce8e0 100%);
}
.kanban { display: grid; grid-template-columns: repeat(3, minmax(13rem, 1fr)); gap: .75rem; overflow-x: auto; padding: .3rem .25rem .85rem; }
.kanban-split { grid-template-columns: repeat(4, minmax(13rem, 1fr)); }
.kanban-progress { grid-column: 2 / 4; grid-row: 1; text-align: center; background: #fff7dc; border-top: 3px solid #e3a642; border-radius: 10px; font-size: .9rem; padding: .5rem; }
.kanban-split .kanban-lane { grid-row: 2; }
.board-surface .kanban-lane {
  min-height: clamp(13rem, 56dvh, 34rem);
  padding: .65rem;
  background: #ffffff73;
  border: 1px solid #ffffffb0;
  border-top: 4px solid var(--stage-accent);
  border-radius: 14px;
  box-shadow: 0 4px 14px #25354a12;
}
.kanban-lane[data-stage="todo"] { --stage-accent: #4281c7; --stage-tint: #e3effc; }
.kanban-lane[data-stage="doing"] { --stage-accent: #d89233; --stage-tint: #fff1cf; }
.kanban-lane[data-stage="waiting"] { --stage-accent: #9275c5; --stage-tint: #eee6fa; }
.kanban-lane[data-stage="done"] { --stage-accent: #359c88; --stage-tint: #dcf4ec; }
.kanban .kanban-lane h2 { width: 100%; padding: .45rem .55rem; background: var(--stage-tint); box-shadow: none; font-size: .88rem; }
.kanban-lane .pad-card {
  background: var(--stage-tint);
  border-top-color: var(--stage-accent);
}
.kanban-drag { display: inline-block; cursor: grab; color: var(--ink); font-size: 1.3rem; }
.kanban-drag:active { cursor: grabbing; }
.kanban-move-label { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; font-size: .85rem; }
.kanban-move { padding: .25rem .4rem; }
.list, .rows { display: grid; gap: .75rem; }
.list { max-width: 48rem; }
.rows .lane { display: grid; grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: clamp(12rem, 30%, 19rem); gap: .75rem; overflow-x: auto; }
.rows .lane h2 { grid-area: 1 / 1 / 2 / 2; margin: 0; }
.rows .lane article { grid-row: 2; margin: 0; }
.rows .lane article:first-of-type { grid-column: 1; }
.columns:has(.pad-card[style*="--card-width"]), .rows .lane:has(.pad-card[style*="--card-width"]) {
  grid-auto-columns: max-content;
}
.columns:has(.pad-card[style*="--card-width"]) .lane { min-width: 13rem; }
.columns:has(.pad-card[style*="--card-width"]) .pad-card { width: var(--card-width, 13rem); }
.rows .lane:has(.pad-card[style*="--card-width"]) article { width: var(--card-width, 13rem); }
.free-wrap { overflow: auto; }
.free { position: relative; min-width: 720px; isolation: isolate; }
.free article { position: absolute; width: var(--card-width, 216px); max-width: calc(100% - var(--card-left, 0px)); }
.free article:focus-within { z-index: 1; }
.free article.dragging { z-index: 2; box-shadow: 0 8px 24px #0004; }
.move-handle { display: block; margin: 0 0 .5rem auto; padding: .25rem .45rem; cursor: grab; touch-action: none; }
.dragging .move-handle { cursor: grabbing; }
.lane h2 { font-size: 1rem; margin-bottom: .8rem; }
.lane article + article { margin-top: .75rem; }
.timeline-wrap { overflow-x: auto; }
.timeline { position: relative; list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; min-width: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  border: 2px solid var(--panel);
  background: var(--ink);
}
.timeline time { display: block; font-weight: 700; padding-bottom: .4rem; }
.timeline.vertical { max-width: 48rem; padding-left: 1.6rem; }
.timeline.vertical::before {
  content: "";
  position: absolute;
  inset: .55rem auto .6rem .38rem;
  border-left: 3px solid var(--ink);
}
.timeline.vertical li { padding-bottom: .85rem; }
.timeline.vertical li::before { top: .19rem; left: -1.5rem; }
.timeline.horizontal {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(17rem, 75vw);
  gap: 1rem;
  width: max-content;
  padding: 0 .5rem .65rem;
}
.timeline.horizontal::before {
  content: "";
  position: absolute;
  inset: .42rem .5rem auto;
  border-top: 3px solid var(--ink);
}
.timeline.horizontal li { padding-top: 1.25rem; }
.timeline.horizontal:has(.pad-card[style*="--card-width"]) { grid-auto-columns: max-content; }
.timeline.horizontal:has(.pad-card[style*="--card-width"]) .pad-card { width: var(--card-width, 17rem); }
.timeline.horizontal li::before { top: .14rem; left: .25rem; }
.timeline-undated { margin-top: 1rem; }
.table-wrap { overflow: auto; border-radius: 12px; box-shadow: 0 5px 16px #17233426; }
.column-button { padding: .25rem .45rem; text-align: left; }
.column-button:hover { color: var(--ink); border-color: var(--ink); }
.column-editor { min-width: 11rem; padding: 0; grid-template-columns: 1fr 1fr; }
.column-editor input { grid-column: 1 / -1; min-width: 0; }
#table-fields { display: grid; gap: .65rem; }
.new-table-row td { animation: highlight-row 3s ease-out; }
@keyframes highlight-row { from { background: #b5f1d2; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .new-table-row td { animation: none; background: #b5f1d2; }
}
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { padding: .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
td:nth-child(2) { min-width: 10rem; }
.map-surface { position: relative; isolation: isolate; min-height: 18rem; padding-bottom: 0; }
.map-surface .intro { position: relative; z-index: 1; width: fit-content; max-width: 100%; }
.map-surface #content { position: absolute; inset: 0; margin: 0; }
.map { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; border-radius: 0; }
.map svg { display: block; width: 100%; height: 100%; background: #c9d1d6; touch-action: none; cursor: grab; }
.map svg:active { cursor: grabbing; }
.map-countries path { fill: #fbfaf7; fill-rule: evenodd; stroke: #a7adb3; stroke-width: .65; vector-effect: non-scaling-stroke; }
.map-names { fill: #37404a; font-weight: 600; text-anchor: middle; pointer-events: none; }
.map-controls { position: absolute; bottom: 2rem; left: .75rem; display: flex; gap: .25rem; }
.map-controls button { padding: .3rem .55rem; }
.map-points { position: relative; z-index: 1; }
.map-points summary { display: grid; place-items: center; height: 100%; min-width: 2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-weight: 700; cursor: pointer; list-style: none; }
.map-points summary::-webkit-details-marker { display: none; }
.map figcaption { position: absolute; left: .4rem; bottom: .3rem; padding: .2rem .35rem; background: var(--panel); color: var(--ink); font-size: .72rem; }
.map [role="button"] { cursor: pointer; }
.editing-map { padding-right: var(--editor-width); }
body.editing-map #editor { position: fixed; inset: 0 0 0 auto; width: var(--editor-width); height: 100dvh; max-height: 100dvh; margin: 0; z-index: 4; border-radius: 0; }
body.editing-map #edit-form { height: 100%; max-height: none; }
.editing-map #pad-map { touch-action: none; cursor: crosshair; }
#map-picker { display: grid; align-content: start; gap: .6rem; overflow: auto; padding: .7rem; }
#map-prompt { font-weight: 700; }
@media (max-width: 680px) {
  body.editing-map { padding-right: 0; padding-bottom: 50dvh; }
  body.editing-map #editor { inset: auto 0 0; width: 100%; height: 50dvh; }
}
.map-list { position: absolute; bottom: 100%; left: 0; margin: 0 0 .35rem; padding: .3rem; width: min(15rem, 75vw); max-height: 30dvh; overflow: auto; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 16px #17233426; }
.map-list button { width: 100%; border: 0; text-align: left; overflow-wrap: anywhere; }
.map-list button:hover { color: var(--ink); background: var(--paper); }
.map-selected-post, .map-unlocated {
  position: absolute;
  right: .75rem;
  bottom: 4.75rem;
  width: min(20rem, calc(100% - 1.5rem));
  max-height: 32%;
  overflow: auto;
  padding: .4rem;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 5px 16px #17233426;
}
.map-selected-post { z-index: 1; bottom: 7.25rem; }
.map-selected-post:has(.pad-card[style*="--card-width"]) { width: fit-content; max-width: calc(100% - 1.5rem); }
.map-unlocated[open]:has(.pad-card[style*="--card-width"]) { width: fit-content; max-width: calc(100% - 1.5rem); }
.map-selected-post > button { margin-bottom: .3rem; }
.map-unlocated summary { cursor: pointer; padding: .2rem .4rem; }
dialog { color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(32rem, calc(100% - 2rem)); }
dialog::backdrop { background: #000a; }
form, form label { display: grid; gap: .65rem; }
form { padding: .5rem; }
.editor-fields { display: grid; gap: .65rem; min-width: 0; }
body:not(.creating-pad):not(.editing-map) #editor {
  width: min(27rem, calc(100% - 1.25rem));
  max-height: calc(100dvh - 1.25rem);
  padding: 0;
  overflow: hidden;
}
body:not(.creating-pad) #edit-form {
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100dvh - 1.4rem);
  padding: 0;
  gap: 0;
}
body.editing-map #editor { overflow: hidden; padding: 0; }
body:not(.creating-pad) .editor-heading { padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
body:not(.creating-pad) .editor-heading h2 { font-size: 1rem; }
body:not(.creating-pad) .editor-fields { overflow-y: auto; overscroll-behavior: contain; padding: .65rem .75rem; gap: .5rem; }
body:not(.creating-pad) #editor :is(input, select, textarea, button) { padding: .35rem .5rem; }
body:not(.creating-pad) #editor label { gap: .25rem; }
body:not(.creating-pad) #editor textarea { height: 4.1rem; }
body:not(.creating-pad) #image-preview { max-height: 6rem; }
#edit-form:has(#post-delete:not([hidden])) { grid-template-rows: auto minmax(0, 1fr) auto; }
#post-delete { padding: .5rem .75rem; border-top: 1px solid var(--line); }
#confirm-post-delete p { margin-bottom: .4rem; }
textarea { resize: vertical; }
.coordinates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
form input:not([type="radio"]) { width: 100%; }
#backgrounds { border: 1px solid var(--line); border-radius: 10px; margin: 0; min-width: 0; }
#board-types { border: 1px solid var(--line); border-radius: 10px; margin: 0; min-width: 0; }
.type-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .5rem; }
.type-option { position: relative; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; }
.type-preview { display: grid; gap: .35rem; padding: .3rem; border: 1px solid var(--line); border-radius: 9px; height: 100%; }
.type-preview:hover { background: #273146; }
.type-option input:checked + .type-preview { border-color: var(--accent); color: var(--accent); }
.type-option input:focus-visible + .type-preview { outline: 2px solid var(--accent); outline-offset: 2px; }
.preview-name { padding-inline: .15rem; }
.preview-scene { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5%; padding: 8%; aspect-ratio: 1.85; border-radius: 5px; overflow: hidden; background: #cfeade; }
.preview-group { display: flex; flex-direction: column; gap: 10%; min-height: 0; }
.preview-group i { display: block; flex: 1; border-radius: 2px; background: linear-gradient(#64748b 0 0) 25% 25% / 62% 2px no-repeat, linear-gradient(#b8c3ce 0 0) 25% 52% / 43% 1px no-repeat, #fffaf3; box-shadow: 0 1px 3px #24324d35; }
[data-preview="wall"] .preview-group:nth-child(odd) i:first-child { flex: 1.7; background-color: #f6d8ae; }
[data-preview="wall"] .preview-group:nth-child(2) i:last-child { flex: 1.9; background-color: #f3d5ec; }
[data-preview="columns"] .preview-scene { background: #d3e5ff; }
[data-preview="columns"] .preview-group, [data-preview="kanban"] .preview-group { background: #ffffff66; padding: 12%; border-top: 3px solid #5784ba; border-radius: 2px; }
[data-preview="table"] .preview-scene { grid-template-columns: 1fr; grid-template-rows: repeat(4, 1fr); background: #ffebc9; }
[data-preview="table"] i { background: repeating-linear-gradient(90deg, #fff8ed 0 29%, #ead5b3 29% 30%); }
[data-preview="table"] .preview-group:first-child i { background: repeating-linear-gradient(90deg, #bc7843 0 29%, #ffebc9 29% 30%); }
[data-preview="timeline"] .preview-scene { background: linear-gradient(#5b7d99 0 0) center 71% / 88% 1px no-repeat, #dce9f4; }
[data-preview="timeline"] .preview-group { position: relative; height: 68%; padding-bottom: 4px; }
[data-preview="timeline"] .preview-group::after { content: ""; position: absolute; bottom: -3px; left: 40%; width: 5px; height: 5px; border-radius: 50%; background: #395d7d; }
[data-preview="timeline"] .preview-group:nth-child(2) { padding-top: 18%; }
[data-preview="map"] .preview-scene { position: relative; background: #bbcfe0; }
[data-preview="map"] .preview-scene::before { content: ""; position: absolute; inset: 0; background: #f5f2eb; clip-path: polygon(0 0, 90% 0, 83% 24%, 65% 32%, 72% 48%, 58% 63%, 52% 91%, 29% 100%, 16% 76%, 27% 53%, 10% 35%, 0 39%); }
[data-preview="map"] .preview-group { position: relative; justify-content: center; align-items: center; }
[data-preview="map"] i { flex: none; width: 9px; height: 9px; transform: rotate(-45deg); border-radius: 50% 50% 50% 0; background: #7259b7; }
[data-preview="map"] .preview-group:nth-child(2) { justify-content: start; }
[data-preview="map"] .preview-group:nth-child(3) { justify-content: end; }
[data-preview="kanban"] .preview-scene { background: linear-gradient(135deg, #efd8eb, #cae4e5); }
[data-preview="kanban"] .preview-group:nth-child(2) { border-color: #d89233; }
[data-preview="kanban"] .preview-group:nth-child(3) { border-color: #359c88; }
[data-preview="kanban"] .preview-group:nth-child(1) i { background-color: #e3effc; }
[data-preview="kanban"] .preview-group:nth-child(2) i { background-color: #fff1cf; }
[data-preview="kanban"] .preview-group:nth-child(3) i { background-color: #dcf4ec; }
.background-category { color: var(--muted); font-size: .85rem; margin: .55rem 0 .35rem; }
.background-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.2rem, 1fr)); gap: .4rem; }
.background-options label { position: relative; cursor: pointer; }
.background-options input { position: absolute; opacity: 0; }
.background-options span {
  display: grid;
  place-items: end center;
  min-height: 3.2rem;
  padding: .25rem;
  border: 2px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: var(--art, linear-gradient(145deg, var(--paper), var(--wash)));
  text-shadow: 0 0 4px #fff, 0 0 5px #fff, 0 0 6px #fff;
}
.background-options input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px #0f1117; }
.background-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { justify-content: end; }
#editor-status { color: #ffb3a9; }
#editor-status:empty { display: none; }
