:root {
  color-scheme: light;
  --bg: #f7f3ff;
  --bg-2: #e8f4f5;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --text: #242238;
  --muted: #716d83;
  --line: rgba(57, 49, 91, 0.14);
  --accent: #6255d8;
  --accent-2: #ef6aa8;
  --accent-3: #22a8a1;
  --success: #1f9b79;
  --warn: #c07a21;
  --shadow: 0 18px 40px rgba(75, 61, 115, 0.12);
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(98, 85, 216, 0.11), transparent 28%),
    linear-gradient(225deg, rgba(239, 106, 168, 0.10), transparent 32%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.03));
}

.page-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 20px auto 32px;
}

.topbar, .hero-strip, .panel {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.topbar {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  justify-content: stretch;
  gap: 16px;
  align-items: center;
  padding: 22px 24px;
  background: rgba(255,255,255,.7);
  border-radius: 14px;
  border-top: 3px solid var(--accent-2);
}

.topbar::after {
  content: "// 01";
  position: absolute;
  right: 18px;
  bottom: 8px;
  color: rgba(98,85,216,.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  pointer-events: none;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1, h2, h3 {
  margin: 0;
  font-family: "Fraunces", "Noto Serif SC", serif;
  font-weight: 650;
  letter-spacing: 0;
}

h1 { font-size: clamp(28px, 3vw, 44px); line-height: 1.05; margin-top: 8px; text-shadow: 3px 3px 0 rgba(239,106,168,.12); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

.topbar-actions, .chip-row, .filter-row, .tag-row, .hero-stats, .prompt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-left: 3px solid var(--accent-3);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.66);
}

.notification-btn span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  border-radius: 10px;
  color: #fff;
  background: var(--accent-2);
  font-size: 10px;
}

.notification-panel {
  position: absolute;
  z-index: 30;
  right: 20px;
  top: calc(100% - 12px);
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-2);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.notification-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.notification-head button { color: var(--muted); background: transparent; font-size: 11px; }
.notification-item { padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.notification-item.unread { color: var(--accent); font-weight: 700; }
.notification-empty { margin: 12px 0; color: var(--muted); font-size: 12px; }

button, input, select, textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.primary-btn, .ghost-btn, .filter, .icon-btn {
  border-radius: 8px;
  padding: 11px 14px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.primary-btn {
  background: var(--text);
  color: #fff;
}

.ghost-btn, .filter, .icon-btn {
  background: rgba(255,255,255,.68);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary-btn:hover, .ghost-btn:hover, .filter:hover, .icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(98,85,216,.13);
}

.full { width: 100%; justify-content: center; }

.hero-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.keyword {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  padding: 10px 14px;
  color: var(--text);
}

.keyword.active {
  background: var(--text);
  color: #fff;
}

.keyword-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.panel-main {
  min-height: 100%;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.sidebar-stats div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.sidebar-stats strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}

.sidebar-stats span {
  color: var(--muted);
  font-size: 12px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

.project-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.62);
  white-space: nowrap;
}

.project-switcher > span {
  padding: 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.project {
  border: 0;
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
}

.project.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 12px rgba(98,85,216,.24);
}

.board-tabs {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 16px;
  padding: 14px 18px;
  border-left: 4px solid var(--accent-2);
  background: rgba(255,255,255,.78);
}

.board-tabs::after {
  content: "TEAM / PLAYBOOK";
  position: absolute;
  right: 18px;
  top: 8px;
  color: rgba(239,106,168,.28);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.board-tab-copy {
  display: grid;
  gap: 2px;
  min-width: 175px;
}

.board-tab-copy .hero-label { margin: 0; color: var(--accent-2); }
.board-tab-copy strong { font-family: "Fraunces", serif; font-size: 18px; }
.board-tab-copy small { color: var(--muted); font-size: 12px; }

.board-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.board-tab {
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.board-tab.active {
  color: var(--text);
  border-color: rgba(98,85,216,.22);
  background: rgba(98,85,216,.10);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--accent-2);
}

.board-online { color: var(--muted); font-size: 12px; white-space: nowrap; }
.board-online i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--success); }
.board-online b { color: var(--text); }

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0 4px;
}

