:root {
    --bg-board-texture: linear-gradient(140deg, #a96f3f 0%, #9a6336 45%, #84532f 100%);
    --board-overlay: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), transparent 40%);
    --note-shadow: 0 10px 16px rgba(25, 16, 7, 0.28);
    --note-border-radius: 10px;
    --pin-image: radial-gradient(circle at 30% 30%, #f9f9f9 0%, #e34b4b 42%, #891717 100%);
    --section-title-font: 'Patrick Hand', cursive;
    --default-note-font: 'Caveat', cursive;
    --label-bg: #f9ecc4;
    --label-text: #433321;
    --note-text: #3a2a19;
    --note-bg-sticky: #fff4a8;
    --note-bg-index: #fcf6ec;
    --note-bg-kraft: #e8cb98;
    --note-bg-receipt: #fffef7;
    --note-border-sticky: #e6d98e;
    --note-border-index: #e2d4c3;
    --note-border-kraft: #c39f68;
    --note-border-receipt: #d8d2bf;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--note-text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.display-body {
    min-height: 100vh;
    background: var(--bg-board-texture);
    background-image: var(--board-overlay), var(--bg-board-texture);
    padding: var(--safe-area-padding, 16px);
    overflow: hidden;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.board-wrap {
    max-width: 1820px;
    margin: 0 auto;
    height: calc(100vh - (var(--safe-area-padding, 16px) * 2));
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    transform: scale(var(--display-scale, 1));
    transform-origin: top center;
    position: relative;
}

.board-title {
    color: #fdf4db;
    text-align: center;
    text-shadow: 0 2px 4px rgba(40, 20, 10, 0.4);
}

.board-title h1 {
    margin: 0;
}

.plaque-title {
    display: inline-block;
    font-family: var(--section-title-font);
    font-size: clamp(1.6rem, 2vw, 3rem);
    letter-spacing: 0.04em;
    padding: 0.25rem 1.25rem;
    border-radius: 7px;
    transform: rotate(var(--title-tilt, -1deg));
    background: linear-gradient(170deg, #f8efce, #e8d7a7 80%);
    box-shadow: 0 6px 12px rgba(29, 16, 4, 0.3);
    border: 1px solid rgba(88, 58, 24, 0.45);
    color: #3f2d1b;
    position: relative;
}

.plaque-title::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: repeating-linear-gradient(35deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.03) 1px, transparent 1px, transparent 4px);
}

.board-title p {
    margin: 0.3rem 0 0;
    font-size: 0.98rem;
    opacity: 0.93;
}

.kiosk-tip {
    font-size: 0.8rem;
    opacity: 0.78;
}

.board-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    min-height: 0;
}

.board-mode-rotate_sections .board-grid {
    grid-template-columns: 1fr;
}

.freeform-board {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 16px;
}

.section-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 14px;
    padding: 0.45rem;
    background: linear-gradient(180deg, rgba(79, 52, 30, 0.16), rgba(79, 52, 30, 0.08));
    border: 1px solid rgba(255, 245, 220, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 -25px 40px rgba(0, 0, 0, 0.07);
}

.section-zone::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 11px;
    border: 1px dashed rgba(240, 213, 178, 0.12);
    pointer-events: none;
}

.section-zone.is-hidden-by-rotation {
    display: none;
}

.section-heading {
    margin-bottom: 0.42rem;
    z-index: 1;
}

.section-heading span {
    display: inline-block;
    padding: 0.17rem 0.7rem;
    border-radius: 2px;
    background: var(--label-bg);
    border-left: 6px solid var(--section-accent, #f7b267);
    box-shadow: 0 2px 5px rgba(30, 20, 10, 0.35);
    color: var(--label-text);
    font-family: var(--section-title-font);
    font-size: clamp(1.1rem, 1.25vw, 1.6rem);
}

.notes-cluster {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 0.35rem;
    overflow: auto;
    padding: 0.4rem 0.3rem 0.8rem;
    min-height: 0;
    align-content: start;
}

.note {
    position: relative;
    padding: 0.86rem 0.72rem 0.64rem;
    border-radius: var(--note-border-radius);
    box-shadow: var(--note-shadow);
    transform: translate(var(--note-offset-x, 0px), var(--note-offset-y, 0px)) rotate(var(--note-rotation, 0deg)) scale(var(--font-scale, 1));
    transform-origin: top center;
    border: 1px solid transparent;
    font-family: var(--default-note-font);
    color: var(--note-text);
    line-height: 1.1;
    z-index: 1;
}

.note + .note {
    margin-left: -0.2rem;
}

.freeform-note {
    position: absolute;
    left: calc(var(--layout-x, 0.4) * 100%);
    top: calc(var(--layout-y, 0.4) * 100%);
    z-index: var(--note-z, 1);
    transform: translate(0, 0) rotate(var(--note-rotation, 0deg)) scale(calc(var(--font-scale, 1) * var(--layout-scale, 1)));
    margin-left: 0;
}

.freeform-note::before {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    top: -6px;
    height: 8px;
    border-radius: 4px;
/*    background: color-mix(in oklab, var(--section-accent, #f7b267) 70%, #fff);*/
    opacity: 0.75;
}

.note::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.22), transparent 45%);
}

