/* Local Tabler foundation, application layout, and content components. */

:root {
  --spark-sidebar-width: 192px;
  --spark-header-height: 56px;
  --spark-primary: var(--color-primary);
  --spark-primary-dark: var(--color-primary-hover);
  --spark-sidebar-bg: #18181b;
  --spark-sidebar-hover: #27272a;
  --spark-text: #1e293b;
  --spark-muted: #64748b;
  --spark-bg: var(--color-bg);
  --spark-surface: #ffffff;
  --spark-border: #e4e4e7;
  --spark-radius: 12px;
  --spark-control-radius: 8px;
  --spark-font-xs: 11px;
  --spark-font-sm: 12px;
  --spark-font-body: 14px;
  --spark-font-title: 16px;
  --spark-font-heading: 20px;
}

/* Spark UI baseline: compact admin typography and stable browser defaults. */
html {
  font-size: 16px;
  font-family: var(--font-sans);
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: var(--spark-font-body);
  line-height: 1.6;
  color: var(--spark-text);
  background: var(--spark-bg);
  overflow-x: hidden;
}

h1 { font-size: 28px; line-height: 1.3; }
h2 { font-size: 24px; line-height: 1.3; }
h3 { font-size: 20px; line-height: 1.4; }
h4 { font-size: 18px; line-height: 1.4; }
p { font-size: 14px; line-height: 1.6; }
small { font-size: 12px; }

/* Spark compact application shell. */
.page > .navbar.navbar-vertical {
  position: fixed;
  z-index: 1000;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--spark-sidebar-width) !important;
  min-width: var(--spark-sidebar-width) !important;
  padding: 0;
  overflow: visible;
  color: #f4f4f5;
  background: var(--spark-sidebar-bg);
  border-right: 1px solid rgb(255 255 255 / 5%);
}

.page > .navbar.navbar-vertical > .container-fluid {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 0;
}

