
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #10204b;
  background: #f6f8fc;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f6f8fc; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { border-right: 1px solid #dfe5f1; background: #fff; padding: 24px 18px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; gap: 12px; align-items: center; font-weight: 800; font-size: 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #316cf4; color: #fff; }
.brand small { display: block; color: #68779a; font-weight: 500; font-size: 12px; }
.nav { display: grid; gap: 8px; }
.nav button { border: 0; background: transparent; text-align: left; padding: 12px 14px; border-radius: 10px; color: #26375f; }
.nav button.active { background: #eaf0ff; color: #1549bc; font-weight: 700; }
.sidebar-note { margin-top: auto; font-size: 12px; color: #7483a3; padding: 12px; border-radius: 12px; background: #f2f6ff; }
.workspace { min-width: 0; }
.topbar { min-height: 78px; padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e4e9f2; background: rgba(255,255,255,.95); position: sticky; top: 0; z-index: 5; }
.title h1 { margin: 0; font-size: 28px; }
.title p { margin: 4px 0 0; color: #68779a; }
.actor-box { display: flex; align-items: center; gap: 10px; }
.actor-box label { font-size: 12px; color: #68779a; }
.actor-box select { border: 1px solid #cfd8e8; border-radius: 9px; padding: 8px 10px; background: #fff; }
.actor-box .logout { padding: 8px 12px; }
.main { padding: 24px 28px 96px; max-width: 1440px; margin: 0 auto; }
.notice { padding: 12px 14px; border: 1px solid #cbd8fa; background: #edf3ff; color: #234b9b; border-radius: 12px; margin-bottom: 18px; }
.notice.error { border-color: #f0b7b7; background: #fff1f1; color: #9b2424; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.toolbar h2 { margin: 0; font-size: 22px; }
.btn { border: 1px solid #c8d3e8; background: #fff; color: #18315f; padding: 9px 13px; border-radius: 10px; font-weight: 650; }
.btn.primary { background: #2764df; color: #fff; border-color: #2764df; }
.btn.success { background: #1f8b57; color: #fff; border-color: #1f8b57; }
.btn.danger { border-color: #e35d4f; color: #b73528; }
.btn.ghost { border-color: transparent; background: transparent; }
.publication-list { display: grid; gap: 10px; }
.publication-card { display: grid; grid-template-columns: 64px minmax(180px, 2fr) 1fr 1fr auto; gap: 16px; align-items: center; background: #fff; border: 1px solid #dfe6f2; border-radius: 13px; padding: 12px 16px; box-shadow: 0 1px 2px rgba(16,32,75,.04); }
.publication-card:hover { border-color: #9fb8f0; }
.publication-card.selected { outline: 2px solid #79a3ff; }
.publication-card button.open { appearance: none; border: 0; background: transparent; padding: 0; text-align: left; color: inherit; font-weight: 750; font-size: 15px; }
.publication-card .publication-title { display: grid; gap: 4px; min-width: 0; }
.publication-card .publication-hint { font-size: 12px; color: #68779a; }
.next-step { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #c8d8f5; border-radius: 11px; background: #f2f6ff; color: #183567; }
.next-step strong { display: block; margin-bottom: 3px; }
.settings-helper { margin-top: 4px; }
.publication-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #f2f5fa; border: 1px solid #dfe6f2; }
.publication-thumb-placeholder { width: 64px; height: 64px; border-radius: 8px; background: #f2f5fa; border: 1px solid #dfe6f2; }
.meta { color: #68779a; font-size: 13px; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #e9eef8; color: #41577f; }
.badge.review { background: #fff0c7; color: #775300; }
.badge.changes { background: #ffe0dc; color: #9b3024; }
.badge.approved { background: #dff4e8; color: #176540; }
.badge.draft { background: #e7ecf6; color: #405579; }
.empty { padding: 42px 20px; text-align: center; color: #68779a; border: 1px dashed #cbd5e5; border-radius: 14px; background: #fff; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr); gap: 18px; }
.panel { background: #fff; border: 1px solid #dfe6f2; border-radius: 14px; padding: 18px; }
.login-panel { width: min(540px, 100%); margin: 8vh auto; }
.login-method { padding: 14px; border: 1px solid #dfe6f2; border-radius: 12px; }
.login-method h3 { margin: 0 0 12px; }
.login-divider { text-align: center; margin: 12px; color: #68779a; }
.login-form { display: grid; gap: 4px; }
.panel h2, .panel h3 { margin-top: 0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 700; color: #546786; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #cdd7e7; border-radius: 9px; padding: 10px 11px; background: #fff; color: #10204b; }
.field textarea { min-height: 150px; resize: vertical; }
.collapse-panel { padding: 0; overflow: hidden; }
.collapse-panel > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; color: #10204b; font-size: 18px; font-weight: 750; }
.collapse-panel > summary::-webkit-details-marker { display: none; }
.collapse-panel > summary::after { content: '+'; font-size: 20px; line-height: 1; }
.collapse-panel[open] > summary::after { content: '−'; }
.collapse-panel-content { padding: 0 18px 18px; }
.create-dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid #dfe6f2; border-radius: 14px; padding: 22px; color: #10204b; box-shadow: 0 16px 48px rgba(16,32,75,.2); }
.create-dialog::backdrop { background: rgba(16,32,75,.38); }
.create-dialog h2 { margin: 0 0 18px; font-size: 20px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share-link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.share-link-input { flex: 1 1 260px; min-width: 0; border: 1px solid #c8d3e8; border-radius: 10px; padding: 9px 11px; color: #18315f; background: #f7f9fd; }
.upload-dropzone { border: 2px dashed #9fb8f0; border-radius: 12px; padding: 16px; background: #f7f9fd; margin-bottom: 10px; }
.upload-dropzone.dragover { border-color: #2764df; background: #eaf0ff; }
.media-caption-field { display: grid; gap: 5px; margin-top: 8px; }
.media-reorder-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.media-reorder-actions { display: flex; gap: 6px; }
.media-reorder-actions .btn { padding: 5px 9px; font-size: 12px; }
.media-caption-field input { width: 100%; border: 1px solid #cdd7e7; border-radius: 9px; padding: 9px; }
.media-caption-field label { font-size: 12px; font-weight: 700; color: #546786; }
.media-caption { white-space: pre-wrap; font-size: 13px; }
.summary { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid #e5eaf3; margin-bottom: 16px; }
.caption { white-space: pre-wrap; line-height: 1.55; }
.publication-caption { margin-top: 12px; }
.comments, .versions, .media-list { display: grid; gap: 10px; }
.comment { border-left: 3px solid #cbd8ef; padding: 6px 0 6px 12px; }
.comment strong { display: block; font-size: 13px; }
.comment time, .version time { display: block; color: #7a88a6; font-size: 11px; margin-top: 3px; }
.version { padding: 9px 10px; background: #f7f9fd; border-radius: 9px; display: flex; justify-content: space-between; gap: 12px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.media-tile { border: 1px solid #dbe2ee; border-radius: 10px; overflow: hidden; background: #f4f6fa; min-height: 110px; display: grid; place-items: center; }
.media-preview-button { display: block; position: relative; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.media-preview-button:focus-visible { outline: 3px solid #2764df; outline-offset: -3px; }
.media-preview-button img { width: 100%; height: 140px; object-fit: cover; display: block; }
.media-zoom-label { position: absolute; right: 6px; bottom: 6px; padding: 3px 6px; border-radius: 5px; background: rgba(9, 18, 34, .86); color: #fff; font-size: 11px; font-weight: 700; }
.media-order-controls { display: flex; justify-content: center; gap: 6px; padding: 7px; border-top: 1px solid #dbe2ee; }
.media-order-controls .btn { padding: 4px 9px; font-size: 12px; }
.image-viewer { width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 16px; border: 1px solid #405170; border-radius: 14px; background: #131d31; color: #fff; }
.image-viewer::backdrop { background: rgba(4, 9, 19, .86); }
.image-viewer-head, .image-viewer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.image-viewer-picture { display: grid; place-items: center; min-height: 140px; margin: 12px 0; }
.image-viewer-picture img { display: block; max-width: 100%; max-height: calc(100dvh - 205px); object-fit: contain; }
.image-viewer-caption { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 100px; overflow-y: auto; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 12px; background: #101828; }
.video-fallback { padding: 12px; border: 1px solid #dbe2ee; border-radius: 10px; word-break: break-all; }
.back { margin-bottom: 12px; }
.notification-list { display: grid; gap: 10px; }
.notification-item { background: #fff; border: 1px solid #dfe6f2; border-radius: 12px; padding: 14px; display: grid; gap: 8px; }
.notification-item.unread { border-left: 4px solid #2764df; }
.notification-item .notification-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.notification-item .notification-actions { display: flex; gap: 8px; flex-wrap: wrap; }
:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e7ecf7;
  background: #0d1424;
}
:root[data-theme="dark"] body { background: #0d1424; }
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .publication-card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .notification-item,
:root[data-theme="dark"] .mobile-nav { background: #131d31; border-color: #2a3853; }
:root[data-theme="dark"] .login-method { border-color: #33425f; }
:root[data-theme="dark"] .topbar { background: rgba(19,29,49,.96); }
:root[data-theme="dark"] .nav button,
:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .publication-card button.open,
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .actor-box select { color: #e7ecf7; }
:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .actor-box select,
:root[data-theme="dark"] .version,
:root[data-theme="dark"] .publication-thumb-placeholder { background: #18243a; border-color: #33425f; }
:root[data-theme="dark"] .nav button.active { background: #1d335d; color: #9ec1ff; }
:root[data-theme="dark"] .meta,
:root[data-theme="dark"] .title p,
:root[data-theme="dark"] .field label,
:root[data-theme="dark"] .actor-box label,
:root[data-theme="dark"] .brand small,
:root[data-theme="dark"] .sidebar-note { color: #a8b5cc; }
:root[data-theme="dark"] .sidebar-note { background: #18243a; }
:root[data-theme="dark"] .summary { border-color: #2a3853; }
:root[data-theme="dark"] .collapse-panel > summary { color: #e7ecf7; background: #18243a; border-bottom: 1px solid #2a3853; }
:root[data-theme="dark"] .collapse-panel > summary::after { color: #9ec1ff; }
:root[data-theme="dark"] .share-link-input { color: #eaf0ff; background: #17233b; border-color: #405170; }
:root[data-theme="dark"] .upload-dropzone { background: #18243a; border-color: #405170; }
:root[data-theme="dark"] .media-caption-field input { color: #e7ecf7; background: #18243a; border-color: #33425f; }
:root[data-theme="dark"] .next-step { color: #dce8ff; background: #172846; border-color: #35588f; }
.mobile-nav { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 14px 16px; align-items: flex-start; gap: 12px; }
  .title h1 { font-size: 23px; }
  .title p { display: none; }
  .actor-box { flex-direction: column; align-items: flex-end; }
  .main { padding: 18px 14px 92px; }
  .publication-card { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .publication-thumb, .publication-thumb-placeholder { width: 52px; height: 52px; }
  .publication-card .meta.secondary { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #dfe6f2; padding: 7px 8px max(7px, env(safe-area-inset-bottom)); z-index: 8; }
  .mobile-nav button { border: 0; background: transparent; padding: 8px 4px; color: #596b8e; font-size: 12px; }
  .mobile-nav button.active { color: #1e5ed7; font-weight: 750; }
}
