:root {
    --paper: #f4efe3;
    --card: #fffdf7;
    --ink: #17150f;
    --ink-2: #5d564a;
    --ink-3: #948c7c;
    --edge: #17150f;
    --red: #e04b4b;
    --blue: #2f6feb;
    --green: #2f9e5f;
    --yellow: #f2c14e;
    --purple: #8a5cf6;
    --pink: #d5559b;
    --hard: 3px 3px 0 var(--edge);
    --hard-sm: 2px 2px 0 var(--edge);
    --hard-lg: 5px 5px 0 var(--edge);
    --font: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
    --hand: "Caveat", "Segoe Script", "Bradley Hand", cursive;
    --topbar: 58px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

.scribble {
    font-family: var(--hand);
    font-size: 44px;
    line-height: 0.95;
    letter-spacing: 0;
}

.muted {
    color: var(--ink-2);
    font-size: 13px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 2px solid var(--edge);
    border-radius: 10px;
    background: var(--card);
    box-shadow: var(--hard-sm);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}

.btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--hard);
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 var(--edge);
}

.btn-primary {
    background: var(--yellow);
}

.btn-ghost {
    background: transparent;
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-tiny {
    padding: 5px 11px;
    font-size: 13px;
    border-radius: 8px;
}

.flash {
    border: 2px solid var(--edge);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 0 0 14px;
    font-size: 14px;
    box-shadow: var(--hard-sm);
}

.flash-error {
    background: #fbdcdc;
}

.flash-ok {
    background: #d9f0e0;
}

.flash-warn {
    background: #fdf0cd;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field > span {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 11px 13px;
    border: 2px solid var(--edge);
    border-radius: 10px;
    background: #fff;
    outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    box-shadow: var(--hard-sm);
    background: #fffdf2;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.rule {
    border: none;
    border-top: 2px dashed #cfc6b2;
    margin: 26px 0;
}

.tape {
    position: absolute;
    width: 108px;
    height: 26px;
    background: rgba(242, 193, 78, .65);
    border-left: 1px dashed rgba(0, 0, 0, .14);
    border-right: 1px dashed rgba(0, 0, 0, .14);
    top: -13px;
}

.tape-left {
    left: 22px;
    transform: rotate(-4deg);
}

.gate {
    display: grid;
    place-items: center;
    min-height: 100%;
    background:
        radial-gradient(circle at 1px 1px, rgba(23, 21, 15, .13) 1px, transparent 0) 0 0 / 22px 22px,
        var(--paper);
}

.gate-wrap {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 32px;
}

.gate-art {
    width: 320px;
    flex: none;
}

.gate-art svg {
    width: 100%;
}

.gate-card {
    position: relative;
    width: 350px;
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: 16px;
    box-shadow: var(--hard-lg);
    padding: 34px 30px 26px;
}

.gate-sub {
    margin: 2px 0 20px;
    color: var(--ink-2);
    font-size: 14px;
}

.gate-foot {
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--ink-3);
    text-align: center;
}

.sheet {
    background:
        radial-gradient(circle at 1px 1px, rgba(23, 21, 15, .12) 1px, transparent 0) 0 0 / 22px 22px,
        var(--paper);
    min-height: 100%;
}

.sheet-wrap {
    max-width: 620px;
    margin: 0 auto;
    padding: 34px 20px 70px;
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 14px;
    text-decoration: none;
    color: var(--ink-2);
}

.back-link:hover {
    color: var(--ink);
}

.back-link.is-locked {
    color: var(--ink-3);
    cursor: default;
}

.back-link.is-locked::before {
    content: "○ ";
}

.sheet-card {
    position: relative;
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: 16px;
    box-shadow: var(--hard-lg);
    padding: 34px 30px;
}

.sheet-card .scribble {
    margin-bottom: 16px;
}

.sheet-card h2 {
    font-size: 17px;
    margin-bottom: -4px;
}

.color-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.color-dot {
    cursor: pointer;
}

.color-dot input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-dot i {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--c);
    border: 2px solid var(--edge);
}

.color-dot input:checked + i {
    box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--edge);
}

.app {
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar);
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 14px;
    background: var(--card);
    border-bottom: 2px solid var(--edge);
    position: relative;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    flex: none;
}