.navbar-brand {
  display: flex;
  width: 100%;
  min-height: var(--spark-header-height);
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 6px;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
}
.navbar-brand strong { display: none !important; }
.navbar-brand .avatar { width: 30px; height: 30px; font-size: 14px; }
.navbar-brand .avatar {
  width: 44px;
  height: 44px;
  color: #fff !important;
  font-size: 21px;
  background: linear-gradient(145deg, #6366f1, #4f46e5) !important;
  border-radius: 13px !important;
  box-shadow: 0 8px 18px rgb(79 70 229 / 28%);
}
.navbar-brand > a { width: 100%; flex-direction: column; align-items: center; gap: 4px !important; }

.page > .navbar.navbar-vertical .navbar-collapse {
  display: block !important;
  width: 100%;
  overflow: visible;
}
.page > .navbar.navbar-vertical .navbar-nav {
  width: 100%;
  padding: 6px 0;
}
.page > .navbar.navbar-vertical .nav-section-title {
  margin: 10px 6px 4px;
  overflow: hidden;
  color: #71717a;
  font-size: 9px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-indent: -999px;
}
.page > .navbar.navbar-vertical .nav-section-title::after {
  display: block;
  height: 1px;
  background: rgb(255 255 255 / 8%);
  content: '';
}
.page > .navbar.navbar-vertical .nav-item { margin: 2px 4px; }
.page > .navbar.navbar-vertical .nav-link {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 2px;
  border-radius: 11px;
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}
.page > .navbar.navbar-vertical .nav-link:hover { color: #a5b4fc; background: var(--spark-sidebar-hover); }
.page > .navbar.navbar-vertical .nav-item.active > .nav-link {
  color: #e4e4e7;
  background: rgb(255 255 255 / 9%);
}
.page > .navbar.navbar-vertical .nav-link-icon { width: auto; margin: 0; color: #a1a1aa; font-size: 24px; line-height: 1; opacity: .95; }
.page > .navbar.navbar-vertical .nav-link:hover .nav-link-icon,
.page > .navbar.navbar-vertical .nav-item.active .nav-link-icon { color: #d4d4d8; opacity: 1; }
.page > .navbar.navbar-vertical .nav-link-title { max-width: 64px; overflow: hidden; font-size: 10px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.page > .navbar.navbar-vertical .nav-item.active > .nav-link { color: #c7d2fe; background: #292653; }
.page > .navbar.navbar-vertical .nav-item.active > .nav-link .nav-link-icon { color: #a5b4fc; }
.page > .navbar.navbar-vertical .navbar-footer {
  display: block;
  order: 3;
  margin-top: auto;
  padding: 12px 0;
  border-top: 1px solid rgb(255 255 255 / 7%);
}
.page > .navbar.navbar-vertical .navbar-footer .nav-link { min-height: 60px; }

.page-wrapper {
  width: calc(100% - var(--spark-sidebar-width));
  min-height: 100vh;
  margin-left: 0;
  margin-inline-start: var(--spark-sidebar-width) !important;
}
.page-wrapper > .navbar:not(.navbar-vertical) {
  min-height: var(--spark-header-height);
  background: var(--spark-surface);
  border-bottom: 1px solid var(--spark-border);
}
.page-body { margin-top: 0 !important; padding: 12px 24px 24px; }
.page-body > .container-xl { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0; }

/* Shared content hierarchy: keep pages readable without oversized headings. */
.page-body h1 { font-size: 1.5rem; }
.page-body h2 { font-size: 1.35rem; }
.page-body h3 { font-size: 1rem; }
.page-body .card-title { font-size: var(--spark-font-title); line-height: 1.45; }
.page-body .text-secondary { font-size: var(--spark-font-body); }
.page-body .small, .page-body small { font-size: var(--spark-font-sm); }

/* Shared Spark-style page header. */
.page-body .page-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: var(--spark-radius);
  background: linear-gradient(90deg, #111827 0%, #1e3a5f 55%, #2563eb 100%);
  text-align: left;
}
.page-body .page-header > .row { width: 100%; text-align: left; }
.page-body .page-header .col { text-align: left; }
.page-body .page-header .page-title,
.page-body .page-header .page-pretitle,
.page-body .page-header .text-secondary { color: #fff !important; }
.page-body .page-header .page-title { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.35; }
.page-body .page-header .page-pretitle { margin: 0; font-size: 12px; opacity: .72; }
.page-body .page-header .text-secondary { margin-top: 2px !important; font-size: 12px; opacity: .72; }
.page-body .page-header .btn { border-color: rgb(255 255 255 / 28%); background: rgb(255 255 255 / 10%); color: #fff; }

.card {
  overflow: hidden;
  border: 1px solid var(--spark-border);
  border-radius: var(--spark-radius);
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}
.card-header { min-height: 48px; padding: 14px 16px; background: #fafafa; }
.card-title { font-size: var(--spark-font-title); font-weight: 700; line-height: 1.35; }
.card-body { font-size: var(--spark-font-body); }
.btn { border-radius: var(--spark-control-radius); font-size: 13px; }
.form-control, .form-select { border-radius: var(--spark-control-radius); font-size: 13px; }
.badge { border-radius: 999px; font-size: var(--spark-font-xs); }

/* Navigation and controls should not acquire browser link underlines after a click. */
a,
a:hover,
a:focus,
a:active {
  text-decoration: none;
}

.navbar .nav-link,
.navbar-brand,
.btn,
.dropdown-item {
  text-decoration: none;
}

.page-body > .container-xl {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.topic-card .card-header,
.topic-card .card-body,
.topic-card .card-footer {
  padding: 0.75rem 1rem;
}

.topic-card {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 96%) 0%, rgb(248 250 252 / 96%) 100%);
  box-shadow: 0 10px 28px rgb(15 23 42 / 6%);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgb(15 23 42 / 10%);
  border-color: #cbd5e1;
}
.topic-card-written {
  border-color: #86d9ac;
  border-left: 4px solid #22a865;
  background: linear-gradient(145deg, #f2fff7 0%, #ffffff 55%, #f8fafc 100%);
  box-shadow: 0 10px 28px rgb(22 163 74 / 10%);
}
.topic-card-written:hover {
  border-color: #4fc384;
  box-shadow: 0 14px 34px rgb(22 163 74 / 16%);
}

.topic-card .card-title {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.topic-card .card-header {
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
}
.topic-card .card-header > .min-w-0 {
  flex: 1 1 auto;
  min-width: 0;
}
.topic-card .card-header .badge { flex: 0 0 auto; }
.topic-status-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 14px;
}
.topic-status-icon.is-written { color: #15803d; background: #dcfce7; }
.topic-status-icon.is-unwritten { color: #64748b; background: #f1f5f9; }
.topic-usage > summary { color: var(--spark-muted); cursor: pointer; }
.topic-usage > summary::marker { color: var(--spark-primary); }
.topic-card .topic-title {
  display: -webkit-box;
  overflow: hidden;
  margin-right: 0;
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.topic-card .topic-title { font-size: 0.925rem; font-weight: 700; letter-spacing: -0.015em; }
.topic-suggestion-bar .fw-bold { font-size: 0.875rem; }
.topic-suggestion-bar .page-pretitle { font-size: 0.75rem; }
.topic-card .card-footer { min-height: 2.75rem; padding: 0.5rem 0.75rem; }
.topic-id-label i,
.topic-meta i { color: var(--spark-primary); }
.topic-id-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  color: var(--spark-muted);
  font-size: 0.75rem;
}
.topic-id-label code {
  padding: 0.15rem 0.35rem;
  color: #475569;
  font-size: 0.7rem;
  background: #f1f5f9;
  border-radius: 5px;
  overflow-wrap: anywhere;
}
.topic-meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}
.topic-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0;
  padding: 0;
  color: var(--spark-muted);
  font-size: 0.78rem;
}
.topic-meta span {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  line-height: 1.45;
  min-width: 0;
}
.topic-meta-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.topic-meta .ti { flex: 0 0 auto; margin-top: 0.18rem; font-size: 0.9rem; }
.topic-card-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
  color: var(--spark-muted);
  font-size: 12px;
}
.topic-card-note span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
}
.topic-card-note .ti { color: var(--spark-primary); font-size: 13px; }
.topic-card-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 12px;
}
.topic-card-links a { color: var(--spark-primary); text-decoration: none; }
.topic-card-links a:hover { text-decoration: underline; }
.written-draft-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem;
  border: 1px solid #bbebcf;
  border-radius: 9px;
  color: #166534;
  background: #edfff4;
  font-size: 0.78rem;
}
.written-date,
.written-open-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.written-draft-summary small {
  display: block;
  color: #568068;
  font-size: 0.65rem;
  line-height: 1.1;
  margin-bottom: 0.15rem;
}
.written-draft-summary strong { color: #14532d; font-size: 0.76rem; letter-spacing: 0.01em; }
.written-summary-icon,
.written-open-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 8px;
}
.written-summary-icon { color: #15803d; background: #d5f8e3; font-size: 1rem; }
.written-open-link {
  padding: 0.32rem 0.45rem 0.32rem 0.35rem;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  background: #16834b;
  text-decoration: none;
  box-shadow: 0 3px 8px rgb(22 131 75 / 18%);
}
.written-open-icon { width: 1.35rem; height: 1.35rem; color: #fff; background: rgb(255 255 255 / 16%); }
.written-open-link:hover { color: #fff; background: #0f6f3e; text-decoration: none; }
.written-open-link > .ti-chevron-right { font-size: 0.75rem; }
.topic-publication-status { margin-top: 0.35rem; color: #15803d; font-size: 0.72rem; }

@media (max-width: 575.98px) {
  .written-draft-summary { align-items: stretch; flex-direction: column; }
  .written-open-link { justify-content: center; }
}
.topic-group-heading {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  min-height: 3.2rem;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  padding: 0.65rem 1rem;
  color: var(--spark-text);
  border-radius: 12px;
  background: linear-gradient(105deg, #eef2f7, #f8fafc);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgb(15 23 42 / 7%);
  cursor: pointer;
  text-align: left;
}
.topic-group-heading.topic-group-used { background: #dcfce7; border-color: #86efac; }
.topic-group-heading.topic-group-unused { background: #fff7ed; border-color: #fdba74; }
.topic-group-heading.topic-group-used { border-left: 5px solid #22c55e; }
.topic-group-heading.topic-group-unused { border-left: 5px solid #f97316; }
.topic-group-title {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.topic-group-heading:hover { filter: brightness(.98); }
.topic-group-heading:focus-visible { outline: 2px solid var(--spark-primary); outline-offset: 2px; }
.topic-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  color: var(--spark-text);
  font-size: 1rem;
  font-weight: 700;
  background: transparent;
  border: 0;
}
.topic-group-toggle:hover { color: var(--spark-primary); }
.topic-group-used .topic-group-toggle { color: #166534; }
.topic-group-unused .topic-group-toggle { color: #c2410c; }
.topic-group-count {
  display: inline-flex;
  min-width: 2.5rem;
  margin-left: auto;
  padding: 0.3rem 0.55rem;
  align-items: center;
  justify-content: center;
  color: var(--spark-primary);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  background: #fff;
}
.topic-group-used .topic-group-count { color: #15803d; }
.topic-group-unused .topic-group-count { color: #c2410c; }
.topic-card .icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
}
.topic-card .card-footer {
  gap: 0.45rem;
  align-items: center;
  border-top: 1px solid #eef2f7;
}
.topic-card details > summary { list-style: none; }
.topic-card details > summary::-webkit-details-marker { display: none; }

.recommendation-details > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.recommendation-details > summary::-webkit-details-marker { display: none; }

.recommendation-details[open] .recommendation-toggle-label::before { content: "접기"; }
.recommendation-details[open] .recommendation-toggle-label { font-size: 0 !important; }
.recommendation-details[open] .recommendation-toggle-label::before { font-size: .875rem; }
.recommendation-details .recommendation-chevron { transition: transform .2s ease; }
.recommendation-details[open] .recommendation-chevron { transform: rotate(180deg); }
.topic-card .card-footer { background: transparent; }

.calendar-entry {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--spark-border);
}
.calendar-entry:last-child { border-bottom: 0; }
.calendar-entry-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.calendar-entry-type { flex: 0 0 auto; }
.calendar-entry-label {
  flex: 0 0 auto;
  color: var(--spark-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.calendar-add-link {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.35rem;
  padding: 0.2rem 0.45rem;
  color: var(--spark-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
}
.calendar-add-link .ti { font-size: 15px; }
.calendar-topic {
  overflow: hidden;
  color: var(--spark-text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-entry-meta {
  margin: 0.3rem 0 0 5.5rem;
  color: var(--spark-muted);
  font-size: 12px;
}
.calendar-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.55rem 0 0 5.5rem;
  padding: 0.55rem 0.75rem;
  color: inherit;
  text-decoration: none;
  border-left: 3px solid #cbd5e1;
  background: #fafafa;
}
.calendar-content:hover { background: #f1f5f9; }
.calendar-content-ready { border-left-color: var(--spark-primary); }
.calendar-content-label { color: var(--spark-muted); font-size: 12px; white-space: nowrap; }
.calendar-version { color: var(--spark-muted); font-size: 12px; white-space: nowrap; }
.calendar-content-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--spark-text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-content-empty { color: var(--spark-muted); font-size: 12px; }
.calendar-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; border: 1px solid #e3e7ed; border-radius: 10px; overflow: hidden; background: #e3e7ed; }
.calendar-weekday { padding: 7px 10px; background: #fbfcfe; color: #8a95a5; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-align: center; }
.calendar-weekday:nth-child(1) { color: #d64550; }
.calendar-weekday:nth-child(7) { color: #2b76d2; }
.calendar-blank, .calendar-day-cell { min-height: 64px; background: #fff; }
.calendar-blank { background: #fbfcfe; }
.calendar-day-cell { padding: 5px 6px; transition: background .12s ease; }
.calendar-day-cell:hover { background: #fafbfd; }
.calendar-day-cell:hover .calendar-day-add { opacity: 1; }
.calendar-today { background: #fff; }
.calendar-day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.calendar-day-head strong { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 600; color: #2a3342; }
.calendar-today .calendar-day-head strong { background: var(--spark-primary); color: #fff; }
.calendar-day-head .text-red { color: #d64550 !important; }
.calendar-day-head .text-azure { color: #2b76d2 !important; }
.calendar-today .calendar-day-head strong.text-red,
.calendar-today .calendar-day-head strong.text-azure { color: #fff !important; }
.calendar-day-head a.calendar-day-add { opacity: 0; color: #9aa5b3; font-size: 15px; line-height: 1; transition: opacity .12s; }
.calendar-day-head a.calendar-day-add:hover { color: var(--spark-primary); }
.calendar-day-head .badge { font-size: 10px; padding: 3px 6px; }
.calendar-grid-signal, .calendar-grid-recommendation { display: block; overflow: hidden; margin-top: 4px; border-radius: 5px; padding: 4px 6px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 1.35; }
.calendar-grid-signal { background: #fff2cf; color: #8a6100; }
.calendar-grid-recommendation { background: #f0edff; color: #5847a8; }
.calendar-grid-signal i, .calendar-grid-recommendation i { margin-right: 3px; }
.calendar-day-entries { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; }
.calendar-grid-entry { display: flex; align-items: center; gap: 4px; overflow: hidden; border-radius: 4px; background: #edf4ff; padding: 2px 5px; text-decoration: none; color: #295c9b; font-size: 11px; }
.calendar-grid-entry:hover { background: #dcebff; }
.calendar-grid-entry i { flex-shrink: 0; font-size: 11px; }
.calendar-grid-entry-work { background: #fff4e0; color: #8a5a00; }
.calendar-grid-entry-work:hover { background: #ffe9c2; }
.calendar-grid-tag { flex-shrink: 0; border-radius: 3px; background: rgba(0,0,0,.07); padding: 0 4px; font-size: 10px; }
.calendar-grid-entry-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-grid-dot { flex-shrink: 0; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #2b76d2; }
@media (max-width: 768px) { .calendar-month-grid { min-width: 700px; } .calendar-month-grid { overflow-x: auto; } .calendar-day-cell, .calendar-blank { min-height: 76px; } .calendar-day-head a.calendar-day-add { opacity: 1; } }
.calendar-signal-strip { border: 1px solid #f1d38b; border-radius: 12px; background: #fffaf0; padding: 12px 16px; }
.calendar-signal-heading { display: flex; align-items: center; gap: 8px; color: #9a6700; font-size: 13px; }
.calendar-signal-heading i { font-size: 16px; }
.calendar-signal-heading span { margin-left: auto; color: #aa7a1a; font-size: 12px; }
.calendar-signal-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.calendar-signal-item { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #f0dca9; border-radius: 8px; background: #fff; padding: 7px 10px; color: #5b4a26; text-decoration: none; font-size: 12px; }
.calendar-signal-item:hover { border-color: #d6a83b; color: #7b5200; }
.calendar-signal-item b { color: #a56d00; }
.calendar-signal-item em { color: #8a7c61; font-style: normal; }
.calendar-day-with-signal { background: linear-gradient(90deg, #fffdf8 0%, #fff 45%); }
.calendar-day-signals { display: grid; gap: 6px; margin-bottom: 9px; }
.calendar-signal-badge { display: flex; align-items: center; gap: 7px; border-left: 3px solid #eab94d; border-radius: 5px; background: #fff8e6; padding: 8px 10px; color: #7c5b18; font-size: 12px; }
.calendar-signal-badge i { font-size: 15px; }
.calendar-signal-badge span { color: #806f4b; }
.calendar-signal-badge a { margin-left: auto; color: #9a6700; text-decoration: underline; }
@media (max-width: 768px) { .calendar-signal-item em { display: none; } .calendar-signal-badge { flex-wrap: wrap; } .calendar-signal-badge a { margin-left: 0; } }

.calendar-sticky-top { position: sticky; top: 0; z-index: 15; background: var(--spark-bg); padding-top: 6px; padding-bottom: 2px; }
.calendar-focus-card .card-body { padding: 14px 16px; }
.calendar-stat-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; border: 1px solid var(--tblr-border-color); border-radius: 10px; background: #fff; padding: 9px 14px; font-size: 12px; color: var(--spark-muted); }
.calendar-stat-strip b { margin-right: 5px; color: #242b36; font-size: 14px; }
.calendar-month-nav { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 4px 0 2px; }
.calendar-month-nav-arrow { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #4a5568; font-size: 18px; text-decoration: none; transition: background .12s ease, color .12s ease; }
.calendar-month-nav-arrow:hover { background: #eef1f5; color: var(--spark-primary); }
.calendar-month-nav-title { display: flex; align-items: baseline; gap: 8px; min-width: 140px; justify-content: center; }
.calendar-month-nav-month { font-size: 22px; font-weight: 700; color: #242b36; }
.calendar-month-nav-year { font-size: 14px; font-weight: 500; color: var(--spark-muted); }
.calendar-month-nav-today { position: absolute; right: 0; border: 1px solid var(--tblr-border-color); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: #4a5568; text-decoration: none; }
.calendar-month-nav-today:hover { border-color: var(--spark-primary); color: var(--spark-primary); }
@media (max-width: 768px) { .calendar-month-nav-today { position: static; margin-left: 4px; } }
.calendar-board-scroll { background: #eef1f5; border-radius: 14px; padding: 10px; }
.calendar-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.calendar-board-column { display: flex; flex-direction: column; max-height: min(46vh, 440px); border-top: 4px solid #94a3b8; border-radius: 10px; background: #f4f5f8; box-shadow: 0 1px 2px rgb(23 33 43 / 6%); overflow: hidden; min-width: 0; }
.calendar-board-column[data-status="no_topic"] { border-top-color: #94a3b8; }
.calendar-board-column[data-status="topic_selected"] { border-top-color: #2b76d2; }
.calendar-board-column[data-status="drafting"] { border-top-color: #7c5cbf; }
.calendar-board-column[data-status="ready_to_publish"] { border-top-color: #d98c1f; }
.calendar-board-column[data-status="published"] { border-top-color: #1f9d55; }
.calendar-board-column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: 13px; font-weight: 700; color: #3a4351; }
.calendar-board-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #dfe3ea; color: #5a6472; font-size: 11px; font-weight: 700; }
.calendar-board-column-body { display: flex; flex-direction: column; gap: 8px; padding: 6px 10px 10px; border-top: 1px solid rgb(23 33 43 / 6%); overflow-y: auto; }
.calendar-section-title { font-size: 14px; font-weight: 700; color: #242b36; }
.calendar-board-card { display: flex; flex-direction: column; gap: 4px; border-radius: 8px; background: #fff; padding: 9px 10px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgb(23 33 43 / 12%); transition: box-shadow .12s ease, transform .12s ease; }
.calendar-board-card:hover { box-shadow: 0 4px 10px rgb(23 33 43 / 16%); transform: translateY(-1px); }
.calendar-board-card-date { color: var(--spark-muted); font-size: 11px; font-weight: 700; }
.calendar-board-card-title { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #242b36; }
.calendar-board-card-status { align-self: flex-start; border-radius: 4px; background: #eef1f5; padding: 2px 6px; color: #5a6472; font-size: 10px; font-weight: 700; }
.calendar-board-empty { padding: 10px 4px 16px; text-align: center; }

@media (max-width: 700px) {
  .calendar-entry-main { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  .calendar-entry-meta,
  .calendar-content { margin-left: 0; }
  .calendar-content { align-items: flex-start; flex-wrap: wrap; }
  .calendar-content-title { flex-basis: calc(100% - 5rem); }
}

@media (min-width: 992px) {
  .page-body > .container-xl {
    padding-right: 2rem;
    padding-left: 2rem;
  }
}

.inline-editor summary,
.editor-panel summary,
.image-generation-notes summary {
  cursor: pointer;
  font-weight: 600;
}

.copy-buffer {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.copy-package {
  min-height: 12rem;
  line-height: 1.75;
  resize: vertical;
}

.final-manuscript {
  margin-bottom: 1rem;
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius-lg);
  background: var(--tblr-body-bg);
  overflow: hidden;
}
.final-manuscript-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--tblr-border-color);
}
.final-manuscript-heading h2 { margin: 0.25rem 0 0; }
.final-manuscript-body { padding: 1.5rem; line-height: 1.85; }
.final-manuscript-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--tblr-border-color);
  background: var(--tblr-gray-100);
}
.image-generation-notes { margin: 0 1.25rem 1.25rem; }

.import-assets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.import-asset {
  padding: 1rem;
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius);
  background: var(--tblr-gray-100);
}
.import-asset pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.import-image-slot {
  margin: 1rem 0;
  padding: 1rem;
  border: 2px dashed var(--tblr-border-color);
  border-radius: var(--tblr-border-radius);
  background: var(--tblr-gray-100);
}
.import-image-slot p, .import-image-slot figcaption { margin: 0.5rem 0 0; white-space: pre-wrap; }

.diff-block {
  padding: 1rem;
  overflow-x: auto;
  border-radius: var(--tblr-border-radius);
  background: var(--tblr-gray-100);
  font-family: var(--tblr-font-monospace, ui-monospace, monospace);
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff-added { display: block; }
.diff-removed { display: block; text-decoration: line-through; }
.diff-unchanged { display: block; color: var(--tblr-secondary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}


/* Workspace finish: clear hierarchy, quiet surfaces, and usable navigation. */
:root {
  --tblr-primary: var(--color-primary);
  --tblr-primary-rgb: 23, 59, 87;
  --tblr-body-color: var(--color-text);
  --tblr-secondary: var(--color-text-muted);
  --tblr-border-color: var(--color-border);
  --tblr-font-sans-serif: var(--font-sans);
}
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, .card-title { letter-spacing: -.025em; word-break: keep-all; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid #2a82bd; outline-offset: 3px; }
.visually-hidden-focusable:focus { position: fixed; z-index: 2000; top: 8px; left: 8px; padding: 12px 20px; color: white; background: var(--color-primary); border-radius: 8px; }
.brand-mark { color: #fff !important; font-weight: 800; background: var(--color-primary) !important; }
.platform-mark { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; overflow: hidden; border-radius: 22%; background: #eef2f6; box-shadow: 0 1px 2px rgb(15 23 42 / 12%); vertical-align: middle; }
.platform-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.platform-mark-sm { width: 24px; height: 24px; }
.platform-mark-md { width: 36px; height: 36px; }
.platform-mark-lg { width: 52px; height: 52px; }
.platform-mark-fallback { color: var(--spark-muted); font-size: 18px; }
.navbar-brand { min-height: 80px; padding: 16px 14px; justify-content: flex-start; }
.navbar-brand > a { flex-direction: row; justify-content: flex-start; gap: 12px !important; }
.navbar-brand strong { display: block !important; color: #f8fafc; font-size: 18px; letter-spacing: -.04em; }
.navbar-brand .avatar { flex-shrink: 0; width: 38px; height: 38px; font-size: 20px; background: #284c66 !important; border-radius: 11px !important; box-shadow: none; }
.brand-caption { display: block; margin-top: 5px; color: #a5b3c3; font-size: 10px; font-weight: 400; letter-spacing: 0; }
.page > .navbar.navbar-vertical { background: #182330; }
.page > .navbar.navbar-vertical .navbar-collapse { overflow-y: auto; min-height: 0; }
.page > .navbar.navbar-vertical .nav-section-title { margin: 18px 14px 7px; color: #9aaabc; font-size: 10px; font-weight: 600; text-align: left; text-indent: 0; line-height: 1.4; }
.page > .navbar.navbar-vertical .nav-section-title::after { display: none; }
.page > .navbar.navbar-vertical .nav-item { margin: 2px 8px; }
.page > .navbar.navbar-vertical .nav-link { min-height: 42px; flex-direction: row; justify-content: flex-start; gap: 9px; padding: 8px 10px; text-align: left; color: #bdc8d5; border-radius: 8px; }
.page > .navbar.navbar-vertical .nav-link-title { max-width: none; font-size: 13px; font-weight: 500; }
.page > .navbar.navbar-vertical .nav-link-icon { font-size: 20px; color: #99acbf; }
.page > .navbar.navbar-vertical .nav-link:hover { color: #fff; background: #253443; }
.page > .navbar.navbar-vertical .nav-item.active > .nav-link { color: #fff; background: #2c465a; }
.page > .navbar.navbar-vertical .nav-item.active > .nav-link .nav-link-icon { color: #a9d9f5; }
.page > .navbar.navbar-vertical .navbar-footer .nav-link { min-height: 44px; }
.page > .navbar.navbar-vertical .sidebar-nav {
  flex: 1 1 auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.page > .navbar.navbar-vertical .sidebar-nav::-webkit-scrollbar { display: none; }
.page > .navbar.navbar-vertical .sidebar-menu-list { padding: 10px 0 18px; }
.page > .navbar.navbar-vertical .sidebar-menu-list .nav-section-title {
  margin: clamp(10px, 1.6vh, 16px) 12px 5px;
  padding: 0 3px;
  color: #8193a6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.4;
}
.page > .navbar.navbar-vertical .sidebar-menu-list .nav-section-title:first-child { margin-top: 4px; }
.page > .navbar.navbar-vertical .sidebar-menu-list .nav-item { margin: 2px 7px; }
.page > .navbar.navbar-vertical .sidebar-menu-list .nav-link {
  position: relative;
  min-height: 42px;
  gap: 9px;
  padding: 8px 9px;
}
.page > .navbar.navbar-vertical .sidebar-menu-list .nav-link-icon {
  display: inline-flex;
  width: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}
.page > .navbar.navbar-vertical .sidebar-menu-list .nav-link-title {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page > .navbar.navbar-vertical .sidebar-menu-list .nav-item.active > .nav-link::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #7dd3fc;
  content: '';
}
.sidebar-group { margin: 3px 7px; list-style: none; }
.sidebar-group-header { display: flex; align-items: center; min-height: 44px; border-radius: 9px; }
.sidebar-group-header:hover { background: #253443; }
.sidebar-group-header.active { background: #22384a; }
.sidebar-group-link { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 9px; padding: 9px 4px 9px 10px; color: #d3dde7; text-decoration: none; }
.sidebar-group-link:hover { color: #fff; text-decoration: none; }
.sidebar-group-link .nav-link-title { font-size: 13px; font-weight: 700; }
.sidebar-group-toggle { display: inline-flex; flex: 0 0 34px; align-items: center; justify-content: center; align-self: stretch; padding: 0; border: 0; color: #91a2b4; background: transparent; }
.sidebar-group-toggle i { transition: transform .18s ease; }
.sidebar-group-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.sidebar-submenu { margin: 2px 0 7px; padding: 0 0 0 17px; list-style: none; border-left: 1px solid #34495c; }
.page > .navbar.navbar-vertical .sidebar-submenu .nav-item { margin: 1px 0 1px 8px; }
.page > .navbar.navbar-vertical .sidebar-submenu .nav-link { min-height: 35px; padding: 6px 8px; }
.page > .navbar.navbar-vertical .sidebar-submenu .nav-link-icon { width: 18px; flex-basis: 18px; font-size: 16px; }
.page > .navbar.navbar-vertical .sidebar-submenu .nav-link-title { font-size: 12px; }
.page > .navbar.navbar-vertical .sidebar-submenu .nav-item.active > .nav-link::before { top: 8px; bottom: 8px; }
.short-idea-details { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px 12px; margin: 0 0 16px; }
.short-idea-details dt { color: var(--spark-muted); font-size: 12px; font-weight: 700; }
.short-idea-details dd { margin: 0; white-space: pre-line; }
.production-plan-title { padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--tblr-border-color, #e6e7e9); }
.production-plan-title h3 { margin: 0; font-size: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.production-plan-details { grid-template-columns: 96px minmax(0, 1fr); gap: 14px 20px; }
.production-plan-details dt { white-space: nowrap; }
.production-plan-details dd { min-width: 0; overflow-wrap: anywhere; }
.production-plan-mode { display: inline-block; font-weight: 600; }
.short-scene-preview img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #edf1f5; }
.page > .navbar.navbar-vertical .sidebar-user {
  flex: 0 0 auto;
  padding: 10px;
  background: rgb(8 17 26 / 22%);
}
.page > .navbar.navbar-vertical .sidebar-user .nav-item { margin: 0; }
.page > .navbar.navbar-vertical .sidebar-user .nav-link { padding: 8px 10px; }
.page-body { padding: 26px 22px 36px; }
.page-body > .container-xl { max-width: 1440px; padding: 0; }
.page-body .page-header { min-height: 64px; margin-bottom: 24px; padding: 0 0 20px; border-bottom: 1px solid var(--color-border); border-radius: 0; background: none; }
.page-body .page-header .page-title { color: var(--color-text) !important; font-size: 24px; font-weight: 700; line-height: 1.4; }
.page-body .page-header .page-pretitle { margin-bottom: 5px; color: var(--color-text-muted) !important; font-size: 11px; opacity: 1; letter-spacing: .04em; }
.page-body .page-header .text-secondary { margin-top: 6px !important; color: var(--color-text-muted) !important; font-size: 13px; opacity: 1; }
.page-body .page-header .btn { color: var(--color-primary); border-color: var(--color-border); background: var(--color-surface); }
.btn { min-height: 38px; font-weight: 600; }
.btn-sm { min-height: 32px; font-size: 12px; }
.btn-primary, .page-body .page-header .btn-primary { color: #fff; background: var(--color-primary); border-color: var(--color-primary); }
.btn-primary:hover, .btn-primary:focus, .page-body .page-header .btn-primary:hover { color: #fff; background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.form-control, .form-select { min-height: 40px; border-color: var(--color-border); }
.form-control:focus, .form-select:focus { border-color: #6697ba; box-shadow: 0 0 0 3px rgb(42 130 189 / 12%); }
.form-label { font-size: 13px; font-weight: 600; }
.card { box-shadow: 0 2px 5px rgb(23 33 43 / 3%); }
.card-header { min-height: 56px; padding: 16px 20px; background: #fff; }
.card-body { padding: 20px; }
.card-footer { background: #fafbfd; }
.project-card { border: 1px solid #e0e6ee; color: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
.project-card:hover, .project-card-active { border-color: var(--spark-primary); box-shadow: 0 8px 24px rgb(6 111 209 / 10%); }
.project-symbol { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; font-size: 23px; }
.project-symbol-1 { color: #5d4bb7; background: #eeeafd; }
.project-symbol-2 { color: #c13c63; background: #fdebf1; }
.project-symbol-3 { color: #94651f; background: #fff2d9; }
.roadmap-track { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.roadmap-step { display: flex; min-height: 118px; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid #e2e7ed; border-radius: 10px; color: inherit; text-decoration: none; }
.roadmap-step:hover, .roadmap-step.active { border-color: var(--spark-primary); background: #f5f9ff; }
.roadmap-step span:last-child { color: var(--color-text-muted); font-size: 12px; }
.roadmap-year { color: var(--spark-primary); font-size: 11px; font-weight: 700; }
.project-edit-details[open] { flex: 1 0 100%; order: 3; margin: 8px 0 0 !important; }
.project-edit-details[open] > summary { width: max-content; margin-left: auto; }
.project-edit-popover { position: static; width: 100%; margin-top: 12px; padding: 16px 0 4px; border-top: 1px solid #e5e9ef; background: #fff; }
.character-card { height: 100%; padding: 14px; border: 1px solid #e2e7ed; border-radius: 10px; background: #fbfcfe; }
.short-storyboard-frame { display: flex; align-items: center; min-height: 150px; padding: 20px; border-radius: 10px; background: #172235; color: #fff; line-height: 1.6; }
.short-storyboard-image { display: block; width: 100%; max-height: 460px; object-fit: contain; border-radius: 10px; background: #172235; }
.relationship-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.relationship-list > div { padding: 12px; border-left: 3px solid #b7c4d3; background: #f7f9fb; }
.production-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.production-step { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; color: #7a8594; background: #f3f5f7; }
.production-step span { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: #fff; }
.production-step.active { color: #0b5cad; background: #eaf4ff; }
.production-step.complete { color: #247347; background: #eaf8f0; }
.production-step.warning { color: #925d00; background: #fff3d8; }
.scene-production-card { border-left: 4px solid #d7dee7; }
.scene-edit-instruction { min-height: 72px; padding: 12px; border: 1px solid #e0e5eb; border-radius: 8px; background: #f8fafc; }
.scene-status-select { width: 140px; }
.final-video-preview { max-height: 70vh; background: #111; }
.final-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.final-check-item { margin: 0; padding: 12px 12px 12px 38px; border: 1px solid #e0e5eb; border-radius: 8px; background: #fbfcfd; }
.production-quick-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.production-quick-nav a { padding: 6px 14px; border-radius: 999px; background: #f3f5f7; color: #4f5b6a; font-size: 13px; font-weight: 600; text-decoration: none; }
.production-quick-nav a:hover { background: #eaf4ff; color: #0b5cad; }
.flow-step-heading { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; }
.flow-step-heading:first-child { margin-top: 0; }
.flow-step-heading .flow-step-number { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--spark-primary); color: #fff; font-size: 13px; font-weight: 700; }
.flow-step-heading h3 { margin: 0; font-size: 15px; font-weight: 700; }
.flow-tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.flow-tech-item { padding: 12px 14px; border: 1px solid #e2e7ed; border-radius: 10px; background: #fbfcfe; }
.flow-tech-item .flow-tech-label { color: var(--spark-muted); font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.flow-tech-item .flow-tech-value { margin-top: 4px; font-size: 14px; }
.flow-scene-card { margin-bottom: 16px; padding: 16px; border: 1px solid #e2e7ed; border-radius: 12px; background: #fff; }
.flow-scene-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.flow-scene-head h4 { margin: 0; font-size: 16px; font-weight: 700; }
.flow-scene-setting { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: #f7f9fb; font-size: 13px; color: #4f5b6a; }
.flow-mix-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.flow-mix-guide .flow-mix-section { padding: 14px; border: 1px solid #e2e7ed; border-radius: 10px; background: #f7f9fb; }
.flow-mix-guide .flow-mix-section h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.flow-mix-guide .flow-mix-section ul { margin: 0; padding-left: 18px; font-size: 13px; color: #333; }
.production-character { margin-bottom: 16px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); }
.production-character:last-child { margin-bottom: 0; }
.production-character > summary { padding: 14px 16px; cursor: pointer; color: var(--color-text); font-weight: 600; }
.production-character > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -3px; border-radius: 10px; }
.production-character[open] > summary { border-bottom: 1px solid var(--color-border); }
.production-character-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; padding: 16px; }
.production-prompt-field { min-width: 0; }
.production-field-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.production-field-heading .form-label { margin-bottom: 0; }
.production-field-heading .btn { flex: 0 0 auto; }
.production-character textarea, #production-generate textarea { font-size: 12px; line-height: 1.7; background: #fafbfd; resize: vertical; }
.production-story { line-height: 1.8; resize: vertical; }
.production-scene-connections { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px 12px; margin: 14px 0; padding: 14px; border-left: 3px solid var(--color-primary); border-radius: 6px; background: #f5f9fc; }
.production-scene-connections dt { color: var(--color-text-muted); font-size: 12px; font-weight: 600; }
.production-scene-connections dd { margin: 0; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.flow-scene-head h4 { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.flow-scene-head .badge { max-width: 100%; white-space: normal; line-height: 1.5; text-align: left; }
.flow-scene-setting, .flow-tech-value, .flow-mix-section li { overflow-wrap: anywhere; }
.flow-tech-grid, .flow-mix-guide { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.production-quick-nav a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.production-quick-nav { position: sticky; top: 12px; z-index: 20; align-items: center; flex-wrap: nowrap; padding: 8px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); box-shadow: 0 3px 12px rgb(23 33 43 / 6%); }
.production-nav-links { display: flex; flex: 1 1 auto; min-width: 0; gap: 8px; overflow-x: auto; padding: 3px; }
.production-nav-links a { flex: 0 0 auto; white-space: nowrap; }
.production-scene-jump { flex: 0 0 128px; width: 128px; }
.production-plan-title { margin-bottom: 12px; }
.production-plan-expanded > summary { cursor: pointer; width: fit-content; padding: 6px 0; font-weight: 600; color: var(--color-primary); }
.production-plan-expanded[open] > summary { margin-bottom: 16px; }
#production-plan, #production-references, #production-generate, #production-result, #final-review, .flow-scene-card { scroll-margin-top: 96px; }
.table th { color: var(--color-text-muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; background: #f8fafc; }
.table td { padding-top: 14px; padding-bottom: 14px; vertical-align: middle; }
.topic-card:hover { transform: none; }
.calendar-grid-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.calendar-list-view { border: 1px solid #e3e7ed; border-radius: 10px; overflow: hidden; background: #fff; }
.calendar-list-row { display: flex; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #eef1f5; }
.calendar-list-row:last-child { border-bottom: 0; }
.calendar-list-row-today { background: #f5f9ff; }
.calendar-list-day-col { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 0 34px; padding-top: 1px; }
.calendar-list-weekday { font-size: 10px; font-weight: 700; color: #8a95a5; letter-spacing: .02em; }
.calendar-list-daynum { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 600; color: #2a3342; }
.calendar-list-daynum-today { background: var(--spark-primary); color: #fff !important; }
.calendar-list-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.calendar-list-badges { display: flex; align-items: center; gap: 6px; min-height: 20px; }
.calendar-list-add { margin-left: auto; color: #9aa5b3; font-size: 15px; line-height: 1; }
.calendar-list-add:hover { color: var(--spark-primary); }
.calendar-list-empty { color: #b7bfc9; font-size: 12px; }
.calendar-list-body .calendar-grid-signal,
.calendar-list-body .calendar-grid-recommendation,
.calendar-list-body .calendar-day-entries { margin-top: 0; }
.final-manuscript-body a { text-decoration: underline; text-underline-offset: 3px; }
.login-page {
  position: relative;
  background:
    radial-gradient(circle at top left, rgb(255 255 255 / 85%) 0, rgb(255 255 255 / 0%) 38%),
    radial-gradient(circle at bottom right, rgb(6 111 209 / 12%) 0, rgb(6 111 209 / 0%) 42%),
    linear-gradient(180deg, #f7f9fc 0%, #edf2f7 100%);
}
.login-page::before,
.login-page::after {
  position: fixed;
  z-index: 0;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  content: "";
  pointer-events: none;
  filter: blur(8px);
  opacity: .65;
}
.login-page::before {
  top: -120px;
  left: -120px;
  background: radial-gradient(circle, rgb(6 111 209 / 16%) 0, rgb(6 111 209 / 0%) 70%);
}
.login-page::after {
  right: -120px;
  bottom: -140px;
  background: radial-gradient(circle, rgb(174 62 201 / 10%) 0, rgb(174 62 201 / 0%) 70%);
}
.login-page .page { position: relative; z-index: 1; }
.login-page .container-tight { max-width: 380px; }
.login-page .card { border: 1px solid rgb(220 227 234 / 92%); border-radius: 24px; box-shadow: 0 20px 60px rgb(23 33 43 / 10%); overflow: hidden; backdrop-filter: blur(10px); }
.login-page .card-body { padding: 28px 26px 24px; }
.login-page .form-control, .login-page .btn { min-height: 44px; }
.login-page .form-control { border-radius: 12px; }
.login-page .btn { border-radius: 12px; font-weight: 700; }
.login-page h1 { font-size: 20px; letter-spacing: -0.02em; }
.login-page .brand-mark { width: 44px; height: 44px; border-radius: 14px !important; box-shadow: 0 10px 22px rgb(6 111 209 / 18%); }
@media (min-width: 992px) {
  .page > .navbar.navbar-vertical .navbar-toggler { display: none; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  :root { --spark-sidebar-width: 180px; }
  .navbar-brand { padding-inline: 12px; }
  .page > .navbar.navbar-vertical .sidebar-menu-list .nav-item { margin-inline: 6px; }
}
@media (min-width: 992px) and (max-height: 760px) {
  .navbar-brand { min-height: 70px; padding-block: 12px; }
  .brand-caption { display: none; }
  .page > .navbar.navbar-vertical .sidebar-menu-list { padding-block: 6px 10px; }
  .page > .navbar.navbar-vertical .sidebar-menu-list .nav-section-title { margin-top: 9px; margin-bottom: 3px; }
  .page > .navbar.navbar-vertical .sidebar-menu-list .nav-link { min-height: 36px; padding-block: 7px; }
  .page > .navbar.navbar-vertical .sidebar-user { padding-block: 7px; }
}
@media (max-width: 991.98px) {
  .page > .navbar.navbar-vertical { position: relative; width: 100% !important; min-width: 0 !important; bottom: auto; }
  .page > .navbar.navbar-vertical > .container-fluid { flex-direction: row; flex-wrap: wrap; align-items: center; height: auto; padding: 0 16px; }
  .navbar-brand { width: auto; min-height: 68px; margin-right: auto; padding: 12px; border: 0; }
  .navbar-brand > a { width: auto; }
  .brand-caption { display: none; }
  .page > .navbar.navbar-vertical .navbar-toggler { color: #dbe5ef; border-color: #617283; }
  .page > .navbar.navbar-vertical .navbar-toggler-icon { filter: invert(1); }
  .page > .navbar.navbar-vertical .navbar-collapse:not(.show):not(.collapsing) { display: none !important; }
  .page > .navbar.navbar-vertical .navbar-collapse { order: 4; max-height: calc(100vh - 68px); padding-bottom: 12px; }
  .page > .navbar.navbar-vertical .navbar-footer { margin: 0; padding: 0; border: 0; }
  .page > .navbar.navbar-vertical .navbar-footer .nav-link-title { max-width: 90px; }
  .page > .navbar.navbar-vertical .nav-section-title { margin-top: 12px; }
  .page > .navbar.navbar-vertical .sidebar-menu-list { padding-top: 6px; }
  .page > .navbar.navbar-vertical .sidebar-menu-list .nav-item { margin-inline: 4px; }
  .page > .navbar.navbar-vertical .sidebar-menu-list .nav-link { min-height: 44px; }
  .page-wrapper { width: 100%; min-height: calc(100vh - 68px); margin-inline-start: 0 !important; }
  .page-body { padding: 22px 20px 32px; }
  .page-body .page-header { margin-bottom: 20px; }
}
@media (max-width: 767.98px) {
  .calendar-grid-scroll .calendar-month-grid { min-width: 760px; overflow: visible; }
  .page-body .page-header .page-title { font-size: 21px; }
  .page-body .page-header .row { row-gap: 12px; }
  .page-body .page-header .col-auto { max-width: 100%; }
  .final-manuscript-heading { flex-direction: column; }
  .final-manuscript-heading .btn { min-height: 44px; }
  .import-assets { grid-template-columns: minmax(0, 1fr); }
  .card-header { flex-wrap: wrap; gap: 10px; }
  .relationship-list, .final-check-grid { grid-template-columns: 1fr; }
  .production-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .production-step { flex-direction: column; gap: 6px; padding: 8px 3px; text-align: center; font-size: 11px; }
  .production-step strong { overflow-wrap: anywhere; }
  .production-page-header .row > .col { flex: 0 0 100%; }
  .production-page-header .row > .col-auto { margin-left: auto; }
  .production-plan-details { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .production-plan-details dt { white-space: normal; }
  .production-character-grid { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .production-scene-connections { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 6px; }
  .flow-scene-card { padding: 12px; }
  .production-quick-nav a { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 12px; }
  .btn, .form-control, .form-select { min-height: 44px; }
}
@media (max-width: 479.98px) {
  .page-body { padding: 18px 12px 28px; }
  .card-body, .card-header { padding: 16px; }
  .navbar-brand strong { font-size: 16px; }
  .navbar-brand { padding: 10px; }
  .page > .navbar.navbar-vertical .navbar-footer .nav-link-title { display: none; }
  .login-page .card-body { padding: 24px; }
}
@media print {
  .page > .navbar.navbar-vertical { display: none !important; }
  .page-wrapper { width: 100%; margin-inline-start: 0 !important; }
  .page-body { padding: 0; }
}

/* 대시보드 게시 현황: 채널(플랫폼 사용자)별 범주 색. 라이트 표면 기준으로 검증한 8색을 고정 순서로 쓴다. */
.pub-dash, .pub-channel, .pub-tip, .card-table {
  --pub-surface: #fcfcfb;
  --pub-grid: #e1e0d9;
  --pub-axis: #c3c2b7;
  --pub-muted: #898781;
  --pub-series-0: #2a78d6; --pub-series-1: #eb6834; --pub-series-2: #1baf7a; --pub-series-3: #eda100;
  --pub-series-4: #e87ba4; --pub-series-5: #008300; --pub-series-6: #4a3aa7; --pub-series-7: #e34948;
  --pub-series-other: #898781;
}
.pub-series-0 { background: var(--pub-series-0); } .pub-series-1 { background: var(--pub-series-1); }
.pub-series-2 { background: var(--pub-series-2); } .pub-series-3 { background: var(--pub-series-3); }
.pub-series-4 { background: var(--pub-series-4); } .pub-series-5 { background: var(--pub-series-5); }
.pub-series-6 { background: var(--pub-series-6); } .pub-series-7 { background: var(--pub-series-7); }
.pub-series-other { background: var(--pub-series-other); }
.pub-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; flex-shrink: 0; }
.pub-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; padding: 0; font-size: 13px; }
.pub-legend li { display: inline-flex; align-items: center; }
.pub-plot { display: grid; grid-template-columns: 32px 1fr; height: 240px; padding-bottom: 22px; }
.pub-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding-right: 8px; font-size: 11px; color: var(--pub-muted); line-height: 1; }
.pub-cols { display: grid; position: relative; border-bottom: 1px solid var(--pub-axis);
  background: linear-gradient(var(--pub-grid), var(--pub-grid)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--pub-grid), var(--pub-grid)) 0 50% / 100% 1px no-repeat; }
.pub-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; outline: none; }
.pub-col:hover, .pub-col:focus-visible { background: rgba(11, 11, 11, .04); }
.pub-stack { position: relative; flex: 1; width: 100%; max-width: 24px; margin: 0 auto; display: flex; flex-direction: column-reverse; }
.pub-seg { min-height: 4px; box-sizing: border-box; border-top: 2px solid var(--pub-surface); }
.pub-seg:first-child { border-top: 0; }
.pub-seg:last-child { border-radius: 4px 4px 0 0; }
.pub-total { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: #0b0b0b; }
.pub-x { position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; font-size: 12px; color: var(--pub-muted); }
.pub-channel { border: 1px solid transparent; }
.pub-channel:hover { border-color: var(--pub-axis); }
.pub-channel-selected { border-color: #2a78d6; box-shadow: 0 0 0 1px #2a78d6; }
.pub-tip { position: fixed; z-index: 1080; min-width: 140px; padding: 8px 10px; border-radius: 6px; background: #fff; color: #0b0b0b; font-size: 12px; box-shadow: 0 2px 10px rgba(11, 11, 11, .18); border: 1px solid rgba(11, 11, 11, .1); pointer-events: none; }
.pub-tip-head { font-weight: 600; margin-bottom: 4px; }
.pub-tip-row { display: flex; align-items: center; gap: 6px; }
.pub-tip-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
@media (max-width: 575.98px) { .pub-plot { height: 200px; } .pub-total { font-size: 11px; } }

/* 음성 대본: 인물 대사와 나레이션을 두 트랙으로 구분한다. */
.voice-scene { margin-bottom: 20px; }
.voice-scene-head { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.voice-cue { padding: 8px 12px; margin-bottom: 8px; border-left: 3px solid #2a78d6; background: rgba(42, 120, 214, .05); border-radius: 0 6px 6px 0; }
.voice-cue-narration { margin-left: 28px; border-left-color: #898781; background: rgba(137, 135, 129, .08); }
.voice-cue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.voice-cue-line { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.voice-cue-direction { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 13px; }
.voice-cue-direction dt { color: #898781; font-weight: 500; }
.voice-cue-direction dd { margin: 0; }

/* 최종 점검 */
.final-check-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #e6eaef; }
.final-check-item:has(input:checked) { border-color: #9bd0a9; background: #f2faf4; }
.final-check-auto { opacity: .85; }

/* 최종 믹싱 가이드: 접이식 섹션을 한 열로 정리한다. */
.flow-mix-guide { display: grid; grid-template-columns: 1fr; gap: 10px; }
.flow-mix-guide .flow-mix-section { padding: 0; border: 1px solid #e2e7ed; border-radius: 10px; background: #fff; }
.flow-mix-guide .flow-mix-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 700; list-style: none; }
.flow-mix-guide .flow-mix-section > summary::-webkit-details-marker { display: none; }
.flow-mix-guide .flow-mix-section[open] > summary { border-bottom: 1px solid #edf0f4; background: #f7f9fb; border-radius: 10px 10px 0 0; }
.flow-mix-guide .flow-mix-section ul, .flow-mix-guide .flow-mix-section ol { margin: 0; padding: 12px 14px 12px 32px; font-size: 13px; line-height: 1.6; }
.flow-mix-guide .flow-mix-section li + li { margin-top: 6px; }

/* 에피소드 보드 카드 */
.episode-card { border: 1px solid #e3e8ef; border-radius: 14px; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.episode-card:hover { border-color: #b9d3f2; box-shadow: 0 10px 26px rgb(6 111 209 / 10%); }
.episode-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.episode-date { display: inline-flex; align-items: center; gap: 4px; color: #6b7686; }
.episode-score { margin-left: auto; font-weight: 700; color: #066fd1; }
.episode-score small { color: #8a94a3; font-weight: 500; }
.episode-score .episode-score-label { margin-right: 2px; font-size: 12px; }
.episode-youtube { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 10px; font-size: 13px; }
.episode-youtube-item { display: inline-flex; align-items: center; gap: 6px; }
.youtube-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid #e3e8ef; }
.youtube-section-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
#production-youtube-history .form-select { width: auto; }
.episode-title { min-height: 2.8em; margin: 0 0 6px; font-size: 16px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-hook { min-height: 2.6em; margin: 0 0 14px; color: #586274; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-hook::before { content: "“"; }
.episode-hook::after { content: "”"; }
.episode-stages { display: flex; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.episode-stages li { display: flex; flex: 1; flex-direction: column; gap: 4px; color: #8a94a3; font-size: 11px; }
.episode-stages li span { height: 4px; border-radius: 2px; background: #e3e8ef; }
.episode-stages li.done { color: #1f8a4c; }
.episode-stages li.done span { background: #2fb344; }
.episode-stages li.current { color: #b57500; }
.episode-stages li.current span { background: #f59f00; }
.episode-state { display: flex; align-items: center; gap: 8px; }
.episode-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 14px; }
.episode-manage { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-top: 1px solid #edf0f4; background: #fafbfc; }
@media (max-width: 575.98px) { .episode-actions { grid-template-columns: 1fr; } }

/* 유튜브 업로드 카드 */
.youtube-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px; padding: 0; list-style: none; }
.youtube-checks li { display: inline-flex; align-items: center; gap: 6px; color: #8a94a3; font-size: 13px; }
.youtube-checks li.done { color: #1f8a4c; }
.youtube-preview { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.youtube-preview dt { color: #8a94a3; font-weight: 500; }
.youtube-preview dd { margin: 0; overflow-wrap: anywhere; }
.youtube-preview-text { white-space: pre-line; max-height: 7.5em; overflow: auto; }
.youtube-thumb { display: block; max-width: 180px; max-height: 240px; border-radius: 8px; border: 1px solid #e3e8ef; }
