:root {
  --ink: #22221f;
  --muted: #706b62;
  --paper: #f7f3ea;
  --white: #fffdf8;
  --line: #dcd5c8;
  --accent: #315f4d;
  --shadow: 0 18px 45px rgba(64, 53, 37, .1);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(235, 198, 124, .17), transparent 30%),
    linear-gradient(rgba(87, 77, 61, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 77, 61, .035) 1px, transparent 1px), var(--paper);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0 90px; }
.home-hero { margin-bottom: 58px; }
.home-shell { padding-top: 38px; }
.home-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 42px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.home-header .primary-button { padding: 10px 16px; font-size: .78rem; }
.home-header .primary-button > span { width: 21px; height: 21px; margin-right: 6px; font-size: 1rem; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow > span { width: 28px; height: 2px; background: currentColor; }
.eyebrow.compact { justify-content: center; font-size: .66rem; }
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 36px; margin-top: 16px; }
h1 { margin-bottom: 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.4rem, 8vw, 6.7rem); font-weight: 500; line-height: .9; letter-spacing: -.055em; }
h1 em { color: var(--accent); font-weight: 400; }
.home-hero p { max-width: 610px; margin-bottom: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }

.primary-button, .secondary-button, .submit-button {
  border-radius: 999px; font-weight: 750; transition: transform .2s, box-shadow .2s;
}
.hero-actions { display: flex; align-items: center; gap: 11px; }
.auth-button { padding: 10px 12px; border: 0; color: var(--muted); background: transparent; font-size: .75rem; font-weight: 750; }
.auth-button:hover { color: var(--ink); }
.auth-button.is-teacher { color: var(--accent); }
[hidden] { display: none !important; }
.primary-button, .submit-button { border: 0; color: white; background: var(--ink); box-shadow: 0 8px 22px rgba(34,34,31,.16); }
.primary-button { flex: 0 0 auto; padding: 15px 21px; }
.primary-button > span { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 7px; border-radius: 50%; color: var(--ink); background: white; font-size: 1.2rem; }
.primary-button:hover, .submit-button:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(34,34,31,.2); }
.secondary-button { padding: 13px 18px; border: 1px solid var(--line); color: var(--ink); background: rgba(255,253,248,.7); }
.secondary-button:hover { border-color: var(--ink); }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 25px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin-bottom: 13px; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.section-heading span { color: var(--muted); font-size: .82rem; }
.overview-actions { display: flex; align-items: center; gap: 16px; }
.filter-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,253,248,.65); }
.filter-switch button { padding: 6px 11px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: .72rem; font-weight: 750; }
.filter-switch button.active { color: white; background: var(--ink); }
.backup-link { color: var(--accent); font-size: .72rem; font-weight: 750; text-decoration: none; }
.backup-link:hover { text-decoration: underline; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.locked-state { grid-column: 1 / -1; padding: 70px 28px; border: 1px solid var(--line); border-radius: 22px; text-align: center; background: rgba(255,253,248,.72); }
.locked-state > span { color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.locked-state h2 { max-width: 560px; margin: 12px auto 8px; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.locked-state p { margin: 0; color: var(--muted); }
.board-card { position: relative; min-height: 220px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.9); box-shadow: 0 8px 26px rgba(64,53,37,.07); transition: transform .2s, box-shadow .2s, border-color .2s; }
.board-card.board-color-neutral { background: rgba(255,253,248,.92); }
.board-card.board-color-sun { background: #f7e7ae; }
.board-card.board-color-coral { background: #f3c5b8; }
.board-card.board-color-mint { background: #cce6d7; }
.board-card.board-color-sky { background: #cbdfee; }
.board-card.board-color-lilac { background: #ddd2e8; }
.board-card.board-color-gray { background: #deded9; }
.board-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 6px; background: var(--accent); }
.board-card:hover { transform: translateY(-4px); border-color: #bcb3a4; box-shadow: var(--shadow); }
.board-card-main { position: absolute; inset: 0; padding: 27px; color: inherit; text-decoration: none; }
.board-card-controls { position: absolute; top: 17px; right: 17px; z-index: 2; display: flex; gap: 5px; }
.board-card-controls button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(34,34,31,.1); border-radius: 50%; opacity: .55; background: rgba(255,255,255,.7); }
.board-card-controls button:hover, .board-card-controls button:focus { opacity: 1; }
.board-card-controls svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.board-card-drag { color: var(--muted); touch-action: none; cursor: grab; }
.board-card-delete { color: #8d4942; }
.board-card-color { color: var(--accent); }
.board-color-menu { position: absolute; top: 52px; right: 17px; z-index: 5; display: flex; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,253,248,.96); box-shadow: 0 10px 25px rgba(34,34,31,.14); }
.board-color-menu[hidden] { display: none; }
.board-color-swatch { width: 22px; height: 22px; padding: 0; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px rgba(34,34,31,.16); }
.board-color-swatch.board-color-neutral { background: #fffdf8; }
.board-color-swatch.board-color-sun { background: #f7e7ae; }
.board-color-swatch.board-color-coral { background: #f3c5b8; }
.board-color-swatch.board-color-mint { background: #cce6d7; }
.board-color-swatch.board-color-sky { background: #cbdfee; }
.board-color-swatch.board-color-lilac { background: #ddd2e8; }
.board-color-swatch.board-color-gray { background: #deded9; }
.board-color-swatch.selected { box-shadow: 0 0 0 2px var(--ink); }
.board-card-placeholder { border: 2px dashed var(--accent); background: rgba(49,95,77,.08); box-shadow: none; }
.board-card-dragging { opacity: .92; transform: rotate(1deg) scale(1.015); box-shadow: 0 22px 45px rgba(34,34,31,.24); }
.board-card-label { display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px 4px 5px; border-radius: 999px; color: var(--accent); background: rgba(49,95,77,.09); font-size: .65rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.board-card-type-icon { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--accent); }
.board-card-type-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.board-card h3 { max-width: 85%; margin: 22px 0 42px; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 500; line-height: 1.15; }
.board-card-meta { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .75rem; }
.board-card-arrow { position: absolute; right: 25px; bottom: 24px; font-size: 1.6rem; }
.poll-card { background: linear-gradient(145deg,rgba(255,253,248,.94),rgba(238,231,245,.92)); }
.poll-card::before { background: #73548f; }
.poll-card .board-card-label { color: #73548f; background: rgba(115,84,143,.1); }
.poll-card .board-card-type-icon { background: #73548f; }
.poll-card-delete { position: absolute; top: 17px; right: 17px; z-index: 3; width: 28px; height: 28px; border: 1px solid rgba(34,34,31,.1); border-radius: 50%; color: #8d4942; background: rgba(255,255,255,.7); font-size: 1.15rem; line-height: 1; }

.empty-state { padding: 80px 20px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; color: var(--accent); background: rgba(49,95,77,.1); font-size: 1.8rem; }
.empty-state h2 { margin-bottom: 8px; font-family: Georgia, serif; font-size: 1.7rem; font-weight: 500; }
.empty-state p { margin-bottom: 24px; color: var(--muted); }

dialog { width: min(620px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 26px; background: var(--white); box-shadow: 0 30px 90px rgba(34,34,31,.28); }
dialog::backdrop { background: rgba(34,34,31,.47); backdrop-filter: blur(4px); }
.dialog-card { padding: clamp(25px, 5vw, 44px); }
.wide-dialog { width: 100%; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 6px 0 29px; font-family: Georgia, serif; font-size: 2.2rem; font-weight: 500; }
.dialog-description { margin: -14px 0 25px; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.post-edit-details { margin: -14px 0 22px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
#password-confirm-row { margin-top: 18px; }
.step-label { color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.icon-button { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 1.5rem; }
label, legend { display: block; margin-bottom: 9px; font-size: .82rem; font-weight: 750; }
label small { color: var(--muted); font-weight: 500; }
textarea, input, select { width: 100%; border: 1px solid var(--line); border-radius: 13px; outline: none; color: var(--ink); background: #fffefa; transition: border .2s, box-shadow .2s; }
textarea { min-height: 135px; padding: 16px; resize: vertical; line-height: 1.5; }
input, select { min-height: 48px; padding: 12px 14px; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49,95,77,.11); }
.form-error { min-height: 1.2em; margin: 9px 0 0; color: #a6372d; font-size: .78rem; }
.character-row { display: flex; justify-content: space-between; min-height: 33px; padding-top: 7px; color: var(--muted); font-size: .72rem; }
.character-row .form-error { margin: 0; }
.form-row { display: grid; gap: 20px; align-items: end; }
.three-fields { grid-template-columns: .85fr .85fr 1.3fr; }
fieldset { margin: 0; padding: 0; border: 0; }
.color-options { display: flex; flex-wrap: wrap; gap: 9px; }
.color-options label { margin: 0; }
.color-options input { position: absolute; opacity: 0; pointer-events: none; }
.swatch { display: block; width: 35px; height: 35px; overflow: hidden; border: 3px solid var(--white); border-radius: 50%; color: transparent; box-shadow: 0 0 0 1px var(--line); transition: transform .15s, box-shadow .15s; }
.color-options input:checked + .swatch { transform: scale(.86); box-shadow: 0 0 0 3px var(--ink); }
.sun { background: #f5d77d; } .coral { background: #efa28c; } .mint { background: #a8d8be; } .sky { background: #a9cde7; } .lilac { background: #cbb8df; } .white { background: #fffdf8; } .gray { background: #d7d7d3; }
.submit-button { margin-top: 28px; padding: 15px 22px; background: var(--accent); }
.submit-button:disabled { cursor: wait; opacity: .6; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.share-card { text-align: left; }
.qr-frame { display: grid; place-items: center; width: min(320px, 100%); aspect-ratio: 1; margin: 24px auto; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.qr-frame img { display: block; width: 100%; height: 100%; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.copy-row input { min-width: 0; font-size: .76rem; }
.copy-row .secondary-button { border-radius: 12px; }
.danger-button { margin-top: 28px; padding: 12px 0; border: 0; color: #a6372d; background: transparent; font-size: .78rem; font-weight: 800; }
.danger-button:hover { text-decoration: underline; }
.management-list { display: grid; gap: 12px; }
.management-list > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.management-list strong, .management-list span { display: block; }
.management-list strong { margin-bottom: 4px; font-size: .88rem; }
.management-list span { color: var(--muted); font-size: .73rem; line-height: 1.4; }
.management-actions { display: flex; gap: 8px; }
.management-list select { width: auto; min-width: 120px; min-height: 38px; padding: 7px 10px; font-size: .75rem; }
.management-actions a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--accent); font-size: .72rem; font-weight: 800; text-decoration: none; }
.danger-outline-button { padding: 9px 12px; border: 1px solid #c96f66; border-radius: 10px; color: #a6372d; background: transparent; font-size: .74rem; font-weight: 800; }

.board-page { min-height: 100vh; padding-bottom: 50px; }
.board-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 25px; min-height: 132px; padding: 22px max(30px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid var(--line); background: rgba(247,243,234,.88); backdrop-filter: blur(12px); }
.back-link { justify-self: start; color: var(--muted); font-size: .83rem; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--ink); }
.board-title-block { text-align: center; }
.board-title-row { display: flex; align-items: center; justify-content: center; min-width: 0; gap: 9px; }
.board-title-block h1 { max-width: 650px; margin: 0; overflow-wrap: anywhere; font-size: clamp(1.45rem, 3vw, 2.5rem); line-height: 1.1; white-space: normal; }
.board-title-edit { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; color: rgba(34,34,31,.35); background: transparent; cursor: pointer; transition: color .15s, transform .15s; }
.board-title-edit:hover, .board-title-edit:focus-visible { color: var(--accent); transform: translateY(-1px); }
.board-title-edit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.board-timer { display: inline-flex; align-items: center; gap: 7px; margin-top: 9px; padding: 7px 14px; border-radius: 999px; color: var(--accent); background: rgba(49,95,77,.1); font-size: 1.125rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.board-timer svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.board-timer.expired { color: #a6372d; background: rgba(166,55,45,.1); }
.board-actions { display: flex; flex-wrap: wrap; justify-self: end; justify-content: flex-end; gap: 8px; max-width: 520px; }
.board-actions .secondary-button, .board-actions .primary-button, .board-actions .auth-button {
  min-height: 38px;
  padding-block: 8px;
  padding-inline: 13px;
  font-size: .73rem;
  line-height: 1;
}
.board-actions .primary-button {
  box-shadow: 0 6px 18px rgba(34,34,31,.14);
}
.board-actions .primary-button > span {
  width: 20px;
  height: 20px;
  margin-right: 6px;
  font-size: 1rem;
}
.board-actions .secondary-button {
  background: rgba(255,253,248,.82);
}
.board-actions .auth-button {
  padding-inline: 10px;
}
.columns-viewport { position: relative; padding: 88px max(24px, calc((100vw - 1440px) / 2)) 34px; overflow: auto; }
.columns-viewport.free-workspace { padding-top: 34px; }
.workspace-add-post { position: absolute; top: 22px; right: max(24px, calc((100vw - 1440px) / 2)); z-index: 30; padding: 11px 17px; font-size: .78rem; }
.workspace-add-post > span { width: 21px; height: 21px; margin-right: 6px; font-size: 1rem; }
.board-notice { max-width: 760px; margin: 0 auto 22px; padding: 12px 18px; border: 1px solid #d9b46d; border-radius: 12px; color: #725518; background: #fff1c9; font-size: .8rem; text-align: center; }
.columns { display: flex; align-items: flex-start; gap: 22px; min-width: min-content; }
.columns.free-layout {
  --free-zoom: 1;
  position: relative;
  display: block;
  min-width: 0;
  min-height: min(78vh, 920px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(49,95,77,.07), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(235,198,124,.13), transparent 23%),
    linear-gradient(rgba(87, 77, 61, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 77, 61, .04) 1px, transparent 1px),
    rgba(255,253,248,.76);
  background-size: auto, auto, 28px 28px, 28px 28px, auto;
}
.columns.free-layout .free-board-guide,
.columns.free-layout .free-post {
  transform: scale(var(--free-zoom));
  transform-origin: top left;
}
.free-board-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}
.free-board-guide {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,253,248,.92);
  box-shadow: 0 10px 24px rgba(64,53,37,.08);
}
.columns.free-layout .workspace-add-post { position: static; margin-left: auto; }
.free-board-guide strong { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.free-board-guide span { color: var(--muted); font-size: .73rem; }
.board-column { width: 330px; max-height: calc(100vh - 200px); display: flex; flex-direction: column; padding: 15px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,253,248,.65); }
.board-column > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 3px 5px 14px; }
.column-header-actions { display: flex; align-items: center; gap: 5px; }
.column-count { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; opacity: 0; color: var(--muted); background: rgba(34,34,31,.07); font-size: .7rem; font-weight: 800; transform: translateY(-2px); transition: opacity .15s, transform .15s; }
.column-delete-button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; opacity: 0; color: #8d4942; background: transparent; pointer-events: none; transition: opacity .15s; }
.column-delete-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.board-column:hover .column-count, .board-column:focus-within .column-count, .board-column.column-controls-visible .column-count { opacity: 1; transform: none; }
.board-column:hover .column-delete-button, .board-column:focus-within .column-delete-button, .board-column.column-controls-visible .column-delete-button { opacity: .72; pointer-events: auto; }
.column-delete-button:hover, .column-delete-button:focus { opacity: 1 !important; }
.column-title { max-width: 255px; overflow: hidden; border: 0; color: var(--ink); background: transparent; font-family: Georgia, serif; font-size: 1.32rem; font-weight: 600; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.column-title:hover { color: var(--accent); }
.column-title:disabled { cursor: default; }
.column-title:disabled:hover { color: var(--ink); }
.column-posts { min-height: 100px; padding: 3px 3px 4px; overflow-y: auto; border: 2px dashed transparent; border-radius: 12px; transition: background .15s, border-color .15s; }
.column-posts.drag-over { border-color: var(--accent); background: rgba(49,95,77,.07); }
.column-empty { margin: 20px 0; color: #9a9489; font-size: .75rem; text-align: center; }
.column-add-button { width: 100%; margin-top: 8px; padding: 11px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 700; text-align: left; }
.column-add-button:hover { color: var(--accent); background: rgba(49,95,77,.07); }
.post { position: relative; width: 100%; margin-bottom: 13px; padding: 22px 19px 17px; border-radius: 4px 4px 15px 4px; box-shadow: 3px 6px 14px rgba(57,49,38,.12); animation: arrive .25s ease both; }
.column-posts > .post { padding-top: 36px; }
.post::after { content: ""; position: absolute; right: 0; bottom: 0; border-style: solid; border-width: 0 0 16px 16px; border-color: transparent transparent rgba(255,255,255,.45) transparent; }
.post.dragging { opacity: .38; }
.post.sorting, .board-column.sorting { z-index: 20; opacity: .72; outline: 2px solid var(--accent); box-shadow: 0 18px 36px rgba(34,34,31,.2); }
.post.post-drag-preview { z-index: 1000; opacity: .9; transform: rotate(1.5deg) scale(1.02); box-shadow: 0 22px 45px rgba(34,34,31,.28); }
.post-drop-placeholder { width: 100%; min-height: 72px; margin-bottom: 13px; border: 2px dashed var(--accent); border-radius: 10px; background: rgba(49,95,77,.1); }
.board-column.column-drag-preview { z-index: 1000; opacity: .92; transform: rotate(.7deg) scale(1.01); box-shadow: 0 22px 45px rgba(34,34,31,.24); }
.column-drop-placeholder { flex: 0 0 auto; border: 2px dashed var(--accent); border-radius: 19px; background: rgba(49,95,77,.08); }
.is-sorting { cursor: grabbing; user-select: none; }
.sort-handle { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; color: rgba(34,34,31,.48); background: transparent; font-size: 1rem; line-height: 1; touch-action: none; cursor: grab; }
.sort-handle:hover { color: var(--ink); background: rgba(255,255,255,.45); }
.sort-handle:active { cursor: grabbing; }
.sort-handle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.post-sort-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 25px;
  height: 25px;
  opacity: .4;
  color: var(--ink);
  background: transparent;
  border: 0;
  box-shadow: none;
}
.post:hover .post-sort-handle, .post-sort-handle:focus { opacity: .8; background: transparent; }
.free-post {
  position: absolute;
  width: min(280px, calc(100vw - 110px));
  max-width: 300px;
  margin: 0;
  z-index: 1;
}
.free-zoom-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,253,248,.94);
  box-shadow: 0 14px 30px rgba(64,53,37,.16);
}
.free-zoom-controls button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(49,95,77,.1);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}
.free-zoom-controls button:hover { background: rgba(49,95,77,.18); }
.free-zoom-controls button:active { transform: translateY(1px); }
.post-sun { background: #f6dc8a; } .post-coral { background: #efaa96; } .post-mint { background: #b0dbc4; } .post-sky { background: #afd0e8; } .post-lilac { background: #d0bfe1; } .post-white { border: 1px solid #ded8cc; background: #fffdf8; } .post-gray { background: #d7d7d3; }
.post h3 { margin: 0 0 9px; overflow-wrap: anywhere; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .95rem; font-weight: 750; line-height: 1.3; }
.post p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .9rem; line-height: 1.48; }
.post-link { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin-top: 14px; overflow: hidden; color: var(--accent); font-size: .72rem; font-weight: 750; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.post-link:hover { text-decoration: underline; }
.post-link svg { flex: 0 0 auto; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.post-engagement { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(34,34,31,.1); }
.post-engagement > button, .post-vote-step, .post-add-comment { min-height: 27px; padding: 4px 8px; border: 0; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.46); font-size: .68rem; font-weight: 750; }
.post-reaction-button.active { color: #a63757; background: rgba(255,255,255,.8); }
.post-points { font-size: .68rem; font-weight: 750; }
.post-comments { flex: 1 0 100%; padding-top: 7px; }
.post-comments > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px solid rgba(34,34,31,.08); font-size: .7rem; line-height: 1.4; }
.post-comments > div button { padding: 0 4px; border: 0; color: #8d4942; background: transparent; }
.post-add-comment { margin-top: 7px; }
.edit-post-button { position: absolute; top: 7px; right: 8px; width: 27px; height: 27px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(34,34,31,.12); border-radius: 50%; opacity: .6; color: var(--ink); background: rgba(255,255,255,.55); transition: opacity .15s, transform .15s, background .15s; }
.edit-post-button svg, .delete-post-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.delete-post-icon { position: absolute; top: 7px; right: 41px; width: 27px; height: 27px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(34,34,31,.12); border-radius: 50%; opacity: .48; color: #8d4942; background: rgba(255,255,255,.48); transition: opacity .15s, transform .15s, background .15s; }
.free-post .edit-post-button { right: 8px; }
.free-post .delete-post-icon { right: 41px; }
.post-sort-handle, .edit-post-button, .delete-post-icon { opacity: 0; pointer-events: none; }
.post:hover .post-sort-handle, .post:focus-within .post-sort-handle, .post.controls-visible .post-sort-handle,
.post:hover .edit-post-button, .post:focus-within .edit-post-button, .post.controls-visible .edit-post-button,
.post:hover .delete-post-icon, .post:focus-within .delete-post-icon, .post.controls-visible .delete-post-icon { opacity: 1; pointer-events: auto; }
.post:hover .edit-post-button, .edit-post-button:focus, .post.controls-visible .edit-post-button,
.post:hover .delete-post-icon, .delete-post-icon:focus, .post.controls-visible .delete-post-icon { background: rgba(255,255,255,.82); transform: translateY(-1px); }
.board-error { margin-left: 4px; }

@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 850px) {
  .board-topbar { grid-template-columns: 1fr auto; padding: 18px 20px; }
  .board-title-block { grid-column: 1 / -1; grid-row: 1; }
  .back-link { grid-row: 2; }
  .board-actions { grid-row: 2; }
  .board-column { max-height: calc(100vh - 230px); }
  .board-actions { max-width: none; }
  .three-fields { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .page-shell { width: min(100% - 28px, 1180px); padding-top: 42px; }
  .hero-row { align-items: stretch; flex-direction: column; }
  .home-header { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
  .hero-row .primary-button { align-self: flex-start; }
  h1 { font-size: clamp(3.2rem, 17vw, 5.2rem); }
  .board-actions #add-column-button, .board-actions #toggle-board-button, .board-actions #toggle-layout-button, .board-actions #share-board-button { display: none; }
  .board-column { width: calc(100vw - 48px); }
  .columns-viewport { padding-inline: 16px; scroll-snap-type: x mandatory; }
  .workspace-add-post { right: 16px; }
  .board-column { scroll-snap-align: center; }
  .columns.free-layout { min-height: 72vh; padding: 12px; }
  .edit-post-button { opacity: 1; }
  .post-sort-handle { opacity: 1; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .overview-actions { width: 100%; flex-wrap: wrap; margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

.submit-page { min-height: 100svh; }
.submit-shell { width: min(620px, calc(100% - 28px)); margin: 0 auto; padding: max(30px, env(safe-area-inset-top)) 0 max(45px, env(safe-area-inset-bottom)); }
.submit-header { margin-bottom: 22px; }
.submit-header h1 { margin: 20px 0 7px; font-size: clamp(2.25rem, 11vw, 4.3rem); line-height: .95; }
.submit-header > p { margin: 0; color: var(--muted); font-size: .88rem; }
.submit-card { padding: clamp(22px, 6vw, 36px); border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.9); box-shadow: var(--shadow); }
.submit-card > label, .student-column-field label { display: block; margin-top: 18px; }
.submit-card > label:first-child { margin-top: 0; }
.student-color-field { margin-top: 20px; }
.student-colors { margin-top: 9px; }
.student-submit { width: 100%; margin-top: 8px; }
.submit-status { margin: 16px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: rgba(255,253,248,.86); }
.submit-status.success { color: #24533f; border-color: #9bc5ad; background: #e7f4eb; }
.submit-status strong { color: var(--ink); }
.submit-status p { margin: 4px 0 0; font-size: .82rem; line-height: 1.45; }
.vote-preview { border-color: #c9b7dc; background: linear-gradient(180deg, rgba(244,238,249,.98), rgba(255,253,248,.94)); }
.vote-preview .submit-button { margin-top: 0; width: auto; }
.vote-preview .vote-submission-actions { justify-content: flex-end; }
.vote-submission { margin-top: 0; }
.vote-answer-list { display: grid; gap: 10px; margin-top: 12px; }
.vote-answer-item { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid rgba(34,34,31,.1); border-radius: 12px; background: rgba(255,255,255,.58); }
.vote-answer-item span { color: var(--muted); font-size: .74rem; }
.vote-answer-item b { font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; }
.vote-submission-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.vote-submission-actions .submit-button { min-width: 0; }
.vote-withdraw { color: #8d4942; }
.student-board-link { display: inline-block; margin-top: 18px; color: var(--accent); font-size: .78rem; font-weight: 750; text-decoration: none; }

.poll-page { min-height: 100vh; }
.poll-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 24px max(28px,calc((100vw - 1400px)/2)); border-bottom: 1px solid var(--line); }
.poll-topbar > a { color: var(--muted); font-size: .8rem; font-weight: 750; text-decoration: none; }
.poll-topbar h1 { max-width: 650px; margin: 8px 0 0; overflow-wrap: anywhere; font-size: clamp(1.5rem,3vw,2.5rem); line-height: 1.1; white-space: normal; }
.poll-actions { display: flex; justify-content: flex-end; gap: 6px; }
.poll-actions .secondary-button {
  min-height: 34px;
  padding: 8px 12px;
  font-size: .68rem;
  line-height: 1;
  letter-spacing: .01em;
}
.poll-workspace { display: grid; grid-template-columns: minmax(320px,420px) 1fr; min-height: calc(100vh - 125px); }
.poll-editor { padding: 30px; border-right: 1px solid var(--line); background: rgba(255,253,248,.52); }
.poll-editor h2,.poll-results h2 { font-family: Georgia,serif; font-size: 1.6rem; font-weight: 500; }
.question-form { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,248,.85); }
.question-form label { display: block; margin-bottom: 14px; }
.question-form textarea { min-height: 90px; }
.question-form .submit-button { width: 100%; margin-top: 5px; }
.poll-question-item { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,.75); }
.poll-question-item > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: rgba(115,84,143,.12); font-size: .7rem; font-weight: 800; }
.poll-question-item > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.poll-question-item small { color: var(--muted); }
.poll-question-item > button { border: 0; color: #8d4942; background: transparent; font-size: 1.2rem; }
.poll-question-item > .poll-question-drag { flex: 0 0 auto; color: var(--muted); touch-action: none; cursor: grab; font-size: 1rem; }
.poll-question-placeholder { margin-top: 10px; border: 2px dashed #73548f; border-radius: 12px; background: rgba(115,84,143,.08); }
.poll-question-dragging { margin: 0; opacity: .92; box-shadow: 0 18px 40px rgba(34,34,31,.2); }
.poll-results { padding: 30px clamp(24px,4vw,55px); }
.poll-results-heading { display: flex; align-items: baseline; justify-content: space-between; }
.poll-results-heading span { color: var(--muted); font-size: .8rem; }
#poll-results { display: grid; gap: 18px; }
.poll-result-card { display: grid; grid-template-columns: minmax(180px,35%) 1fr; gap: clamp(22px,4vw,55px); align-items: center; min-height: 230px; padding: clamp(22px,3vw,34px); border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.86); box-shadow: 0 8px 24px rgba(64,53,37,.06); }
.result-question > span { color: #73548f; font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.result-question h3 { margin: 10px 0; font-family: system-ui,sans-serif; font-size: clamp(1rem,1.7vw,1.25rem); line-height: 1.35; }
.result-question small { color: var(--muted); }
.result-visual { min-width: 0; }
.result-bar { margin-top: 11px; }
.result-bar > div { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: .76rem; }
.result-bar > em { display: block; height: 11px; overflow: hidden; border-radius: 99px; background: rgba(34,34,31,.07); }
.result-bar > em > i { display: block; height: 100%; border-radius: inherit; background: var(--chart-color); transition: width .3s; }
.scale-chart { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: end; }
.scale-average strong { display: block; font-family: Georgia,serif; font-size: 3.4rem; font-weight: 500; line-height: 1; }
.scale-average span { color: var(--muted); font-size: .68rem; }
.scale-columns { display: grid; grid-template-columns: repeat(5,1fr); gap: clamp(7px,1.5vw,14px); height: 160px; }
.scale-column { display: grid; grid-template-rows: 20px 1fr 20px; gap: 4px; text-align: center; }
.scale-column > b { font-size: .72rem; }
.scale-column > i { position: relative; overflow: hidden; border-radius: 7px 7px 3px 3px; background: rgba(34,34,31,.06); }
.scale-column > i > span { position: absolute; right: 0; bottom: 0; left: 0; min-height: 3px; border-radius: inherit; background: var(--chart-color); transition: height .35s; }
.scale-column > em { font-style: normal; font-size: .75rem; font-weight: 800; }
.chart-color-0 { --chart-color: #df8a6f; }.chart-color-1 { --chart-color: #e3b85b; }.chart-color-2 { --chart-color: #72b391; }.chart-color-3 { --chart-color: #65a0ca; }.chart-color-4 { --chart-color: #9a78b7; }
.text-responses { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: .75rem; }
.text-responses span { padding: 7px 10px; border-radius: 999px; color: var(--ink); background: rgba(115,84,143,.1); }
.word-cloud { min-height: 145px; display: flex; align-content: center; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px 14px; padding: 14px; line-height: 1; text-align: center; }
.word-cloud span { color: var(--chart-color); font-weight: 750; letter-spacing: -.025em; }
.text-response-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.text-response-details summary { color: var(--muted); cursor: pointer; font-size: .72rem; font-weight: 750; }
.text-response-details .text-responses { margin-top: 10px; }

.vote-shell { width: min(680px,calc(100% - 28px)); margin: 0 auto; padding: max(30px,env(safe-area-inset-top)) 0 50px; }
.vote-header { margin-bottom: 24px; }
.vote-header h1 { margin: 20px 0 7px; font-size: clamp(2.3rem,11vw,4.4rem); line-height: .95; }
.vote-header p { color: var(--muted); }
.vote-question { margin: 0 0 16px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.9); box-shadow: 0 8px 24px rgba(64,53,37,.06); }
.vote-question legend { width: 100%; padding: 0 0 15px; font-weight: 750; line-height: 1.4; }
.vote-question legend span { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 7px; border-radius: 50%; color: white; background: #73548f; font-size: .7rem; }
.vote-option { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.vote-option input { width: 18px; min-height: auto; }
.vote-scale { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; }
.vote-scale input { position: absolute; opacity: 0; }
.vote-scale span { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; font-weight: 800; }
.vote-scale input:checked + span { color: white; border-color: #73548f; background: #73548f; }
.vote-submit { width: 100%; }
.public-results { margin-top: 26px; }
.public-results h2 { font-family: Georgia,serif; font-size: 1.8rem; font-weight: 500; }
.public-result-card { margin-bottom: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,248,.9); }
.public-result-card h3 { margin-bottom: 16px; font-family: system-ui,sans-serif; font-size: .95rem; }
.public-scale { height: 130px; }
.vote-again { display: block; margin-top: 14px; }
@media(max-width:800px){.poll-topbar{grid-template-columns:1fr;}.poll-actions{justify-content:flex-start}.poll-workspace{grid-template-columns:1fr}.poll-editor{border-right:0;border-bottom:1px solid var(--line)}.poll-topbar h1{white-space:normal}.poll-result-card{grid-template-columns:1fr;min-height:0}.scale-chart{grid-template-columns:1fr}.scale-columns{height:140px}}

.admin-link { display: inline-flex; align-items: center; text-decoration: none; }
.admin-start-page { min-height: 100vh; }
.admin-login-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.admin-login-card { width: min(100%, 470px); padding: clamp(28px, 6vw, 46px); border: 1px solid var(--line); border-radius: 24px; background: rgba(255,253,248,.94); box-shadow: var(--shadow); }
.admin-login-card h1 { margin: 22px 0 12px; font-size: clamp(2.8rem, 9vw, 4.8rem); line-height: .95; }
.admin-login-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
.admin-login-card form { display: grid; gap: 16px; }
.admin-login-card .submit-button { width: 100%; }
.admin-login-card > .back-link { display: inline-block; margin-top: 24px; }
.admin-shell { padding-bottom: 70px; }
.admin-header > div { display: grid; gap: 18px; }
.admin-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.admin-intro h1 { margin: 8px 0 12px; font-size: clamp(3rem, 8vw, 6rem); }
.admin-intro p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.6; }
.admin-user-grid { display: grid; gap: 16px; }
.admin-user-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.88); box-shadow: 0 8px 24px rgba(64,53,37,.05); }
.admin-user-card.inactive { opacity: .68; }
.admin-user-heading, .admin-user-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-user-heading span:first-child { color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.admin-user-heading h2 { margin: 5px 0 3px; font-family: Georgia,serif; font-size: 1.5rem; font-weight: 500; }
.admin-user-heading code { color: var(--muted); font-size: .75rem; }
.account-state { padding: 5px 9px; border-radius: 999px; color: #7a4945; background: #f5ded9; font-size: .65rem; font-weight: 800; }
.account-state.active { color: #24533f; background: #dceee2; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(90px,1fr)); gap: 10px; margin: 24px 0; }
.admin-stats > div { display: grid; gap: 3px; padding: 14px; border-radius: 12px; background: rgba(34,34,31,.04); }
.admin-stats strong { font-family: Georgia,serif; font-size: 1.8rem; font-weight: 500; }
.admin-stats span, .admin-user-footer > span { color: var(--muted); font-size: .7rem; }
.admin-user-footer { align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-user-footer > div { display: flex; gap: 7px; }
.admin-user-footer button { min-height: 34px; padding: 8px 11px; font-size: .67rem; }
@media(max-width:650px){.admin-intro{align-items:flex-start;flex-direction:column}.admin-stats{grid-template-columns:repeat(2,1fr)}.admin-user-footer{align-items:flex-start;flex-direction:column}.admin-user-footer>div{flex-wrap:wrap}}