.brand-blob {
    width: 26px;
    height: 26px;
    border-radius: 9px 11px 8px 12px;
    background: var(--yellow);
    border: 2px solid var(--edge);
    transform: rotate(-6deg);
}

.brand-text {
    font-family: var(--hand);
    font-size: 27px;
    line-height: 1;
    padding-top: 4px;
}

.board-picker {
    position: relative;
}

.board-name {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 500;
}

.board-name:hover {
    border-color: var(--edge);
    background: var(--paper);
}

.caret {
    width: 15px;
    height: 15px;
}

.lock-tag {
    font-size: 11px;
    background: var(--red);
    color: #fff;
    padding: 1px 6px;
    border-radius: 20px;
}

.board-menu {
    position: absolute;
    top: 44px;
    left: 0;
    min-width: 220px;
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: 12px;
    box-shadow: var(--hard);
    padding: 6px;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.board-menu[hidden] {
    display: none;
}

.board-menu a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

.board-menu a:hover {
    background: var(--paper);
}

.board-menu a.is-current {
    background: var(--yellow);
}

.board-menu small {
    color: var(--ink-3);
    font-size: 11px;
}

.board-menu-add {
    border-top: 2px dashed #ddd4c0;
    margin-top: 4px;
    padding-top: 10px !important;
    color: var(--ink-2);
}

.crew-strip {
    display: flex;
    align-items: center;
    margin-left: 4px;
    flex: 1;
    min-width: 0;
}

.crew-strip .avatar {
    margin-left: -8px;
    transition: transform .12s ease;
}

.crew-strip .avatar:first-child {
    margin-left: 0;
}

.crew-strip .avatar:hover {
    transform: translateY(-3px);
    z-index: 2;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--who, var(--blue));
    color: #fff;
    border: 2px solid var(--edge);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    flex: none;
    position: relative;
}

.avatar.is-idle {
    filter: grayscale(1);
    opacity: .5;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.pulse {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-3);
}

.pulse i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(47, 158, 95, .6);
    animation: beat 2.4s infinite;
}

.pulse.is-down i {
    background: var(--red);
    animation: none;
}

.pulse.is-down em {
    color: var(--red);
}

.pulse em {
    font-style: normal;
}

@keyframes beat {
    0% { box-shadow: 0 0 0 0 rgba(47, 158, 95, .55); }
    70% { box-shadow: 0 0 0 7px rgba(47, 158, 95, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 158, 95, 0); }
}

.me-chip {
    position: relative;
}

.me-menu {
    position: absolute;
    right: 0;
    top: 42px;
    min-width: 160px;
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: 12px;
    box-shadow: var(--hard);
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
}

.me-chip:hover .me-menu,
.me-menu:hover {
    display: flex;
}

.me-menu strong {
    font-size: 13px;
    padding-bottom: 6px;
    border-bottom: 2px dashed #ddd4c0;
    margin-bottom: 4px;
}

.me-menu a {
    padding: 6px 8px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 14px;
}

.me-menu a:hover {
    background: var(--paper);
}

.stage {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

.canvas-host {
    position: relative;
    flex: 1;
    overflow: hidden;
    background-color: var(--paper);
    touch-action: none;
    cursor: crosshair;
}

.canvas-host[data-cursor="select"] {
    cursor: default;
}

.canvas-host[data-cursor="grab"] {
    cursor: grab;
}

.canvas-host[data-cursor="grabbing"] {
    cursor: grabbing;
}

.canvas-host[data-cursor="erase"] {
    cursor: cell;
}

#ink {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.objects,
.cursors {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transform-origin: 0 0;
}

.cursors {
    z-index: 30;
}

.canvas-host[data-tool="select"] .note,
.canvas-host[data-tool="select"] .text-item {
    pointer-events: auto;
}

.note {
    position: absolute;
    pointer-events: none;
    border: 2px solid var(--edge);
    border-radius: 3px;
    box-shadow: 4px 5px 0 rgba(23, 21, 15, .18);
    padding: 12px 13px;
    font-size: 16px;
    line-height: 1.35;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    transform-origin: 50% 0;
    background: var(--yellow);
}

.note:focus {
    outline: none;
    box-shadow: 4px 5px 0 rgba(23, 21, 15, .18), 0 0 0 3px rgba(47, 111, 235, .35);
}

.note::before {
    content: "";
    position: absolute;
    top: -9px;
    left: 50%;
    width: 54px;
    height: 16px;
    transform: translateX(-50%) rotate(-3deg);
    background: rgba(255, 255, 255, .5);
    border-left: 1px dashed rgba(0, 0, 0, .12);
    border-right: 1px dashed rgba(0, 0, 0, .12);
}

.text-item {
    position: absolute;
    pointer-events: none;
    font-family: var(--hand);
    line-height: 1.15;
    white-space: pre-wrap;
    word-break: break-word;
    min-width: 20px;
    padding: 2px 4px;
    border-radius: 4px;
}

.text-item:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(47, 111, 235, .5);
    background: rgba(255, 255, 255, .6);
}

