:root { color-scheme: light; --ink: #38291d; --cream: #ead6ad; --muted: #c5ad8f; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0; min-height: 100vh; color: var(--cream); font-family: Georgia, 'Times New Roman', serif;
    background: radial-gradient(ellipse at 50% 0, #74503a66, transparent 70%), #20150f;
}
body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background: repeating-linear-gradient(2deg, transparent 0 4px, #130b0620 5px, transparent 6px 14px),
        repeating-linear-gradient(90deg, #39241b 0, #4c3123 90px, #39241b 168px, #170e0a 169px, #170e0a 173px);
    opacity: .65;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; transition: background .15s, transform .15s; }
button:disabled { cursor: wait; opacity: .5; }
button:active:not(:disabled) { transform: translateY(1px); }
:focus-visible { outline: 3px solid #bd8e46; outline-offset: 4px; }
.board-frame { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.site-header { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 26px 0; border-bottom: 1px solid #c5ad8f33; }
.home-link { color: var(--cream); text-decoration: none; font-size: 18px; white-space: nowrap; }
.home-link:hover { text-decoration: underline; }
.identity { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font: 14px/1.5 system-ui, sans-serif; }
.identity strong { color: #ffe5b7; overflow-wrap: anywhere; }
.masthead { text-align: center; padding: 52px 0 22px; }
.eyebrow { font: 11px/1.5 system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: clamp(36px, 5vw, 62px); font-weight: normal; line-height: 1.1; margin: 15px 0 18px; text-shadow: 0 3px 8px #0006; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 16px; color: #b88d51; font-size: 11px; }
.ornament::before, .ornament::after { content: ''; width: 85px; height: 1px; background: linear-gradient(90deg, transparent, #b88d5180); }
.ornament::after { transform: rotate(180deg); }
#view-hint { color: var(--muted); font-size: 17px; font-style: italic; margin: 18px 0 0; }
.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 0 0; }
.primary, .secondary, .quiet, .paper-button { border-radius: 3px; padding: 12px 18px; font: 14px/1.4 system-ui, sans-serif; }
.primary { color: #302016; background: #d7b77c; border: 1px solid #e5c997; box-shadow: 0 3px 8px #0002; }
.primary:hover:not(:disabled) { background: #ebcb90; }
.quiet { border: 1px solid #b897684f; color: var(--cream); background: #251a1455; }
.quiet:hover:not(:disabled) { background: #b8976820; }
.status-area { text-align: center; padding: 8px 0; font: 14px/1.5 system-ui, sans-serif; }
#status { margin: 8px 0; min-height: 1.5em; color: #e4d4bc; }
#status.error { color: #ffbcaa; }
.storage-status { text-align: center; font: 13px/1.5 system-ui, sans-serif; color: #ffd68a; }
.storage-status:empty { display: none; }
.board-caption { display: flex; justify-content: space-between; color: #cbb698; padding: 0 0 20px; font: 11px/1.5 system-ui, sans-serif; letter-spacing: .15em; text-transform: uppercase; }
.notice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; align-items: start; padding: 5px 4px 50px; }
.paper { position: relative; color: var(--ink); background: #eddfbe; background-image: radial-gradient(ellipse at 20% 0, #fff6de88, transparent 65%), repeating-linear-gradient(35deg, #8c663306 0 1px, transparent 1px 4px); box-shadow: 3px 8px 14px #0005, inset 0 0 32px #98632812; }
.notice { padding: 32px 25px 22px; transform: rotate(-1.2deg); border-radius: 1px 1px 6px 2px; display: flex; flex-direction: column; min-height: 300px; }
.notice:nth-child(4n+2) { background-color: #dfcfac; transform: rotate(1.4deg); margin-top: 12px; }
.notice:nth-child(4n+3) { background-color: #eee7d5; transform: rotate(-.6deg); }
.notice:nth-child(4n) { background-color: #d8d0b2; transform: rotate(1deg); }
.paper::before { content: ''; position: absolute; top: 11px; left: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c8b59a, #665040 60%, #342217); box-shadow: 1px 2px 2px #0006; }
.paper::after { content: ''; position: absolute; right: 0; top: 0; width: 20px; height: 20px; background: linear-gradient(225deg, #3d291c 49%, #bfae8d 50%, #f1e3c6 70%); }
.paper-kicker { font: 10px/1.5 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .15em; color: #796443; margin: 0 0 13px; }
.notice-body { font-size: 18px; line-height: 1.6; margin: 0 0 20px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 250px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #9e8053 transparent; padding-right: 8px; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid #82643838; padding-top: 15px; margin-top: 16px; }
.paper-button { border: 1px solid #80603f; background: transparent; color: #49341e; padding: 9px 12px; }
.paper-button:hover:not(:disabled) { background: #87633815; }
.edit-button { border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.empty-board { text-align: center; padding: 55px 16px 80px; border: 1px dashed #c5ad8f44; margin: 0 0 42px; color: var(--muted); }
.empty-board > span { font-size: 40px; color: #bd9962; }
.empty-board h2 { font-size: 26px; font-weight: normal; color: var(--cream); }
.empty-board p { max-width: 440px; margin: 0 auto; font-size: 17px; line-height: 1.5; }
.current { max-width: 780px; margin: 0 auto 45px; }
.collection { margin: 0 auto 45px; }
.writing-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 30px; align-items: start; }
.writing-layout:has(.editor-panel[hidden]) { grid-template-columns: minmax(0,780px); justify-content: center; }
.writing-layout .current-paper { padding: 36px 30px; }
.editor-panel { background: #eee2c7; color: var(--ink); padding: 26px; border-radius: 3px; }
.editor-panel h2 { font-size: 25px; font-weight: normal; margin: 0 0 14px; }
.editor-panel .ql-toolbar { background: #f4ead6; border-color: #bca580; }
.editor-panel .ql-container { border-color: #bca580; background: #fffaf0; min-height: 280px; }
.editor-panel .ql-editor { min-height: 280px; max-height: 480px; font: 18px/1.6 Georgia, 'Times New Roman', serif; }
.editor-panel .ql-picker.ql-header .ql-picker-label::before, .editor-panel .ql-picker.ql-header .ql-picker-item::before { content: 'Абзац'; }
.editor-panel .ql-picker.ql-header [data-value="1"]::before { content: 'Крупный'; }
.editor-panel .ql-picker.ql-header [data-value="2"]::before { content: 'Средний'; }
.editor-panel .ql-picker.ql-header [data-value="3"]::before { content: 'Малый'; }
.editor-panel .ql-picker.ql-size .ql-picker-label::before, .editor-panel .ql-picker.ql-size .ql-picker-item::before { content: 'Обычный'; }
.editor-panel .ql-picker.ql-size [data-value="small"]::before { content: 'Мелкий'; }
.editor-panel .ql-picker.ql-size [data-value="large"]::before { content: 'Крупный'; }
.editor-panel .ql-picker.ql-size [data-value="huge"]::before { content: 'Огромный'; }
.editor-panel .ql-picker.ql-font .ql-picker-label::before, .editor-panel .ql-picker.ql-font .ql-picker-item::before { content: 'Шрифт листа'; }
.editor-panel .ql-picker.ql-font [data-value="serif"]::before { content: 'С засечками'; }
.editor-panel .ql-picker.ql-font [data-value="monospace"]::before { content: 'Моноширинный'; }
.editor-panel .ql-picker.ql-font { width: 135px; }
.rich-text p { margin: 0; }
.rich-text h1, .rich-text h2, .rich-text h3 { color: inherit; text-shadow: none; letter-spacing: normal; font-weight: bold; line-height: 1.4; margin: 0; }
.rich-text h1 { font-size: 2em; }
.rich-text h2 { font-size: 1.5em; }
.rich-text h3 { font-size: 1.17em; }
.rich-text ol, .rich-text ul { margin: 0; padding-inline-start: 1.5em; }
.notice-size-small { font-size: .75em; }
.notice-size-large { font-size: 1.5em; }
.notice-size-huge { font-size: 2.5em; }
.notice-font-serif { font-family: Georgia, 'Times New Roman', serif; }
.notice-font-monospace { font-family: Monaco, Courier New, monospace; }
.current-caption { font: 11px/1.5 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .17em; text-align: center; color: #cfb48a; margin: 0 0 22px; }
.current-paper { padding: 44px 52px 35px; }
.full-body { font-size: 20px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 32px; }
.current-help { text-align: center; font-size: 15px; line-height: 1.5; color: var(--muted); margin: 22px 10px; }
.phase-status { color: #d7b77c; text-align: center; font: 13px/1.5 system-ui, sans-serif; }
.phase-status:empty { display: none; }
.organizer-panel { border: 1px solid #b8976855; padding: 24px; margin: 35px 0; background: #21171088; }
.organizer-toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; flex-wrap: wrap; }
.organizer-toolbar h2 { font-weight: normal; font-size: 26px; margin: 0; }
.organizer-panel .form-hint { color: var(--muted); }
#organizer-status { font: 13px/1.5 system-ui, sans-serif; color: #ffd68a; }
.organizer-table-wrap { overflow-x: auto; max-width: 100%; }
.organizer-table { width: 100%; min-width: 560px; border-collapse: collapse; font: 14px/1.6 system-ui, sans-serif; }
.organizer-table th, .organizer-table td { text-align: left; vertical-align: top; border-bottom: 1px solid #b897683d; padding: 12px; }
.organizer-table th { color: #d7b77c; font-weight: normal; }
.organizer-table td { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 450px; }
.organizer-table td:nth-child(3), .organizer-table td:nth-child(4) { min-width: 100px; }
.organizer-text { max-height: 240px; overflow-y: auto; scrollbar-width: thin; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0; border-top: 1px solid #c5ad8f33; font: 11px/1.5 system-ui, sans-serif; color: #bea58a; }
.footer-link { border: 0; background: none; color: #bea58a; padding: 0; font: inherit; text-decoration: underline; }
dialog { max-width: min(580px, calc(100% - 32px)); width: 580px; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 34px; border: 1px solid #a68b61; border-radius: 3px; color: var(--ink); background: #eee2c7; box-shadow: 0 18px 80px #0008; }
dialog::backdrop { background: #130e0bd9; backdrop-filter: blur(4px); }
dialog h2 { font-weight: normal; font-size: 32px; margin: 0 0 16px; }
#character-hint { font-size: 16px; line-height: 1.5; margin: 0 0 22px; }
label { display: block; font: 13px/1.5 system-ui, sans-serif; margin: 18px 0 6px; color: #604c33; }
input, select, textarea { display: block; width: 100%; background: #fffaf0; color: #38291d; border: 1px solid #bca580; padding: 12px; border-radius: 2px; font: 16px/1.5 system-ui, sans-serif; }
textarea { resize: vertical; }
.form-hint { font: 13px/1.6 system-ui, sans-serif; color: #786344; margin: 12px 0; }
.form-error { font: 13px/1.5 system-ui, sans-serif; color: #9b3122; min-height: 1.5em; margin: 14px 0; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.secondary { border: 1px solid #b49b71; color: #4c3820; background: transparent; }
.or-divider { text-align: center; border-top: 1px solid #ae97654f; margin: 30px 0 5px; height: 5px; }
.or-divider span { position: relative; top: -11px; background: #eee2c7; padding: 0 12px; font: italic 14px/1.5 Georgia, serif; color: #8b7350; }
.text-button { padding: 0; border: 0; color: #6d4c24; background: none; text-decoration: underline; font: 13px system-ui, sans-serif; }
@media (max-width: 1000px) { .notice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; } .board-frame { padding: 0 28px; } .writing-layout { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 600px) {
    .board-frame { padding: 0 18px; }
    .site-header { flex-direction: column; align-items: flex-start; padding: 18px 0; gap: 14px; }
    .identity { gap: 10px; justify-content: space-between; width: 100%; }
    .identity .quiet { padding: 7px 9px; font-size: 12px; }
    .masthead { padding: 34px 0 18px; }
    .eyebrow { font-size: 9px; letter-spacing: .12em; }
    .toolbar { align-items: stretch; gap: 10px; }
    .toolbar button { font-size: 12px; padding: 11px; }
    .notice-grid { grid-template-columns: minmax(0,1fr); gap: 26px; padding-left: 5px; padding-right: 5px; }
    .notice { min-height: 260px; }
    .current-paper { padding: 36px 25px 28px; }
    .full-body { font-size: 18px; }
    dialog { padding: 26px 22px; }
    .organizer-panel { padding: 16px; }
    footer { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
.notice-kind { display: flex; gap: 1.2rem; border: 0; padding: 0; margin: 0 0 1rem; }
.notice-kind legend { margin-bottom: .5rem; font-weight: bold; }
.notice-kind label { display: flex; align-items: center; gap: .4rem; }
.notice-kind input { width: auto; margin: 0; }
.notice-image { display: block; width: 100%; height: auto; object-fit: contain; }
#image-editor input { max-width: 100%; }
.notice-body, .organizer-text, .ql-editor, dialog, .organizer-table-wrap {
    scrollbar-width: auto;
    scrollbar-color: #87623c #dac7a2;
    scrollbar-gutter: stable;
}
.notice-body::-webkit-scrollbar, .organizer-text::-webkit-scrollbar, .ql-editor::-webkit-scrollbar, dialog::-webkit-scrollbar, .organizer-table-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
.notice-body::-webkit-scrollbar-track, .organizer-text::-webkit-scrollbar-track, .ql-editor::-webkit-scrollbar-track, dialog::-webkit-scrollbar-track, .organizer-table-wrap::-webkit-scrollbar-track { background: #dac7a2; border-radius: 6px; }
.notice-body::-webkit-scrollbar-thumb, .organizer-text::-webkit-scrollbar-thumb, .ql-editor::-webkit-scrollbar-thumb, dialog::-webkit-scrollbar-thumb, .organizer-table-wrap::-webkit-scrollbar-thumb { background: #87623c; border: 2px solid #dac7a2; border-radius: 6px; }
.notice-image { cursor: zoom-in; }
.notice-image:focus-visible { outline: 3px solid #87623c; outline-offset: 3px; }
dialog.image-dialog { width: min(1200px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 16px; }
.image-dialog img { display: block; width: auto; height: auto; max-width: 100%; margin: 16px auto 0; }
.image-dialog button { position: sticky; top: 0; z-index: 1; }