.list-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.prompt-library {
  position: sticky;
  top: 16px;
  padding: 18px;
  border-top: 3px solid var(--accent-2);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(247,243,255,.82));
}

.prompt-library-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.prompt-library-head .hero-label { margin: 0 0 4px; color: var(--accent-2); font-size: 11px; letter-spacing: .08em; }
.prompt-total { color: var(--accent); font-size: 12px; font-weight: 700; }
.prompt-library-note { margin: 12px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.prompt-items { display: grid; gap: 8px; }

.prompt-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.prompt-item[open] { border-color: rgba(98,85,216,.34); box-shadow: 0 7px 16px rgba(98,85,216,.08); }

.prompt-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.prompt-item summary::-webkit-details-marker { display: none; }
.prompt-item summary::after { content: "+"; color: var(--accent); font-size: 17px; font-weight: 500; }
.prompt-item[open] summary::after { content: "-"; }
.prompt-key { font-weight: 700; }
.prompt-action { color: var(--muted); font-size: 11px; }

.prompt-item-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px dashed var(--line);
}

.prompt-item-body p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.prompt-manage { margin-top: 14px; }

.prompt-drawer {
  position: relative;
  margin: 12px 0 4px;
  border: 1px solid rgba(98,85,216,.18);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(247,243,255,.92), rgba(233,250,249,.70));
  overflow: hidden;
}

.prompt-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.prompt-drawer-head > div { display: grid; gap: 2px; }
.prompt-drawer-head .hero-label { margin: 0; color: var(--accent); }
.prompt-drawer-head strong { font-size: 14px; }
.prompt-toggle span { color: var(--accent); font-size: 16px; }
.prompt-drawer.open .prompt-toggle span { display: inline-block; transform: rotate(180deg); }

.prompt-drawer .keyword-row {
  margin: 0;
  padding: 0 14px 14px;
}

.prompt-expanded {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid rgba(98,85,216,.14);
}

.prompt-drawer.open .prompt-expanded { display: flex; }
.prompt-expanded p { margin: 0; color: var(--muted); font-size: 13px; }

.panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-pill, .badge, .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.status-pill.active, .badge.success {
  background: rgba(15, 139, 86, 0.12);
  color: var(--success);
}

.badge.warn {
  background: rgba(161, 98, 7, 0.12);
  color: var(--warn);
}

.badge.muted {
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}

.upload-zone {
  border: 1px dashed rgba(23, 23, 23, 0.2);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255,255,255,.64);
  margin-bottom: 16px;
}

.upload-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

.upload-zone p {
  margin: 0 0 6px;
  font-weight: 600;
}

.upload-zone span, .result-desc, .detail-block strong, .prompt-card p, .hero-copy p {
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
}

label span, .text-field span {
  font-size: 12px;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.6;
}

.text-field {
  margin-top: 12px;
}

.chip-row, .filter-row, .tag-row {
  margin: 12px 0 16px;
}

.chip {
  background: rgba(255,255,255,.72);
}

.searchbar {
  position: relative;
  flex: 1;
}

.searchbar input {
  width: 100%;
  padding-right: 38px;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 26px;
  height: 26px;
  padding: 0;
  transform: translateY(-50%);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.search-clear:hover { color: var(--text); background: rgba(98,85,216,.08); }

.result-list {
  display: grid;
  gap: 12px;
  counter-reset: work;
}

.list-heading {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 184px;
  gap: 16px;
  padding: 16px 16px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.list-heading::after {
  content: "WORKFLOW INDEX";
  position: absolute;
  right: 16px;
  color: rgba(98,85,216,.35);
  font-size: 10px;
  letter-spacing: .12em;
}

.result-card, .detail-panel, .prompt-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  padding: 16px;
}

.work-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 184px;
  gap: 16px;
  align-items: stretch;
  min-height: 166px;
  border-left: 4px solid var(--accent-3);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  counter-increment: work;
}