.objects .is-picked {
    box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--blue);
}

.cursor {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: flex-start;
    gap: 2px;
    transition: transform .09s linear;
    will-change: transform;
}

.cursor svg {
    width: 20px;
    height: 20px;
    flex: none;
    filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .3));
}

.cursor span {
    margin-top: 12px;
    background: var(--who);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1.5px solid var(--edge);
    white-space: nowrap;
}

.cursor.is-drawing span::after {
    content: " ✎";
}

.board-toast {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fdfbf4;
    padding: 9px 18px;
    border-radius: 30px;
    font-size: 13px;
    z-index: 60;
}

.dock {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: 16px;
    box-shadow: var(--hard);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 25;
}

.dock-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dock-rule {
    height: 2px;
    background: #e4dcc8;
    margin: 5px 3px;
    border-radius: 2px;
}

.tool {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 2px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    color: var(--ink);
}

.tool svg {
    width: 21px;
    height: 21px;
}

.tool:hover {
    background: var(--paper);
}

.tool.is-active {
    background: var(--yellow);
    border-color: var(--edge);
    box-shadow: var(--hard-sm);
}

.tool-danger:hover {
    background: #fbdcdc;
    color: var(--red);
}

.swatches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 2px;
}

.swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--c);
    border: 2px solid var(--edge);
    cursor: pointer;
    padding: 0;
}

.swatch.is-active {
    box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--edge);
}

.sizes {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 4px 2px 2px;
}

.nib {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
}

.nib i {
    width: var(--d);
    height: var(--d);
    border-radius: 50%;
    background: var(--ink);
    display: block;
}

.nib.is-active {
    background: var(--yellow);
    box-shadow: inset 0 0 0 2px var(--edge);
}

.zoombar {
    position: absolute;
    right: 356px;
    bottom: 18px;
    display: flex;
    align-items: center;
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: 12px;
    box-shadow: var(--hard-sm);
    overflow: hidden;
    z-index: 25;
    transition: right .25s ease;
}

.stage.panel-hidden .zoombar {
    right: 18px;
}

.zoombar button {
    border: none;
    background: transparent;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 15px;
    min-width: 40px;
}

.zoombar button:hover {
    background: var(--paper);
}

.zoombar button + button {
    border-left: 2px solid #e4dcc8;
}

.panel {
    width: 340px;
    flex: none;
    background: var(--card);
    border-left: 2px solid var(--edge);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: margin-right .25s ease;
    z-index: 26;
}

.panel.is-hidden {
    margin-right: -340px;
}

.panel-grip {
    position: absolute;
    left: -26px;
    top: 22px;
    width: 26px;
    height: 46px;
    border: 2px solid var(--edge);
    border-right: none;
    border-radius: 10px 0 0 10px;
    background: var(--card);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
}

.panel-grip svg {
    width: 15px;
    height: 15px;
    transition: transform .25s ease;
}

.panel.is-hidden .panel-grip svg {
    transform: rotate(180deg);
}

.panel-tabs {
    display: flex;
    border-bottom: 2px solid var(--edge);
    flex: none;
}

.panel-tabs button {
    flex: 1;
    padding: 13px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    border-bottom: 3px solid transparent;
}

.panel-tabs button:hover {
    background: var(--paper);
}

.panel-tabs button.is-active {
    border-bottom-color: var(--ink);
    background: var(--paper);
}

