.board-item.archived { opacity: .35; filter: grayscale(.7); }
.board-item.is-hidden { opacity: .22; }
.board-item.is-locked::after { content: "🔒"; position: absolute; right: 8px; top: 8px; background: #fff; border-radius: 50%; padding: 4px; font-size: 11px; }
.media-card video { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; background: #111; }
.audio-card, .file-card { display: flex; flex-direction: column; justify-content: center; gap: 13px; }
.audio-card b, .file-card b { font: 700 21px Georgia; }
.wave { font-size: 25px; letter-spacing: 3px; color: var(--green); white-space: nowrap; overflow: hidden; }
.audio-wave-preview { display: block; width: 100%; max-height: 110px; object-fit: contain; }
.audio-card audio { display: none; }
.media-toggle { position: absolute; right: 12px; bottom: 12px; z-index: 5; width: 48px; height: 48px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.85); border-radius: 50%; padding: 0; background: rgba(29,41,36,.92); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.28); font: 800 18px/1 sans-serif; touch-action: manipulation; }
.media-toggle.playing { background: #fff; color: var(--ink); }
.media-label { right: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-note { display: block; margin-top: 5px; color: #69716d; font-weight: 500; }
.draw-object { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shape-object { position: absolute; inset: 0; border-style: solid; display: grid; place-items: center; }
.shape-object.circle { border-radius: 50%; }
.shape-object.frame { border-style: double; }
.shape-object span { font: 700 18px Georgia; }
.detail-media { display: block; width: 100%; max-height: 56vh; margin: 10px 0 20px; }
.media-open { border: 0; background: none; padding: 0; width: 100%; }
.media-open img { display: block; width: 100%; max-height: 58vh; object-fit: contain; }
.download-link { display: block; text-align: center; text-decoration: none; margin: 12px 0; }
.comment.reply { margin-left: 22px; padding-left: 12px; border-left: 2px solid var(--line); }
.comment-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.comment-actions button { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 5px 7px; font-size: 11px; }
#replyLabel { font-size: 12px; color: var(--green); font-weight: 700; }
.check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.check input { width: auto !important; }
.item-actions { right: -8px; max-width: 290px; flex-wrap: wrap; justify-content: flex-end; }
.item-actions button { font-size: 12px; }
.minimap { cursor: crosshair; touch-action: none; }
.minimap-label { pointer-events: none; }
.rotate-handle { width: 28px; height: 28px; left: -14px; top: auto; bottom: -14px; cursor: grab; touch-action: none; place-items: center; }
.board-item.area .rotate-handle { left: auto; right: 28px; }
.admin .board-item.selected .rotate-handle { display: grid; }
.board-item.selected { z-index: 999999 !important; contain: layout style; content-visibility: visible; overflow: visible; }
.resize-handle { width: 28px; height: 28px; right: -14px; bottom: -14px; border-radius: 7px; touch-action: none; place-items: center; }
.admin .board-item.selected .resize-handle { display: grid; }
.resize-handle::after { content: "↘"; color: white; font: 700 15px/1 sans-serif; }
.area { overflow: hidden; }
.area h3 { margin: 0 0 10px; font: inherit; color: inherit; font-size: 1.25em; }
.area p { margin: 0; color: inherit; font: inherit; white-space: pre-wrap; line-height: 1.4; }
.rotate-handle:active { cursor: grabbing; }
.rotate-handle::after { content: "↻"; color: white; font: 700 16px/1 sans-serif; }
.board-item[data-angle]::after { content: attr(data-angle); position: absolute; left: 4px; bottom: -48px; transform: rotate(calc(-1 * var(--rotation))); background: var(--ink); color: white; padding: 4px 7px; border-radius: 6px; font-size: 11px; }
.permission-user { padding: 14px 0; border-bottom: 1px solid var(--line); }
.permission-user .manage-row { flex-wrap: wrap; align-items: flex-start; }
.permission-user .manage-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 12px; padding: 10px 4px 2px; }
.permission-grid label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 600; }
.permission-grid input { width: auto; }
dialog#mediaDialog { width: min(1100px, calc(100vw - 20px)); height: min(850px, calc(100vh - 20px)); background: #161b19; }
#mediaViewer { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; }
#mediaViewer img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
#mediaViewer img.zoomed { width: 200%; max-width: none; max-height: none; cursor: zoom-out; }
#mediaDialog .dialog-close { color: white; z-index: 2; background: #0008; border-radius: 50%; }
details { margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
summary { cursor: pointer; font-weight: 700; margin-bottom: 10px; }
.calendar-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 12px; text-align: center; }
.calendar-toolbar button { border: 0; border-radius: 8px; padding: 8px 12px; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(70px, 1fr)); }
.calendar-week b { padding: 7px; text-align: center; font-size: 11px; }
.calendar-cell { min-height: 86px; padding: 7px; border: 1px solid var(--line); background: #fff; }
.calendar-cell.empty { background: #f3efe5; }
.calendar-cell > b { display: block; margin-bottom: 5px; }
.calendar-cell button { display: block; width: 100%; border: 0; border-radius: 5px; background: #dbe9e0; padding: 4px; margin-top: 3px; font-size: 10px; text-align: left; }
.drawing-preview { position: absolute; inset: 0; width: 4000px; height: 3000px; pointer-events: none; }
.drawing-mode { cursor: crosshair !important; }
.admin-tools button.active { background: var(--accent); }
.board-item { content-visibility: auto; contain: layout paint style; }

@media (max-width: 760px) {
  #details { top: 0; z-index: 180; }
  #details .drawer-body { height: calc(100dvh - 84px); }
  dialog:not(#mediaDialog) { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog:not(#mediaDialog) form { height: 100%; padding: 24px 18px; overflow-y: auto; }
  dialog#mediaDialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  .resize-handle, .rotate-handle { width: 36px; height: 36px; bottom: -18px; }
  .resize-handle { right: -18px; }
  .rotate-handle { left: -18px; }
  .board-item.area .rotate-handle { left: auto; right: 30px; }
  .admin-tools { grid-template-columns: repeat(5, 1fr); max-height: calc(100vh - 90px); overflow: auto; }
  .admin-tools button { display: flex !important; }
  .manage-row { grid-template-columns: 1fr; }
  .manage-row-actions { flex-wrap: wrap; }
  .drawer-head { height: 84px; padding: 16px 18px; }
  .drawer-body { height: calc(100% - 84px); padding: 18px; }
  .reaction-row button { min-width: 44px; min-height: 44px; }
  .comment-actions button { min-height: 38px; }
  .editor-actions button, .primary, .secondary { min-height: 44px; }
  .calendar-week, .calendar-grid { grid-template-columns: repeat(7, minmax(42px, 1fr)); }
  .calendar-cell { min-height: 65px; padding: 4px; }
  .calendar-cell button { font-size: 0; width: 9px; height: 9px; border-radius: 50%; padding: 0; display: inline-block; }
}