.work-row::before {
  content: "0" counter(work);
  position: absolute;
  right: 12px;
  top: 8px;
  color: rgba(98,85,216,.20);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.work-row:hover {
  border-color: rgba(98,85,216,.42);
  box-shadow: 0 10px 24px rgba(75, 61, 115, .12);
  transform: translateY(-1px);
}

.work-row.selected {
  border-color: rgba(98,85,216,.55);
  box-shadow: 0 10px 26px rgba(75, 61, 115, .14);
}

.comment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 14px;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.comment-toggle b {
  color: var(--muted);
  font-weight: 500;
}

.comment-toggle:hover b { color: var(--accent); }

.comment-thread {
  display: grid;
  grid-column: 1 / -1;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  animation: thread-in .2s ease-out;
}

.comment-thread[hidden] { display: none; }

@keyframes thread-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.thread-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.thread-head > div { display: grid; gap: 3px; }
.thread-head .hero-label { margin: 0; color: var(--accent-2); font-size: 10px; letter-spacing: .1em; }
.thread-head strong { font-size: 14px; }
.thread-status { color: var(--success); font-size: 11px; white-space: nowrap; }

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
}

.comment-item.comment-reply {
  margin-left: 34px;
  border-left: 3px solid var(--accent-3);
  background: rgba(233,250,249,.48);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px 5px 9px 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.avatar-pink { background: var(--accent-2); }
.avatar-teal { background: var(--accent-3); }
.avatar-purple { background: var(--accent); }
.avatar-blue { background: #4c83c3; }

.comment-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-meta strong { font-size: 13px; }
.comment-meta span { color: var(--muted); font-size: 11px; }
.comment-item p { margin: 5px 0 7px; color: var(--text); font-size: 13px; line-height: 1.6; }
.reply-comment { padding: 0; color: var(--accent); background: transparent; font-size: 12px; }

.comment-composer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(98,85,216,.20);
  border-radius: 8px;
  background: rgba(247,243,255,.62);
}

.comment-composer textarea {
  min-height: 64px;
  resize: vertical;
  background: rgba(255,255,255,.84);
}

.reply-target {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
}

.reply-target .clear-reply { padding: 0; color: var(--muted); background: transparent; font-size: 11px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-actions > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attach-btn { display: inline-flex; align-items: center; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: rgba(255,255,255,.72); font-size: 11px; cursor: pointer; }
.attach-btn:hover { color: var(--accent); border-color: rgba(98,85,216,.34); }
.attachment-name { max-width: 190px; overflow: hidden; color: var(--accent-3); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.work-reference, .work-result {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-width: 0;
}

.work-reference > span, .work-result > span {
  color: var(--muted);
  font-size: 12px;
}

.work-prompt {
  min-width: 0;
  display: grid;
  align-content: start;
}

.segment-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.segment-ribbon span {
  padding: 4px 8px;
  border-radius: 4px 8px 4px 8px;
  color: var(--accent);
  background: rgba(98,85,216,.09);
  font-size: 11px;
  font-weight: 700;
}

.segment-ribbon span:nth-child(2) {
  color: #c54d8a;
  background: rgba(239,106,168,.11);
}

.prompt-preview {
  margin: 12px 0 0;
  color: var(--text);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-prompt .tag-row {
  margin: 12px 0 0;
}

.thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: "Fraunces", serif;
  font-size: 34px;
  color: #fff;
}

.thumb img, .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.thumb-reference {
  min-height: 96px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  background-image: linear-gradient(135deg, rgba(255,255,255,.16), transparent 48%), repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 2px, transparent 2px 9px);
}

.result-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.thumb-result {
  aspect-ratio: 1 / 1;
  min-width: 0;
  font-size: 22px;
}

.thumb-result.alt {
  filter: saturate(.72) brightness(1.12);
}

.thumb-poster { background: linear-gradient(135deg, #6255d8, #2c237c); }
.thumb-video { background: linear-gradient(135deg, #ef6aa8, #9d3267); }
.thumb-brand { background: linear-gradient(135deg, #22a8a1, #126b74); }

.result-body {
  min-width: 0;
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.result-top p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-desc {
  line-height: 1.6;
  margin: 10px 0 0;
}

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(255,255,255,.72);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.detail-block {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.detail-block:last-child { border-bottom: 0; }

.detail-block span {
  font-size: 12px;
  color: var(--muted);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.timeline li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child { border-bottom: 0; }

.timeline strong {
  color: var(--accent);
}

.timeline span {
  color: var(--muted);
}

.prompt-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.prompt-card p {
  margin: 0;
  line-height: 1.65;
}

.prompt-toolbar {
  margin-top: 4px;
}

.filter.active {
  background: var(--text);
  color: #fff;
}

.icon-btn {
  padding: 7px 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(16, 16, 16, 0.34);
  z-index: 20;
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fffdf8;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px rgba(20, 16, 12, 0.24);
  padding: 22px;
}

.modal-head, .modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.upload-box {
  border: 1px dashed rgba(23, 23, 23, 0.2);
  border-radius: 8px;
  background: rgba(255,255,255,.7);
  min-height: 120px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 14px;
}

.upload-box input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 0;
  background: transparent;
  font-size: 11px;
}

.segment-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.segment-upload-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247,243,255,.55);
}

.segment-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.segment-label strong { color: var(--accent); }
.segment-label span { color: var(--muted); font-size: 12px; }
.segment-upload-card .upload-box { min-height: 106px; }
.upload-box-result { margin-top: 12px; }

.upload-box strong {
  font-size: 16px;
}

.upload-box span {
  color: var(--muted);
  font-size: 13px;
}

.modal-actions {
  margin-top: 18px;
}

.auth-modal { width: min(460px, 100%); }
.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 18px 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(247,243,255,.72); }
.auth-tab { padding: 10px; border-radius: 6px; color: var(--muted); background: transparent; }
.auth-tab.active { color: #fff; background: var(--accent); font-weight: 700; }
.auth-form { display: grid; gap: 13px; }
.auth-form[hidden] { display: none; }
.detail-empty { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.detail-segment { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.detail-segment:last-child { border-bottom: 0; }
.detail-segment strong { display: block; margin-bottom: 5px; color: var(--accent); font-size: 13px; }
.detail-segment p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.prompt-actions { display: flex; gap: 7px; margin-top: 10px; }
.prompt-actions .icon-btn { flex: 1; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--accent-2); font-size: 12px; }
.prompt-form-modal { width: min(620px, 100%); }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(480px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.empty-state { grid-column: 1 / -1; padding: 44px 20px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.media-link { color: var(--accent); font-size: 11px; }

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    margin: 10px auto 20px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .project-switcher { justify-content: space-between; }
  .project { flex: 1; }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .ghost-btn,
  .topbar-actions .primary-btn {
    flex: 1;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace { grid-template-columns: 1fr; }
  .prompt-library { position: static; }
  .board-tabs { grid-template-columns: 1fr; gap: 12px; }
  .board-tab-copy { min-width: 0; }
  .board-online { justify-self: start; }
  .list-toolbar { align-items: stretch; flex-direction: column; }
  .list-toolbar .primary-btn { width: 100%; }

  .modal-grid, .segment-upload-grid {
    grid-template-columns: 1fr;
  }

  .list-heading {
    display: none;
  }

  .work-row {
    grid-template-columns: 92px minmax(0, 1fr) 112px;
    gap: 10px;
    padding: 12px;
    min-height: 140px;
  }

  .thumb-reference {
    min-height: 68px;
  }

  .thumb-result {
    font-size: 16px;
  }

  .work-prompt h3 {
    font-size: 16px;
  }

  .comment-item.comment-reply { margin-left: 16px; }
  .thread-head { display: block; }
  .thread-status { display: inline-block; margin-top: 6px; }
  .composer-actions { align-items: stretch; flex-direction: column; }
  .composer-actions .primary-btn { width: 100%; }

  .result-top {
    display: block;
  }

  .result-top .badge {
    margin-top: 8px;
  }

  .tag-row span {
    padding: 5px 7px;
  }
}