.panel-tabs .dot {
    position: absolute;
    top: 9px;
    right: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    border: 1.5px solid var(--edge);
}

.pane {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
    gap: 14px;
}

.pane.is-active {
    display: flex;
}

.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
}

.cal-title {
    font-family: var(--hand);
    font-size: 26px;
    line-height: 1;
    padding-top: 4px;
}

.round {
    width: 30px;
    height: 30px;
    border: 2px solid var(--edge);
    border-radius: 50%;
    background: var(--card);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 17px;
    line-height: 1;
    padding: 0 0 3px;
}

.round:hover {
    background: var(--yellow);
}

.brush-row {
    flex: none;
}

.brush-label {
    font-size: 12px;
    color: var(--ink-3);
    display: block;
    margin-bottom: 6px;
}

.brush-chips {
    display: flex;
    gap: 6px;
}

.chip {
    flex: 1;
    padding: 6px 4px;
    border: 2px solid var(--edge);
    border-radius: 20px;
    background: var(--card);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.chip-free.is-active {
    background: #bfe8cd;
}

.chip-maybe.is-active {
    background: #fbe4a8;
}

.chip-busy.is-active {
    background: #f7c3c3;
}

.chip-none.is-active {
    background: #e2ddd0;
}

.chip.is-active {
    box-shadow: var(--hard-sm);
}

.cal-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 11px;
    color: var(--ink-3);
    text-align: center;
    flex: none;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: none;
    user-select: none;
}

.cal-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 2px solid #ddd4c0;
    border-radius: 9px;
    background: var(--card);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 2px;
}

.cal-cell:hover {
    border-color: var(--edge);
}

.cal-cell.is-out {
    opacity: .35;
}

.cal-cell.is-today {
    border-color: var(--edge);
    box-shadow: inset 0 0 0 2px var(--yellow);
}

.cal-cell.is-picked {
    box-shadow: var(--hard-sm);
    border-color: var(--edge);
}

.cal-cell.is-best::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 9px;
    border: 2px dashed var(--green);
    pointer-events: none;
}

.cal-num {
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
}

.cal-cell.mine-free {
    background: #d9f0e0;
}

.cal-cell.mine-maybe {
    background: #fdf0cd;
}

.cal-cell.mine-busy {
    background: #fbdcdc;
}

.cal-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    max-width: 100%;
}

.cal-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c);
    display: block;
    border: 1px solid rgba(0, 0, 0, .28);
}

.cal-dots i.is-maybe {
    opacity: .55;
}

.cal-dots i.is-busy {
    border-radius: 1px;
    transform: rotate(45deg);
    background: transparent;
    border-color: var(--c);
    border-width: 2px;
}

.cal-flag {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--red);
    border: 1px solid var(--edge);
}

.cal-tip {
    font-size: 12px;
    color: var(--ink-3);
    margin: -4px 0 0;
    flex: none;
}

.day-card {
    border: 2px solid var(--edge);
    border-radius: 12px;
    background: var(--paper);
    padding: 12px 14px;
    flex: none;
}

.day-card h4 {
    margin: 0 0 8px;
    font-family: var(--hand);
    font-size: 21px;
    font-weight: 700;
}

.day-line {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    padding: 3px 0;
}

.day-line .avatar {
    width: 22px;
    height: 22px;
    font-size: 9px;
}

.day-line b {
    font-weight: 500;
}

.day-tag {
    margin-left: auto;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 20px;
    border: 1.5px solid var(--edge);
}

.day-tag.free {
    background: #bfe8cd;
}

.day-tag.maybe {
    background: #fbe4a8;
}

.day-tag.busy {
    background: #f7c3c3;
}

.day-empty {
    font-size: 13px;
    color: var(--ink-3);
}

.meetups {
    flex: none;
}

.meetups-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.meetups-head h3 {
    font-family: var(--hand);
    font-size: 22px;
}

.meetup {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 2px solid var(--edge);
    border-radius: 11px;
    padding: 9px 11px;
    margin-bottom: 8px;
    background: var(--card);
    cursor: pointer;
    box-shadow: var(--hard-sm);
}

.meetup:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--hard);
}