.note h3 {
    margin: 0 0 0.25rem;
    font-size: clamp(1.1rem, 1.42vw, 1.55rem);
    line-height: 1.05;
}

.note p {
    margin: 0.2rem 0;
    font-size: clamp(0.94rem, 1.05vw, 1.2rem);
}

.note-meta {
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.note-meta .due {
    font-size: 0.78rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    opacity: 0.82;
}

.note-pin {
    position: absolute;
    top: -8px;
    left: calc(50% - 8px);
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--pin-image);
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.freeform-note .note-pin {
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--section-accent, #f7b267) 35%, transparent), 0 1px 2px rgba(0, 0, 0, 0.35);
}

.ownership-tag {
    position: absolute;
    right: 0.5rem;   /* Moved from left */
    bottom: 0.4rem;  /* Moved from top: -0.7rem */
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: color-mix(in oklab, var(--section-accent, #f7b267) 20%, rgba(255,255,255,0.9));
    color: #3d2a16;
    border: 1px solid rgba(61, 42, 22, 0.15);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-family: 'Patrick Hand', cursive;
    z-index: 2; /* Ensures it sits above note background */
}

.complete-stamp {
    position: absolute;
    right: 0.28rem;
    top: 0.34rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.62rem;
    border: 2px solid color-mix(in oklab, var(--section-accent, #4a9f63) 70%, #1f5e35);
    color: color-mix(in oklab, var(--section-accent, #4a9f63) 70%, #113d21);
    background: rgba(255, 255, 255, 0.2);
    padding: 0.05rem 0.22rem;
    border-radius: 4px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transform: rotate(var(--stamp-rotation, -5deg));
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.complete-stamp::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06) 1px, transparent 1px, transparent 3px);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.is-complete {
/*    opacity: 0.76;*/
}

.is-complete h3,
.is-complete p {
    text-decoration: line-through;
    text-decoration-thickness: 1.2px;
}

.overdue-badge {
    position: absolute;
    left: 0.36rem;
    top: 0.32rem;
    font-size: 0.62rem;
    color: #7d2b1d;
    border-radius: 2px;
    border: 1px solid #d06b56;
    background: linear-gradient(180deg, #ffe8df, #ffd0bf);
    padding: 0.03rem 0.22rem;
    transform: rotate(-7deg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.note-style-sticky {
    background: var(--note-bg-sticky);
    border-color: var(--note-border-sticky);
}

.note-style-index {
    background: repeating-linear-gradient(180deg, var(--note-bg-index), var(--note-bg-index) 18px, #dce8ff 18px, #dce8ff 19px);
    border-color: var(--note-border-index);
}

.note-style-kraft {
    background: linear-gradient(170deg, #f0d8af, var(--note-bg-kraft));
    border-color: var(--note-border-kraft);
}

.note-style-receipt {
    background: var(--note-bg-receipt);
    border-color: var(--note-border-receipt);
    clip-path: polygon(0 0, 100% 0, 100% 95%, 96% 100%, 92% 95%, 88% 100%, 84% 95%, 80% 100%, 76% 95%, 72% 100%, 68% 95%, 64% 100%, 60% 95%, 56% 100%, 52% 95%, 48% 100%, 44% 95%, 40% 100%, 36% 95%, 32% 100%, 28% 95%, 24% 100%, 20% 95%, 16% 100%, 12% 95%, 8% 100%, 4% 95%, 0 100%);
}

.note-size-compact {
    min-height: 112px;
}

.note-size-regular {
    min-height: 142px;
}

.note-size-large {
    min-height: 180px;
    grid-column: span 2;
}

.freeform-note.note-size-compact {
    width: 230px;
    min-height: 130px;
}

.freeform-note.note-size-regular {
    width: 290px;
    min-height: 180px;
}

.freeform-note.note-size-large {
    width: 340px;
    min-height: 255px;
    grid-column: auto;
}

.note-variant-sticky-yellow {
    filter: saturate(1.03);
}

.note-variant-paper-torn-edges {
    clip-path: polygon(0 0, 100% 0, 100% 95%, 96% 97%, 92% 95%, 88% 98%, 84% 95%, 80% 99%, 76% 95%, 72% 98%, 68% 95%, 64% 99%, 60% 95%, 56% 98%, 52% 95%, 48% 99%, 44% 95%, 40% 98%, 36% 95%, 32% 99%, 28% 95%, 24% 98%, 20% 95%, 16% 99%, 12% 95%, 8% 98%, 4% 95%, 0 98%);
}

.note-variant-wide-lined-paper {
    background: repeating-linear-gradient(180deg, #fefefe, #fefefe 19px, #d7e6ff 19px, #d7e6ff 20px);
}

.note-variant-kraft-soft {
    background: linear-gradient(175deg, #f2dfbc, #e2bf8a);
}

.note-variant-2 {
    filter: saturate(1.04) brightness(1.02);
}

.note-variant-3 {
    filter: saturate(0.96);
}

.empty-note {
    opacity: 0.92;
}

.note-image-wrap {
    margin-top: 0.35rem;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.note-image {
    display: block;
    width: 100%;
    height: 92px;
    object-fit: cover;
}

.debug-overlay {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 9999;
    display: grid;
    gap: 0.2rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.74rem;
    color: #fbf6e9;
    background: rgba(20, 12, 6, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.45rem 0.56rem;
}

.display-qr {
    position: absolute;
    right: 0.85rem;
    bottom: 0.4rem;
    z-index: 30;
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.65rem 0.5rem;
    border-radius: 14px;
    background: rgba(255, 252, 246, 0.94);
    border: 1px solid rgba(99, 73, 35, 0.22);
    box-shadow: 0 10px 24px rgba(32, 20, 8, 0.26);
    backdrop-filter: blur(2px);
}

.display-qr-code {
    width: 92px;
    height: 92px;
}

.display-qr-code img,
.display-qr-code canvas {
    display: block;
    width: 92px;
    height: 92px;
}

.display-qr-label {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a341d;
}

.font-patrick-hand {
    font-family: 'Patrick Hand', cursive;
}

.font-caveat {
    font-family: 'Caveat', cursive;
}

.font-kalam {
    font-family: 'Kalam', cursive;
}

.font-homemade-apple {
    font-family: 'Homemade Apple', cursive;
}

.font-gloria-hallelujah {
    font-family: 'Gloria Hallelujah', cursive;
}

.font-indie-flower {
    font-family: 'Indie Flower', cursive;
}

.font-shadows-into-light {
    font-family: 'Shadows Into Light', cursive;
}

.admin-body {
    background: linear-gradient(180deg, #f0f4f8, #e2e8f0);
    min-height: 100vh;
    color: #1e293b;
}

.admin-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.admin-brand {
    text-decoration: none;
    color: #0f172a;
    font-weight: 800;
    font-size: 1.15rem;
}

.admin-nav {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.admin-nav a {
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    transition: color 0.15s;
}

.admin-nav a:hover {
    color: #1e293b;
}

.panel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(51, 65, 85, 0.08);
}

.panel.narrow {
    max-width: 440px;
    margin: 2rem auto;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.flash {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 9px;
    padding: 0.55rem 0.7rem;
    color: #1e40af;
}

.muted {
    color: #64748b;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.46rem 0.7rem;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.btn-primary {
    background: #3b82f6;
    border-color: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #1d4ed8;
}

.btn-danger {
    background: #ef4444;
    border-color: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #b91c1c;
}

.section-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.section-card {
    display: block;
    text-decoration: none;
    padding: 0.95rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(150deg, #ffffff, color-mix(in oklab, var(--card-accent, #f7b267) 14%, white));
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(51, 65, 85, 0.07);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.section-card:hover {
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.12);
    border-color: #94a3b8;
}

.section-card strong {
    display: block;
    font-size: 1.1rem;
}

.item-list {
    margin-top: 1rem;
    display: grid;
    gap: 0.7rem;
}

.item-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.7rem;
    background: #ffffff;
}

.item-row h3 {
    margin: 0 0 0.35rem;
}

.row-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 132px;
}

.toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.toggle-chip:hover {
    background: #e2e8f0;
}

.toggle-chip input {
    margin: 0;
}

.inline-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stack-form {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.75rem;
}

.stack-form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
    padding: 0.52rem 0.58rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font: inherit;
    background: #f8fafc;
    transition: border-color 0.15s;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.icon-picker-details {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
}

.icon-picker-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    font-weight: 600;
    background: #f8fafc;
    user-select: none;
    list-style: none;
}

.icon-picker-summary::-webkit-details-marker {
    display: none;
}

.icon-picker-summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: #64748b;
    transition: transform 0.2s;
}

.icon-picker-details[open] > .icon-picker-summary::after {
    transform: rotate(180deg);
}

.icon-picker-current {
    font-weight: 400;
    font-size: 0.85rem;
    color: #64748b;
}

.icon-picker-content {
    padding: 0.6rem;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.55rem;
}

.icon-choice {
    display: grid;
    justify-items: center;
    gap: 0.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.15rem;
    background: #f8fafc;
    font-size: 0.62rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.icon-choice:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.icon-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.icon-choice i {
    font-size: 1rem;
}

.icon-choice.is-active {
    border-color: #3b82f6;
    box-shadow: inset 0 0 0 1px #3b82f6;
    background: #eff6ff;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.admin-preview-image {
    width: 140px;
    height: 94px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

/* --- Font Picker --- */

.field-label {
    font-weight: 600;
}

.font-picker-group {
    display: grid;
    gap: 0.35rem;
}

.font-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

.font-pick {
    display: block;
    width: 100%;
    padding: 0.5rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 1.05rem;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.font-pick:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.font-pick.is-active {
    border-color: #3b82f6;
    box-shadow: inset 0 0 0 1px #3b82f6;
    background: #eff6ff;
}

/* --- Note Style Picker --- */

.note-style-picker-group {
    display: grid;
    gap: 0.35rem;
}

.note-style-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.note-style-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.3rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    transition: border-color 0.15s, background 0.15s;
}

.note-style-pick:hover {
    border-color: #94a3b8;
}

.note-style-pick.is-active {
    border-color: #3b82f6;
    box-shadow: inset 0 0 0 1px #3b82f6;
    background: #eff6ff;
}

.note-style-swatch {
    width: 42px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.note-style-swatch-sticky {
    background: var(--note-bg-sticky, #fff4a8);
}

.note-style-swatch-index {
    background: repeating-linear-gradient(180deg, var(--note-bg-index, #fcf6ec), var(--note-bg-index, #fcf6ec) 6px, #dce8ff 6px, #dce8ff 7px);
}

.note-style-swatch-kraft {
    background: linear-gradient(170deg, #f0d8af, var(--note-bg-kraft, #e8cb98));
}

.note-style-swatch-receipt {
    background: var(--note-bg-receipt, #fffef7);
    clip-path: polygon(0 0, 100% 0, 100% 80%, 88% 95%, 76% 80%, 64% 95%, 52% 80%, 40% 95%, 28% 80%, 16% 95%, 0 80%);
}

/* --- Live Preview --- */

.item-form-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.2rem;
    align-items: start;
}

.item-form-preview-col {
    order: 2;
    position: sticky;
    top: 1rem;
}

.item-form-form-col {
    order: 1;
    min-width: 0;
}

.preview-wrapper {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.8rem;
    background: #f8fafc;
}

.preview-heading {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 700;
}

.preview-board {
    padding: 1.4rem 0.8rem;
    border-radius: 10px;
    background: var(--bg-board-texture, linear-gradient(140deg, #a96f3f, #84532f));
    background-image: var(--board-overlay, none), var(--bg-board-texture, linear-gradient(140deg, #a96f3f, #84532f));
    background-size: cover;
    display: flex;
    justify-content: center;
    min-height: 180px;
    align-items: flex-start;
}

.preview-board .note {
    position: relative;
    transform: rotate(-1.5deg) scale(var(--font-scale, 1));
    max-width: 240px;
    width: 100%;
    min-height: 120px;
}

.preview-board .note .ownership-tag {
    position: static;
    display: inline-block;
}

@media (max-width: 1200px) {
    .board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .display-body {
        overflow: auto;
    }

    .board-wrap {
        height: auto;
        transform: none;
    }

    .display-qr {
        position: fixed;
        right: 12px;
        bottom: 12px;
    }
}

@media (max-width: 760px) {
    .board-grid {
        grid-template-columns: 1fr;
    }

    .notes-cluster {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-size-large {
        grid-column: span 1;
    }

    .freeform-board {
        overflow: auto;
        min-height: 900px;
    }

    .freeform-note.note-size-compact,
    .freeform-note.note-size-regular,
    .freeform-note.note-size-large {
        width: 220px;
    }

    .section-cards,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .item-row {
        flex-direction: column;
    }

    .row-actions {
        min-width: 0;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .icon-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .item-form-layout {
        grid-template-columns: 1fr;
    }

    .item-form-preview-col {
        order: -1;
        position: static;
    }

    .font-picker-grid {
        grid-template-columns: 1fr;
    }

    .note-style-picker-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .display-qr {
        right: 10px;
        bottom: 10px;
        padding: 0.5rem 0.5rem 0.4rem;
    }

    .display-qr-code,
    .display-qr-code img,
    .display-qr-code canvas {
        width: 78px;
        height: 78px;
    }
}