.meetup-date {
    flex: none;
    text-align: center;
    border-right: 2px dashed #ddd4c0;
    padding-right: 10px;
    min-width: 42px;
}

.meetup-date b {
    display: block;
    font-size: 17px;
    line-height: 1;
}

.meetup-date span {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--ink-3);
}

.meetup-body strong {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

.meetup-body small {
    color: var(--ink-2);
    font-size: 12px;
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.msg .avatar {
    width: 26px;
    height: 26px;
    font-size: 10px;
}

.msg-body {
    background: var(--paper);
    border: 2px solid var(--edge);
    border-radius: 3px 12px 12px 12px;
    padding: 7px 11px;
    font-size: 14px;
    max-width: 80%;
    word-break: break-word;
}

.msg-body b {
    display: block;
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 500;
}

.msg.is-me {
    flex-direction: row-reverse;
}

.msg.is-me .msg-body {
    background: #fdf0cd;
    border-radius: 12px 3px 12px 12px;
}

.chat-empty {
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
    margin: auto 0;
}

.chat-form {
    display: flex;
    gap: 8px;
    flex: none;
}

.chat-form input {
    flex: 1;
    padding: 10px 13px;
    border: 2px solid var(--edge);
    border-radius: 20px;
    outline: none;
    background: #fff;
    min-width: 0;
}

.crew-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crew-card {
    display: flex;
    align-items: center;
    gap: 11px;
    border: 2px solid var(--edge);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--card);
    box-shadow: var(--hard-sm);
}

.crew-card .avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.crew-meta strong {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.crew-meta small {
    color: var(--ink-3);
    font-size: 12px;
}

.crew-badge {
    font-size: 10px;
    background: var(--ink);
    color: #fff;
    padding: 1px 6px;
    border-radius: 20px;
}

.crew-live {
    margin-left: auto;
    font-size: 11px;
    color: var(--green);
    font-weight: 500;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(23, 21, 15, .45);
    display: grid;
    place-items: center;
    z-index: 100;
    padding: 20px;
}

.modal[hidden] {
    display: none;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: 16px;
    box-shadow: var(--hard-lg);
    padding: 26px 24px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-card h2 {
    font-family: var(--hand);
    font-size: 30px;
    margin-bottom: 16px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink-2);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

.modal-actions .btn-ghost {
    margin-right: auto;
    color: var(--red);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d8cfba;
    border-radius: 10px;
    border: 2px solid var(--card);
}

::-webkit-scrollbar-thumb:hover {
    background: #c2b79c;
}

@media (max-width: 900px) {
    .gate-wrap {
        flex-direction: column;
        gap: 26px;
    }

    .gate-art {
        width: 200px;
    }

    .crew-strip {
        display: none;
    }

    .panel {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 300px;
        box-shadow: -6px 0 0 rgba(23, 21, 15, .1);
    }

    .panel.is-hidden {
        margin-right: -300px;
    }

    .zoombar {
        right: 316px;
    }

    .dock {
        flex-direction: row;
        left: 50%;
        top: auto;
        bottom: 14px;
        transform: translateX(-50%);
        max-width: calc(100vw - 24px);
        overflow-x: auto;
    }

    .dock-group {
        flex-direction: row;
    }

    .dock-rule {
        width: 2px;
        height: auto;
        margin: 3px 5px;
    }

    .swatches {
        grid-template-columns: repeat(3, 1fr);
    }

    .zoombar {
        bottom: 74px;
    }
}

@media (max-width: 620px) {
    .topbar {
        padding: 0 8px;
        gap: 8px;
    }

    .brand-blob {
        width: 21px;
        height: 21px;
    }

    .brand-text {
        font-size: 21px;
    }

    .board-name {
        max-width: 116px;
        padding: 5px 6px;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
    }

    .board-name .lock-tag {
        display: none;
    }

    .pulse em {
        display: none;
    }

    .topbar-right {
        gap: 6px;
        margin-left: auto;
    }

    .panel {
        width: calc(100vw - 52px);
    }

    .panel.is-hidden {
        margin-right: calc(52px - 100vw);
    }

    .zoombar {
        right: auto;
        left: 14px;
        bottom: 74px;
    }

    .stage.panel-hidden .zoombar {
        left: 14px;
        right: auto;
    }
}
