:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --ink-panel: #111827;
  --line: #e1e6ee;
  --line-strong: #cfd7e4;
  --text: #121826;
  --muted: #667085;
  --faint: #98a2b3;
  --primary: #1f4f8f;
  --primary-dark: #173b6b;
  --primary-soft: #edf3fa;
  --accent: #dfe7ef;
  --ok: #168a53;
  --ok-soft: #e9f7ef;
  --warn: #b76a00;
  --warn-soft: #fff4df;
  --danger: #c93434;
  --danger-soft: #fff0f0;
  --teal: #087f7a;
  --shadow-sm: 0 1px 2px rgba(18, 24, 38, 0.06);
  --shadow-md: 0 18px 44px rgba(18, 24, 38, 0.10);
  --shadow-lg: 0 28px 70px rgba(18, 24, 38, 0.14);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 360px);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

body.embed-mode .topbar,
body.embed-mode .sidebar,
body.embed-mode .app-header,
html.embed-mode .topbar,
html.embed-mode .sidebar,
html.embed-mode .app-header {
  display: none;
}

body.embed-mode .app-shell,
body.embed-mode .app-main,
html.embed-mode .app-shell,
html.embed-mode .app-main {
  display: block;
  min-height: 100vh;
}

body.embed-mode .page,
html.embed-mode .page {
  padding-top: 22px;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 68px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  margin-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  font-weight: 900;
}

.brand-text {
  font-size: 18px;
  letter-spacing: 0;
}

.brand-help-link {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #77839a;
}

.brand-help-link svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: none;
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 140ms ease;
}

.sidebar-nav {
  display: grid;
  gap: 22px;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.sidebar-section {
  display: grid;
  gap: 6px;
}

.sidebar-section h2 {
  margin: 0 0 3px;
  padding: 0 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.sidebar-link.is-active {
  color: var(--text);
  border-color: #cfd8f4;
  background: #e9eefb;
  font-weight: 700;
}

.sidebar-link.is-disabled {
  color: var(--faint);
  cursor: not-allowed;
  opacity: 0.72;
}

.sidebar-link.is-disabled:hover {
  background: transparent;
}

.sidebar-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.sidebar-subgroup {
  display: grid;
  gap: 5px;
}

.sidebar-subgroup > summary {
  list-style: none;
  cursor: pointer;
}

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

.sidebar-subgroup-summary {
  color: var(--muted);
}

.sidebar-subgroup-arrow {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--faint);
  transition: transform 0.16s ease;
}

.sidebar-subgroup-arrow svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-subgroup[open] .sidebar-subgroup-arrow {
  transform: rotate(90deg);
}

.sidebar-subgroup-list {
  display: grid;
  gap: 4px;
  padding-left: 12px;
}

.sidebar-subgroup-list .sidebar-link {
  min-height: 34px;
  padding-block: 6px;
}

.sidebar-subgroup-list .sidebar-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}

.sidebar-subgroup-list .sidebar-icon svg {
  width: 14px;
  height: 14px;
}

.sidebar-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-link.is-disabled .sidebar-icon {
  background: var(--surface-soft);
  color: var(--faint);
}

.sidebar-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-main {
  min-width: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.sidebar-collapsed .app-shell {
  grid-template-columns: 72px minmax(0, 1fr);
}

.jotem-page .page-head {
  margin-bottom: 14px;
}

.jotem-composer {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.jotem-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.jotem-input-row textarea {
  min-height: 0;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 18px;
  line-height: 1.4;
  resize: none;
  overflow-y: hidden;
}

.jotem-create-btn {
  min-width: 136px;
  min-height: 48px;
}

.jotem-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.jotem-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #cfd8f4;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.jotem-tag-pill.is-selected {
  border-color: #2b5cab;
  background: #e9eefb;
  color: #1f4f8f;
  font-weight: 700;
}

.jotem-tag-pill.is-default {
  border-color: #b9cbe8;
}

.jotem-tag-delete {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #9aa4b2;
  font-size: 14px;
  line-height: 1;
}

.jotem-tag-delete:hover {
  color: #c93434;
}

.jotem-tag-add {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 1px dashed #b8c7df;
  border-radius: 999px;
  color: #5f6f89;
  background: #fff;
}

.jotem-tag-input {
  height: 34px;
  min-width: 72px;
  width: 72px;
  max-width: 260px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #cfd8f4;
  border-radius: 999px;
  font-size: 14px;
  line-height: 34px;
}

.jotem-waterfall {
  columns: 5 220px;
  column-gap: 12px;
}

.jotem-note {
  break-inside: avoid;
  min-height: 100px;
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 0 12px;
  padding: 16px;
  border-radius: 6px;
  overflow: hidden;
  border: none;
  background: transparent;
  box-shadow: 0 2px 10px rgba(18, 24, 38, 0.16);
}

.jotem-note::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: var(--note-paper);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 0;
}

.jotem-note::after {
  display: none;
}

.jotem-note > * {
  position: relative;
  z-index: 1;
}

.jotem-note-yellow {
  --note-paper: url("../img/sticky_note_1.png");
}

.jotem-note-blue {
  --note-paper: url("../img/sticky_note_2.png");
}

.jotem-note-green {
  --note-paper: url("../img/sticky_note_3.png");
}

.jotem-note-pink {
  --note-paper: url("../img/sticky_note_4.png");
}

.jotem-note-purple {
  --note-paper: url("../img/sticky_note_5.png");
}

.jotem-note-cream {
  --note-paper: url("../img/sticky_note_6.png");
}

.jotem-note-lined {
  --note-paper: url("../img/sticky_note_6.png");
}

.jotem-note-grid {
  --note-paper: url("../img/sticky_note_6.png");
}

.jotem-note-pin {
  position: absolute;
  top: 10px;
  right: 32px;
  width: 14px;
  height: 14px;
  line-height: 14px;
  font-size: 13px;
  color: #9aa4b2;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease;
}

.jotem-note-pin.is-pinned {
  opacity: 1;
  color: #2d58a3;
}

.jotem-note:hover .jotem-note-pin,
.jotem-note:focus-within .jotem-note-pin {
  opacity: 0.72;
}

.jotem-note-pin:hover,
.jotem-note-pin:focus-visible {
  opacity: 1;
}

.jotem-note-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  color: #9aa4b2;
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  user-select: none;
}

.jotem-note-delete:hover {
  color: #c93434;
}

.jotem-note-delete:focus-visible {
  outline: none;
}

.jotem-note-content {
  margin: 0 0 10px;
  padding-right: 18px;
  flex: 1 1 auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1a2234;
  font-size: 16px;
  line-height: 1.7;
}

.jotem-heading-line {
  font-size: 1.22em;
  line-height: 1.35;
  font-weight: 800;
}

.jotem-note-editor {
  width: 100%;
  min-height: 0;
  resize: none;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #1a2234;
  font-size: 16px;
  line-height: 1.7;
  padding: 0 18px 0 0;
  margin: 0;
  overflow: hidden;
}

.jotem-note-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  color: #5c6072;
  font-size: 12px;
}

.jotem-note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-left: auto;
}

.jotem-note-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(138, 128, 93, 0.34);
}

.jotem-note-tag-edit {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #7d86a0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease;
}

.jotem-note-tag-edit:hover {
  color: #2f5aa3;
  opacity: 1;
}

.jotem-note:hover .jotem-note-tag-edit,
.jotem-note:focus-within .jotem-note-tag-edit {
  opacity: 0.75;
}

.jotem-note-tags-manage-list {
  max-height: min(46vh, 360px);
  overflow: auto;
  display: grid;
  gap: 8px;
}

.jotem-note-tags-manage-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #d7deee;
  border-radius: 10px;
}

.jotem-pagination {
  margin-top: 8px;
}

.sidebar-collapsed .sidebar {
  padding: 18px 12px;
}

.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  margin-bottom: 22px;
}

.sidebar-collapsed .sidebar .brand {
  min-width: 0;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .brand-help-link,
.sidebar-collapsed .sidebar-section h2,
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-subgroup-arrow {
  display: none;
}

.sidebar-collapsed .sidebar-toggle {
  background: #ffffff;
}

.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar-collapsed .sidebar-footer {
  justify-content: center;
}

.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 8px;
}

.sidebar-collapsed .sidebar-unread-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  min-width: 8px;
  height: 8px;
  margin-left: 0;
  padding: 0;
  font-size: 0;
}

.sidebar-collapsed .sidebar-subgroup-list {
  padding-left: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav a {
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 11px;
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.task-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.task-modal-panel {
  position: relative;
  width: min(1400px, calc(100vw - 40px));
  height: calc(100vh - 40px);
  margin: 20px auto;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.28);
}

#task-modal-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.task-modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 2;
  min-height: 34px;
  width: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #d5dde8;
  background: #fff;
  color: #1f2937;
  box-shadow: var(--shadow-sm);
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav a.is-active {
  color: var(--text);
  background: #e9eefb;
  border: 1px solid #cfd8f4;
  font-weight: 700;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}

.account-menu[open] summary {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.10);
}

.account-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 4px;
  width: 160px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  z-index: 20;
}

.account-panel a,
.account-panel button {
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.account-panel a:hover,
.account-panel button:hover {
  background: var(--surface-soft);
}

.account-panel form {
  margin: 0;
}

.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 30px 32px 48px;
}

.wide { max-width: none; }

.board-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 68px);
  overflow: hidden;
  padding-bottom: 16px;
}

.board-page .page-head {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.toast-stack {
  position: fixed;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #c7d8ff;
  background: #eef4ff;
  color: #12367d;
  box-shadow: var(--shadow-md);
  animation: toastIn 180ms ease;
}

.toast.success {
  border-color: #b9e5cf;
  background: #edf9f2;
  color: #155d3b;
}

.toast.error {
  border-color: #f2c6cd;
  background: #fff2f4;
  color: #8f1d33;
}

.toast.warning {
  border-color: #f2dfb2;
  background: #fff8e9;
  color: #7a4c00;
}

.toast button {
  min-height: 24px;
  width: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-head, .week-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 4px;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: 0;
}
h2 {
  font-size: 15px;
  margin-bottom: 12px;
  letter-spacing: 0;
}
h3 {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.page-head p, .week-head p {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
}

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.danger-button {
  border-color: #f3b5b5;
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-button:hover {
  border-color: #e89191;
  background: #ffe6e6;
}

.button:hover, button:hover {
  border-color: #b8c2d3;
  background: var(--surface-soft);
}

.button:active, button:active { transform: translateY(1px); }

.primary, button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.button:disabled,
button:disabled,
.primary:disabled,
button.primary:disabled {
  border-color: #d8e0ec;
  background: #edf2f7;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
  transform: none;
}

.button:disabled:hover,
button:disabled:hover,
.primary:disabled:hover,
button.primary:disabled:hover {
  border-color: #d8e0ec;
  background: #edf2f7;
  color: #94a3b8;
}

.bug-button {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
  font-weight: 900;
}

.bug-button:hover {
  border-color: #fda4af;
  background: #ffe4e6;
}

.subtle {
  color: var(--muted);
  box-shadow: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metrics div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.metrics span {
  color: var(--muted);
  font-weight: 650;
}

.metrics strong {
  font-size: 24px;
  line-height: 1;
}

.board-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px 150px auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.board-page .filters {
  flex: 0 0 auto;
}

.board-view-panel {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.board-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.board-view-toggle a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 900;
}

.board-view-toggle a.is-active {
  background: var(--primary);
  color: #fff;
}

.board-content {
  flex: 1;
  min-height: 0;
  overflow-anchor: none;
}

.board-page .board-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

select {
  height: 46px;
  padding-right: 42px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 20px,
    calc(100% - 16px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  font-weight: 760;
  cursor: pointer;
}

select:hover {
  border-color: #b8c2d3;
  background-color: var(--surface-soft);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.10);
}

.native-select-enhanced {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 42px 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, #667085 50%) calc(100% - 22px) 20px / 6px 6px no-repeat,
    linear-gradient(135deg, #667085 50%, transparent 50%) calc(100% - 16px) 20px / 6px 6px no-repeat,
    var(--surface);
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.custom-select summary span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.custom-select.has-long-label summary span {
  font-size: 14px;
}

.custom-select.has-extra-long-label summary span {
  font-size: 12px;
}

.custom-select summary::-webkit-details-marker {
  display: none;
}

.custom-select[open] summary {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.10);
}

.custom-select.has-error summary {
  border-color: var(--danger);
  background:
    linear-gradient(45deg, transparent 50%, #b42318 50%) calc(100% - 22px) 20px / 6px 6px no-repeat,
    linear-gradient(135deg, #b42318 50%, transparent 50%) calc(100% - 16px) 20px / 6px 6px no-repeat,
    #fff7f7;
  box-shadow: 0 0 0 3px rgba(201, 52, 52, 0.10);
}

.custom-select-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: grid;
  gap: 10px;
  width: max(100%, 280px);
  max-width: calc(100vw - 32px);
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.custom-select-panel input[type="search"] {
  min-height: 42px;
  height: 42px;
}

.custom-select-options {
  display: grid;
  gap: 4px;
}

.custom-select-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.custom-select-option span:last-child {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.custom-select-option[hidden] {
  display: none;
}

.custom-select-option:hover,
.custom-select-option.is-selected {
  background: #eef5ff;
  color: var(--primary-dark);
}

.custom-select-check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.6px solid #98a2b3;
  border-radius: 4px;
  background: #fff;
}

.custom-select-option.is-selected .custom-select-check {
  border-color: var(--primary);
  background: var(--primary);
}

.custom-select-option.is-selected .custom-select-check::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

textarea { resize: vertical; }

.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: stretch;
  height: calc(100vh - 300px);
  min-height: 420px;
  overflow-x: auto;
  overflow-y: hidden;
  overflow-anchor: none;
  padding-bottom: 2px;
}

.board-table-view {
  display: grid;
  grid-auto-rows: max-content;
  gap: 14px;
  height: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  padding-bottom: 2px;
}

.board-table-product-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(18, 24, 38, 0.10);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: var(--shadow-sm);
}

.board-table-product-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 2px;
  background: #f8fafc;
}

.board-table-product-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
}

.board-table-product-head span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.board-table-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.board-table-group .board-table-scroll {
  border-radius: 0 0 8px 8px;
}

.board-table-group header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.board-table-group h2,
.board-table-group h3 {
  margin: 0;
  font-size: 14px;
}

.board-table-group header span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.board-table-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.board-table-group.is-over {
  border-color: rgba(31, 79, 143, 0.42);
  box-shadow: inset 0 0 0 2px rgba(31, 79, 143, 0.10), var(--shadow-sm);
}

.board-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.board-table th,
.board-table td {
  height: 36px;
  padding: 6px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfcfe;
  color: #667085;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.board-table th[data-table-sort-key] {
  cursor: pointer;
  user-select: none;
}

.board-table th[data-table-sort-key]::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 7px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #98a2b3;
  opacity: 0.65;
}

.board-table th[data-table-sort-key].is-sorted-asc::after {
  border-top: 0;
  border-bottom: 5px solid var(--primary);
  opacity: 1;
}

.board-table th[data-table-sort-key].is-sorted-desc::after {
  border-top-color: var(--primary);
  opacity: 1;
}

.board-table tr:last-child td {
  border-bottom: 0;
}

.board-table th:nth-child(1),
.board-table td:nth-child(1) { width: 280px; }
.board-table th:nth-child(2),
.board-table td:nth-child(2) { width: 132px; }
.board-table th:nth-child(3),
.board-table td:nth-child(3) { width: 150px; }
.board-table th:nth-child(4),
.board-table td:nth-child(4) { width: 120px; }
.board-table th:nth-child(5),
.board-table td:nth-child(5) { width: 86px; }
.board-table td:nth-child(5) {
  overflow: visible;
}
.board-table th:nth-child(6),
.board-table td:nth-child(6) { width: 96px; }
.board-table th:nth-child(7),
.board-table td:nth-child(7) { width: 130px; }
.board-table th:nth-child(8),
.board-table td:nth-child(8) { width: 180px; }
.board-table th:nth-child(9),
.board-table td:nth-child(9) { width: 210px; }
.board-table th:nth-child(10),
.board-table td:nth-child(10) { width: 76px; }
.board-table th:nth-child(11),
.board-table td:nth-child(11),
.board-table th:nth-child(12),
.board-table td:nth-child(12) { width: 160px; }

.board-table-title {
  color: var(--text);
  font-weight: 900;
}

.board-table-title a {
  color: inherit;
}

.board-table-title .status-pill {
  margin-left: 6px;
}

.board-table-row td:first-child {
  box-shadow: inset 5px 0 0 var(--table-row-color, transparent);
  padding-left: 16px;
}

.board-table-row.card-color-slate { --table-row-color: #64748b; }
.board-table-row.card-color-blue { --table-row-color: #3b82f6; }
.board-table-row.card-color-teal { --table-row-color: #14b8a6; }
.board-table-row.card-color-green { --table-row-color: #22a06b; }
.board-table-row.card-color-amber { --table-row-color: #f59e0b; }
.board-table-row.card-color-orange { --table-row-color: #f97316; }
.board-table-row.card-color-rose { --table-row-color: #f43f5e; }
.board-table-row.card-color-violet { --table-row-color: #8b5cf6; }

.table-progress {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) 38px;
  align-items: center;
  gap: 8px;
}

.table-progress span {
  position: relative;
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e9ff;
}

.table-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #5865f2;
}

.table-progress strong {
  color: var(--text);
  font-size: 12px;
}

.table-pill,
.table-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.table-priority-menu {
  position: relative;
  z-index: 5;
  width: max-content;
}

.table-priority-menu[open] {
  z-index: 120;
}

.table-priority-menu summary {
  cursor: pointer;
  list-style: none;
}

.table-priority-menu summary::-webkit-details-marker {
  display: none;
}

.table-priority-menu[open] summary {
  box-shadow: none;
}

.table-priority-menu > div {
  position: static;
  left: 0;
  display: grid;
  gap: 4px;
  min-width: 118px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.table-priority-menu button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 900;
  text-align: left;
}

.priority-option-check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.6px solid #98a2b3;
  border-radius: 4px;
  background: #fff;
}

.table-priority-menu button:hover,
.table-priority-menu button.is-selected {
  background: #eef5ff;
  color: var(--primary-dark);
}

.table-priority-menu button.is-selected .priority-option-check {
  border-color: var(--primary);
  background: var(--primary);
}

.table-priority-menu button.is-selected .priority-option-check::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.board-table-row:has(.table-priority-menu[open]) {
  position: relative;
  z-index: 40;
}

.board-table-row:has(.table-priority-menu[open]) td {
  overflow: visible;
}

.bugbye-filters.product-experience-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bugbye-filters.product-experience-filters input[type="search"] {
  flex: 1 1 520px;
  min-width: 280px;
}

.bugbye-filters.product-experience-filters .custom-select {
  flex: 0 0 142px;
}

.bugbye-filters.product-experience-filters select:not(.native-select-enhanced) {
  flex: 0 0 142px;
}

.bugbye-filters.product-experience-filters select.native-select-enhanced {
  flex: 0 0 0 !important;
}

.bugbye-filters.product-experience-filters .custom-select-panel {
  width: max(100%, 240px);
  max-width: calc(100vw - 32px);
}

.bugbye-filters.product-experience-filters .custom-select-panel input[type="search"] {
  min-width: 0;
}

.bugbye-filters.product-experience-filters .custom-select-option {
  grid-template-columns: 18px minmax(0, 1fr);
  min-width: 0;
}

.bugbye-filters.product-experience-filters .custom-select-option span:last-child {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bugbye-filters.product-experience-filters [data-experience-reset] {
  flex: 0 0 92px;
  justify-content: center;
}

.product-experience-section header {
  align-items: center;
}

.product-experience-version-label {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.product-experience-groups,
.product-experience-section,
.product-experience-section .bugbye-table-scroll {
  min-width: 0;
  max-width: 100%;
}

.product-experience-section {
  overflow: hidden;
}

.product-experience-section .bugbye-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
}

.product-experience-table {
  min-width: 1580px;
  table-layout: fixed;
}

.product-experience-table th,
.product-experience-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.product-experience-table tbody tr {
  height: 64px;
}

.product-experience-table td {
  height: 1px;
}

.product-experience-cell-center {
  display: flex;
  align-items: center;
  min-height: 100%;
}

.product-experience-table .pe-center-col {
  position: relative;
}

.product-experience-table .pe-center-col > .product-experience-cell-center {
  position: absolute;
  inset: 10px 10px;
  min-height: 0;
}

.product-experience-table .product-experience-summary {
  width: 420px;
  white-space: normal;
}

.product-experience-summary a,
.product-experience-text-summary span {
  overflow: hidden;
  color: var(--text);
  font-weight: 900;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-experience-summary a.rich-content,
.product-experience-text-summary span.rich-content {
  display: block;
}

.product-experience-summary .rich-content *,
.product-experience-text-summary .rich-content * {
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-experience-text-summary {
  width: 220px;
  white-space: normal;
}

.product-experience-text-summary span {
  color: var(--muted);
}

.product-experience-table .pe-time-col {
  width: 104px;
}

.product-experience-table .pe-main-col {
  width: 420px;
}

.product-experience-table .pe-text-col {
  width: 220px;
}

.product-experience-table .pe-attachment-col {
  width: 148px;
}

.product-experience-table th:not(.pe-main-col):not(.pe-text-col):not(.pe-attachment-col):not(.pe-time-col),
.product-experience-table td:not(.product-experience-summary):not(.product-experience-text-summary):not(.product-experience-attachments):not(.pe-time-col) {
  width: 116px;
}

.product-experience-table th[data-table-sort-key] {
  cursor: pointer;
  user-select: none;
}

.product-experience-table th[data-table-sort-key]::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #98a2b3;
  opacity: 0.65;
}

.product-experience-table th[data-table-sort-key].is-sorted-asc::after {
  border-top: 0;
  border-bottom: 5px solid var(--primary);
  opacity: 1;
}

.product-experience-table th[data-table-sort-key].is-sorted-desc::after {
  border-top-color: var(--primary);
  opacity: 1;
}

.pe-thumb-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pe-thumb-list img,
.pe-video-thumb,
.pe-file-thumb,
.pe-thumb-more {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  object-fit: cover;
}

.pe-thumb-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.pe-thumb-button:hover {
  transform: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.pe-video-thumb {
  background: #eef5ff;
  color: var(--primary);
}

.pe-thumb-more {
  background: #f3f6fb;
}

.experience-type-pill,
.experience-bool-pill,
.experience-acceptance-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.experience-type-optimization {
  background: #eef5ff;
  color: #225a9f;
}

.experience-type-bug {
  background: #fff0f0;
  color: #b42318;
}

.experience-type-praise {
  background: #eaf8f1;
  color: #13845f;
}

.experience-bool-pill.is-yes {
  background: #eaf8f1;
  color: #13845f;
}

.experience-bool-pill.is-no {
  background: #f3f6fb;
  color: #667085;
}

.experience-acceptance-pill.is-considering {
  background: #fff7e6;
  color: #b54708;
}

.experience-acceptance-pill.is-accepted {
  background: #eaf8f1;
  color: #13845f;
}

.experience-acceptance-pill.is-rejected {
  background: #f3f6fb;
  color: #667085;
}

.product-experience-table td form[data-experience-inline-select] {
  display: flex;
  align-items: center;
  margin: 0;
  max-width: 100%;
}

.product-experience-table td form[data-experience-inline-select] .custom-select,
.product-experience-table td form[data-experience-inline-select] select {
  width: 100%;
  min-width: 0;
  max-width: 118px;
}

.product-experience-table td form[data-experience-inline-select] .custom-select {
  position: relative;
  z-index: 3;
}

.product-experience-table td form[data-experience-inline-select] .custom-select summary {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 0 28px 0 12px;
  border-radius: 999px;
  border-color: #d7e1f3;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667085' d='M1 1h10L6 7z'/%3E%3C/svg%3E")
      calc(100% - 12px) calc(50% + 1px) / 12px 8px no-repeat,
    #f4f7fd;
  color: #244f93;
  font-size: 14px;
  font-weight: 900;
  box-shadow: none;
}

.product-experience-table td form[data-experience-inline-select] .custom-select summary span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-optimization summary {
  border-color: #dbe8ff;
  background-color: #ecf3ff;
  color: #2452a5;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-bug summary {
  border-color: #f6d5db;
  background-color: #fff2f4;
  color: #c1274c;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-praise summary {
  border-color: #c9ecd7;
  background-color: #e4f8ec;
  color: #137845;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-high summary {
  border-color: #f6d5db;
  background-color: #fff2f4;
  color: #c1274c;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-normal summary {
  border-color: #dbe8ff;
  background-color: #ecf3ff;
  color: #2452a5;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-low summary {
  border-color: #e4e7ec;
  background-color: #f3f6fb;
  color: #667085;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-considering summary {
  border-color: #f3dfcc;
  background-color: #fdf2e7;
  color: #8a4d21;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-accepted summary,
.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-true summary {
  border-color: #c9ecd7;
  background-color: #e4f8ec;
  color: #137845;
}

.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-rejected summary,
.product-experience-table td form[data-experience-inline-select] .custom-select.is-value-false summary {
  border-color: #e4e7ec;
  background-color: #f3f6fb;
  color: #667085;
}

.product-experience-table td form[data-experience-inline-select] .custom-select-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  max-width: none;
  margin-top: 0;
  z-index: 80;
}

.product-experience-table td form[data-experience-inline-select] .custom-select-panel .custom-select-options {
  gap: 6px;
}

.product-experience-table td form[data-experience-inline-select] .custom-select-option {
  min-height: 38px;
}

.product-experience-table td form[data-experience-inline-select] .custom-select-option .custom-select-check {
  border-radius: 999px;
}

.product-experience-table tr:has(.custom-select[open]) {
  position: relative;
  z-index: 12;
  background: #fbfdff;
}

.product-experience-table tr:has(.custom-select[open]) td {
  overflow: visible;
}

.product-experience-table .product-experience-inline-spacer td {
  height: 150px;
  padding: 0;
  background: #fbfdff;
}

.product-experience-form-panel,
.product-experience-detail {
  max-width: 1280px;
}

.product-experience-form .form-actions.is-right {
  justify-content: flex-end;
}

.product-experience-editor-shell .tiptap-editor,
.product-experience-detail .inline-description-editor .tiptap-editor {
  min-height: 220px;
}

.product-experience-detail .rich-content:empty::before {
  content: "点击补充内容。";
  color: var(--faint);
}

.product-experience-detail .detail-list dd {
  text-align: left;
}

.product-experience-detail .detail-list {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px 14px;
  margin: 18px 0 0;
}

.product-experience-detail .detail-list dt,
.product-experience-detail .detail-list dd {
  margin: 0;
}

.product-experience-detail .detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.product-experience-detail .detail-list dd {
  min-width: 0;
  color: var(--text);
  word-break: break-word;
}

.experience-preview-field {
  display: block;
}

.experience-preview-field.is-editing [data-experience-preview] {
  display: none;
}

.experience-preview-field.is-editing input,
.experience-preview-field.is-editing textarea {
  display: block;
}

.experience-preview-field [data-experience-preview] {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: text;
}

.experience-preview-field.is-multiline [data-experience-preview] {
  min-height: 86px;
  white-space: pre-wrap;
  color: var(--muted);
}

.table-muted,
.board-table-empty {
  color: var(--muted);
}

.board-table .is-bug-row td {
  background: #fffafa;
}

.board-table-row[draggable="true"] {
  cursor: grab;
}

.board-table-row.is-dragging td {
  opacity: 0.48;
}

.table-drag-image {
  position: fixed;
  left: -9999px;
  top: -9999px;
  z-index: 9999;
  display: grid;
  height: 38px;
  padding-left: 5px;
  border: 1px solid rgba(31, 79, 143, 0.22);
  border-left: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.20);
  color: var(--text);
  overflow: hidden;
  pointer-events: none;
}

.table-drag-image::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--drag-row-color, var(--primary));
}

.table-drag-cell {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-drag-cell:first-child {
  color: var(--text);
  font-weight: 900;
}

.board-table-row.drop-gap-before td {
  box-shadow: inset 0 2px 0 var(--primary);
}

.table-subtask-toggle {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin-right: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
}

.table-subtask-toggle.is-open {
  color: var(--primary);
  transform: rotate(90deg);
}

.board-subtask-row td {
  height: 34px;
  padding: 5px 10px;
  background: #fbfcfe;
  color: var(--muted);
}

.board-subtask-row td:first-child {
  position: relative;
  z-index: 1;
  border-right: 0;
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
}

.board-subtask-row .table-subtask-spacer {
  padding: 0;
  border-right: 0;
  overflow: visible;
}

.board-subtask-row[hidden] {
  display: none;
}

.table-subtask-title {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding-left: 44px !important;
}

.table-subtask-title label {
  display: inline-grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-weight: 850;
}

.table-subtask-title label span {
  overflow: visible;
  text-overflow: clip;
}

.table-subtask-title input {
  width: 15px;
  min-height: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
}

.table-subtask-number {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
}

.table-subtask-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff5f5;
  color: #b42318;
  font-size: 12px;
  font-weight: 900;
}

.table-subtask-state.is-done {
  background: #ecfdf3;
  color: #027a48;
}

.board-page .kanban {
  flex: 1;
  height: 100%;
  min-height: 0;
}

.kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(249, 250, 251, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  overflow: hidden;
}

.kanban-column.is-over {
  border-color: rgba(31, 79, 143, 0.42);
  background: #f4f8fc;
  box-shadow: inset 0 0 0 2px rgba(31, 79, 143, 0.10);
}

.column-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 2px 2px 4px;
}

.column-head h2 {
  margin: 0;
  font-size: 14px;
}

.column-head span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.cards {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
}

.task-card {
  position: relative;
  display: block;
  background: #fff !important;
  border: 1px solid var(--line);
  border-left: 6.8px solid var(--primary);
  border-radius: 8px;
  padding: 8px 9px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.task-card:visited,
.task-card:active,
.task-card:focus {
  background: #fff !important;
}

.task-card:hover {
  border-color: #c4cede;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.task-card.is-dragging {
  opacity: 0.54;
  transform: rotate(0deg) scale(0.99);
}

.task-card.is-readonly {
  cursor: default;
}

.card-open-tab {
  align-items: center;
  background: transparent;
  border: 0;
  color: #64748b;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 10px;
  transition: opacity 120ms ease, transform 120ms ease, color 120ms ease;
  transform: translateY(-2px);
  width: 18px;
  z-index: 2;
}

.card-open-tab svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-card:hover .card-open-tab,
.task-card:focus-within .card-open-tab {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.card-open-tab:hover {
  color: #1f3e76;
  outline: none;
}

.bug-status-pill {
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  font-weight: 800;
  padding: 3px 8px;
}

.bug-status-fixed .bug-status-pill {
  background: #dcfce7;
  color: #166534;
}

.bug-status-deferred .bug-status-pill {
  background: #ffedd5;
  color: #9a3412;
}

.bug-status-as_designed .bug-status-pill {
  background: #eef2ff;
  color: #3730a3;
}

.bug-status-pill.bug-status-fixed {
  background: #dcfce7;
  color: #166534;
}

.bug-status-pill.bug-status-deferred {
  background: #ffedd5;
  color: #9a3412;
}

.bug-status-pill.bug-status-as_designed {
  background: #eef2ff;
  color: #3730a3;
}

.bug-status-pill.bug-status-unfixed {
  background: #fff1f2;
  color: #be123c;
}

.bug-status-pill.bug-status-resolved {
  background: #e9f3ff;
  color: #1752b5;
}

.bugbye-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 68px);
}

.bugbye-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(8, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
}

.bugbye-filters input,
.bugbye-filters select {
  min-width: 0;
}

.bugbye-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.bugbye-stats article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.bugbye-stats article:hover {
  border-color: #b7c4df;
  box-shadow: 0 6px 16px rgba(25, 40, 72, 0.08);
}

.bugbye-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.bugbye-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.bugbye-groups {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.bugbye-version {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.bugbye-version > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.bugbye-version h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.bugbye-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.bugbye-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  z-index: 1;
}

.bugbye-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
}

.bugbye-table th,
.bugbye-table td {
  min-height: 44px;
  padding: 7px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.bugbye-table th {
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bugbye-table th[data-bugbye-sort-key] {
  cursor: pointer;
  user-select: none;
}

.bugbye-table th[data-bugbye-sort-key]::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 7px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #98a2b3;
  opacity: 0.65;
}

.bugbye-table th[data-bugbye-sort-key].is-sorted-asc::after {
  border-top: 0;
  border-bottom: 5px solid var(--primary);
  opacity: 1;
}

.bugbye-table th[data-bugbye-sort-key].is-sorted-desc::after {
  border-top-color: var(--primary);
  opacity: 1;
}

.bugbye-table td:first-child,
.bugbye-table th:first-child {
  width: 420px;
}

.bugbye-table td:first-child a:first-child {
  display: inline-block;
  color: var(--text);
  font-weight: 900;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.bugbye-row-action {
  margin-left: 8px;
  color: var(--primary);
  font-size: 12px;
  opacity: 0;
}

.bugbye-row:hover .bugbye-row-action {
  opacity: 1;
}

.bugbye-table td form[data-bug-status-inline] {
  margin: 0;
}

.bugbye-table td form[data-bug-status-inline] .custom-select,
.bugbye-table td form[data-bug-status-inline] select {
  width: auto;
  min-width: 108px;
}

.bugbye-table td form[data-bug-status-inline] .custom-select summary {
  min-height: 30px;
  padding: 0 28px 0 12px;
  border-radius: 999px;
  border-color: #d7e1f3;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667085' d='M1 1h10L6 7z'/%3E%3C/svg%3E")
      calc(100% - 12px) calc(50% + 1px) / 12px 8px no-repeat,
    #f4f7fd;
  background-color: #f4f7fd;
  color: #244f93;
  font-size: 14px;
  font-weight: 900;
  box-shadow: none;
}

.bugbye-table td form[data-bug-status-inline] .custom-select.is-value-unfixed summary {
  border-color: #f6d5db;
  background-color: #fff2f4;
  color: #c1274c;
}

.bugbye-table td form[data-bug-status-inline] .custom-select.is-value-resolved summary {
  border-color: #dbe8ff;
  background-color: #ecf3ff;
  color: #2452a5;
}

.bugbye-table td form[data-bug-status-inline] .custom-select.is-value-fixed summary {
  border-color: #c9ecd7;
  background-color: #e4f8ec;
  color: #137845;
}

.bugbye-table td form[data-bug-status-inline] .custom-select.is-value-as_designed summary {
  border-color: #ddd8fb;
  background-color: #eeecff;
  color: #4540aa;
}

.bugbye-table td form[data-bug-status-inline] .custom-select.is-value-deferred summary {
  border-color: #f3dfcc;
  background-color: #fdf2e7;
  color: #8a4d21;
}

form select[name="bug_status"] + .custom-select.is-value-unfixed summary {
  border-color: #f6d5db;
  background-color: #fff2f4;
  color: #c1274c;
}

form select[name="bug_status"] + .custom-select.is-value-resolved summary {
  border-color: #dbe8ff;
  background-color: #ecf3ff;
  color: #2452a5;
}

form select[name="bug_status"] + .custom-select.is-value-fixed summary {
  border-color: #c9ecd7;
  background-color: #e4f8ec;
  color: #137845;
}

form select[name="bug_status"] + .custom-select.is-value-as_designed summary {
  border-color: #ddd8fb;
  background-color: #eeecff;
  color: #4540aa;
}

form select[name="bug_status"] + .custom-select.is-value-deferred summary {
  border-color: #f3dfcc;
  background-color: #fdf2e7;
  color: #8a4d21;
}

.bugbye-table td form[data-bug-status-inline] .custom-select {
  position: relative;
  z-index: 3;
}

.bugbye-table td form[data-bug-status-inline] .custom-select-panel {
  position: static;
  width: 220px;
  max-width: none;
  margin-top: 8px;
  z-index: 80;
}

.bugbye-table td form[data-bug-status-inline] .custom-select-panel .custom-select-options {
  gap: 6px;
}

.bugbye-table td form[data-bug-status-inline] .custom-select-option {
  min-height: 38px;
}

.bugbye-table td form[data-bug-status-inline] .custom-select-option .custom-select-check {
  border-radius: 999px;
}

.bugbye-row:has(.custom-select[open]) {
  position: relative;
  z-index: 12;
  background: #fbfdff;
}

.bugbye-row:has(.custom-select[open]) td {
  overflow: visible;
  vertical-align: top;
}

.version-picker {
  position: relative;
}

.version-picker #id_version {
  padding-right: 12px;
}

.version-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(20, 36, 68, 0.14);
  padding: 8px;
  max-height: 240px;
  overflow: auto;
}

.version-picker-menu[hidden] {
  display: none !important;
}

.version-picker-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
}

.version-picker-options {
  display: grid;
  gap: 8px;
}

.version-picker-option {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.version-picker-option:hover {
  background: #f2f6ff;
  border-color: #a8c3ff;
}

.severity-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.severity-s1 {
  background: #fff1f2;
  color: #be123c;
}

.severity-s2 {
  background: #ffedd5;
  color: #c2410c;
}

.severity-s3 {
  background: #eef4ff;
  color: #1f4f8f;
}

.severity-s4 {
  background: #f1f5f9;
  color: #475467;
}

.priority-low {
  background: #eef4fb;
  color: #1f4f8f;
}

.priority-normal {
  background: #eef4ff;
  color: #1d4ed8;
}

.priority-high {
  background: #fff7ed;
  color: #c2410c;
}

.priority-urgent {
  background: #fff1f2;
  color: #be123c;
}

.task-card.drop-gap-before {
  margin-top: 10px;
}

.card-title {
  font-size: 16px;
  font-weight: 760;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.4;
}

.card-project {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.card-desc {
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-delay-pill {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 1px 6px;
  border-width: 1px;
  font-size: 10px;
  line-height: 1.35;
}

.task-card:has(.card-delay-pill) .card-title {
  padding-right: 34px;
}

.card-delay-pill-inline {
  position: static;
  padding: 1px 6px;
  border-width: 1px;
  font-size: 10px;
  line-height: 1.35;
}

.task-card.priority-high,
.task-card.priority-urgent { border-left-color: var(--danger); }
.task-card.priority-low { border-left-color: var(--ok); }
.is-overdue { box-shadow: inset 0 0 0 1px rgba(201, 52, 52, 0.24), var(--shadow-sm); }

.card-priority-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.card-info-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #d5deec;
  background: #f7faff;
  color: #5c6b84;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.card-members-pill {
  max-width: 52%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-date-pill {
  white-space: nowrap;
}

.card-progress-text {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: #63708a;
}

.card-priority-pill.priority-low {
  background: #eef4fb;
  color: #1f4f8f;
}

.card-priority-pill.priority-normal {
  background: #eef4ff;
  color: #1d4ed8;
}

.card-priority-pill.priority-high {
  background: #fff7ed;
  color: #c2410c;
}

.card-priority-pill.priority-urgent {
  background: #fff1f2;
  color: #be123c;
}

.task-card.card-color-slate { border-left-color: #64748b; }
.task-card.card-color-blue { border-left-color: #3b82f6; }
.task-card.card-color-teal { border-left-color: #14b8a6; }
.task-card.card-color-green { border-left-color: #22a06b; }
.task-card.card-color-amber { border-left-color: #f59e0b; }
.task-card.card-color-orange { border-left-color: #f97316; }
.task-card.card-color-rose { border-left-color: #f43f5e; }
.task-card.card-color-violet { border-left-color: #8b5cf6; }

.delivery-card.card-color-slate { border-left-color: #64748b; }
.delivery-card.card-color-blue { border-left-color: #3b82f6; }
.delivery-card.card-color-teal { border-left-color: #14b8a6; }
.delivery-card.card-color-green { border-left-color: #22a06b; }
.delivery-card.card-color-amber { border-left-color: #f59e0b; }
.delivery-card.card-color-orange { border-left-color: #f97316; }
.delivery-card.card-color-rose { border-left-color: #f43f5e; }
.delivery-card.card-color-violet { border-left-color: #8b5cf6; }

.progress {
  height: 4px;
  background: #edf1f6;
  border-radius: 999px;
  overflow: hidden;
  margin: 5px 0;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--ok);
}

.progress.large { height: 9px; }

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

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.list-row div { display: grid; gap: 4px; }
.list-row span { color: var(--muted); font-size: 13px; }

.narrow, .auth-panel {
  max-width: 760px;
  margin: 30px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.auth-panel {
  max-width: 440px;
  margin-top: 72px;
  padding: 30px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 28px;
}

.auth-brand p {
  margin: 2px 0 0;
  color: var(--muted);
}

.feishu-login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #1f4f8f;
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.feishu-login-button:hover {
  background: var(--primary-dark);
}

.password-login-link {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.password-login-link:hover {
  color: var(--primary);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.form { display: grid; gap: 14px; }
.form p { display: grid; gap: 6px; margin: 0; }
.form p[hidden] { display: none; }
.form label { display: grid; gap: 6px; font-weight: 650; }
.form ul { margin: 4px 0 0; padding-left: 20px; }
.compact { gap: 10px; }
.actions { display: flex; gap: 10px; margin-top: 8px; }
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-actions.is-right {
  justify-content: flex-end;
}

.content-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.content-panel {
  padding: 18px;
}

.task-shell {
  display: grid;
  gap: 18px;
}

.task-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.task-hero h1 {
  max-width: 880px;
  margin-bottom: 12px;
  font-size: 36px;
}

.task-hero-main {
  flex: 1;
  min-width: 0;
}

[data-inline-title-display][data-editable="true"],
[data-inline-description-display][data-editable="true"],
[data-demand-description-display][data-editable="true"] {
  cursor: text;
}

[data-inline-title-display][data-editable="true"]:hover,
[data-inline-description-display][data-editable="true"]:hover,
[data-demand-description-display][data-editable="true"]:hover {
  outline: 1px dashed #bfd3f2;
  outline-offset: 4px;
}

[data-inline-description-display],
[data-demand-description-display] {
  min-height: 88px;
}

[data-inline-description-display]:empty::before,
[data-demand-description-display]:empty::before {
  content: "点击编辑描述";
  color: var(--faint);
}

.inline-edit-title-input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: auto;
  padding: 6px 8px;
  border: 1px solid #bfd3f2;
  border-radius: 8px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
}

.inline-edit-description-input {
  width: 100%;
  min-height: 160px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hero-meta > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #bfd3f2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #334155;
  font-size: 12px;
  line-height: 1;
}

.hero-meta .priority-pill,
.hero-meta .status-pill,
.hero-meta .hero-period-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  line-height: 1;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-actions .button,
.hero-actions button {
  border-color: #bfd3f2;
}

.range-field input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: auto;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--primary);
}

.range-field input[type="range"]:focus,
.range-field input[type="range"]:focus-visible {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.range-field input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: #dbe7f7;
}

.range-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
}

.range-field input[type="range"]::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: #dbe7f7;
}

.range-field input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
}

.range-field small {
  color: var(--muted);
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 18px;
}

.task-workspace,
.task-inspector {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

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

.task-summary .summary-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border: 1px solid var(--line);
  position: relative;
}

.task-summary strong {
  font-size: 16px;
}

.summary-edit-trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: 1px solid #c8d4ec;
  border-radius: 6px;
  background: #ffffff;
  color: #5d6b88;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.summary-card:hover .summary-edit-trigger,
.summary-card:focus-within .summary-edit-trigger {
  opacity: 1;
}

.summary-edit-trigger:hover {
  border-color: #95afd8;
  color: #244f93;
}

.summary-editor {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 48px));
  z-index: 40;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 8px;
}

.summary-editor[hidden] {
  display: none !important;
}

.summary-editor select {
  min-height: 42px;
}

.summary-editor.summary-editor-multi {
  width: min(360px, calc(100vw - 48px));
}

.summary-editor .filter-option-list {
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.summary-editor-actions {
  display: flex;
  justify-content: flex-end;
}

.summary-editor .button {
  min-height: 36px;
}

.hero-period-wrap {
  position: relative;
}

.hero-period-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #bfd3f2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #334155;
  font-size: 12px;
  cursor: pointer;
}

button.hero-period-pill {
  font: inherit;
}

.hero-period-pill [data-period-display] {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.hero-period-pill:hover {
  border-color: #9eb8e3;
  color: #244f93;
}

.hero-period-editor {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  min-width: 320px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 10px;
}

.hero-period-editor[hidden] {
  display: none !important;
}

.hero-period-editor label {
  display: grid;
  gap: 6px;
}

.hero-period-editor label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-period-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.panel-label {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.rich-copy,
.rich-content {
  margin: 0;
  color: #344054;
  font-size: 15px;
}

.rich-copy p,
.rich-copy ul,
.rich-copy ol,
.rich-copy blockquote,
.rich-copy pre,
.rich-copy h1,
.rich-copy h2,
.rich-copy h3,
.rich-copy h4,
.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content blockquote,
.rich-content pre,
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
  margin: 0 0 10px;
}

.rich-copy h1,
.rich-copy h2,
.rich-copy h3,
.rich-copy h4,
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.tiptap-editor h1,
.tiptap-editor h2,
.tiptap-editor h3,
.tiptap-editor h4 {
  color: var(--text);
  font-weight: 900;
  text-transform: none;
}

.rich-copy ul,
.rich-copy ol,
.rich-content ul,
.rich-content ol {
  padding-left: 22px;
}

.rich-copy blockquote,
.rich-content blockquote {
  padding: 8px 12px;
  border-left: 4px solid #b8c8e8;
  border-radius: 6px;
  background: #f6f8fc;
}

.rich-copy a,
.rich-content a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rich-copy pre,
.rich-content pre {
  padding: 12px 14px;
  border: 1px solid #d7e1ef;
  border-radius: 8px;
  background: #f5f8fc;
  color: #1f2a3d;
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
}

.rich-copy code,
.rich-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.92em;
}

.rich-copy pre code,
.rich-content pre code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.rich-copy mark,
.rich-content mark {
  border-radius: 3px;
  padding: 0 2px;
}

.mention-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e7f0ff;
  color: var(--primary);
  font-weight: 900;
  line-height: 1.35;
  white-space: nowrap;
}

.rich-copy figure,
.rich-content figure {
  margin: 10px 0;
}

.rich-copy table,
.rich-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rich-copy th,
.rich-copy td,
.rich-content th,
.rich-content td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.rich-copy th,
.rich-content th {
  background: #f6f8fc;
  font-weight: 900;
}

.rich-copy :last-child,
.rich-content :last-child {
  margin-bottom: 0;
}

.preline { white-space: pre-line; }

.ckeditor-shell {
  --ck-border-radius: 8px;
  --ck-color-base-border: var(--line-strong);
  --ck-color-focus-border: var(--primary);
  --ck-color-toolbar-background: #f8fafc;
  --ck-color-button-on-background: #eef4ff;
  --ck-color-button-on-color: var(--primary);
}

.ckeditor-shell .ck.ck-editor {
  width: 100%;
}

.ckeditor-shell .ck.ck-editor__main > .ck-editor__editable {
  min-height: 170px;
  padding: 12px 14px;
  color: var(--text);
  line-height: 1.65;
}

.ckeditor-shell .ck.ck-toolbar {
  border-color: var(--line-strong);
}

.ckeditor-shell .ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.13);
}

.tiptap-shell {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.tiptap-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-strong);
  background: #fff;
}

.tiptap-toolbar .tiptap-separator {
  width: 1px;
  height: 30px;
  margin: 0 16px;
  background: #dfe3ea;
}

.tiptap-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: #9ca3ad;
  font-family: inherit;
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tiptap-toolbar button[data-tiptap-action="heading"],
.tiptap-toolbar button[data-tiptap-action="listMenu"] {
  width: 44px;
  min-width: 44px;
}

.tiptap-toolbar .tiptap-wide-button {
  gap: 2px;
}

.tiptap-toolbar .tiptap-text-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  background: transparent;
  color: currentColor;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
}

.tiptap-toolbar .tiptap-italic-icon {
  font-style: italic;
  font-weight: 400;
  transform: translateY(1px);
}

.tiptap-toolbar .tiptap-strike-icon {
  position: relative;
  font-weight: 400;
}

.tiptap-toolbar .tiptap-strike-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: 2px;
  background: currentColor;
}

.tiptap-toolbar .tiptap-underline-icon {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  font-weight: 400;
}

.tiptap-toolbar .tiptap-color-icon {
  font-weight: 400;
  transform: translateY(1px);
}

.tiptap-toolbar button[data-tiptap-action="highlightMenu"] svg {
  width: 21px;
  height: 21px;
  transform: translateY(1px);
}

.tiptap-toolbar svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.tiptap-toolbar .tiptap-chevron {
  width: 12px;
  height: 12px;
}

.tiptap-toolbar button:hover,
.tiptap-toolbar button.is-active {
  border-color: transparent;
  color: var(--primary);
}

.tiptap-toolbar button:hover {
  background: #f7f8fa;
}

.tiptap-toolbar button.is-active {
  background: #f2f0ff;
  color: #6c35ff;
}

.tiptap-toolbar button[data-tiptap-action="italic"].is-active,
.tiptap-toolbar button[data-tiptap-action="strike"].is-active,
.tiptap-toolbar button[data-tiptap-action="underline"].is-active,
.tiptap-toolbar button[data-tiptap-action="colorMenu"].is-active,
.tiptap-toolbar button[data-tiptap-action="highlightMenu"].is-active {
  background: transparent;
  color: #5f6670;
}

.tiptap-toolbar button:disabled {
  opacity: 1;
}

.tiptap-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tiptap-floating-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  display: grid;
  min-width: 170px;
  padding: 10px;
  border: 1px solid #edf1f6;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.13);
  backdrop-filter: blur(18px);
  transform-origin: top left;
  animation: tiptap-menu-in 0.14s ease-out;
}

.tiptap-floating-menu[hidden] {
  display: none;
}

.tiptap-floating-menu button {
  width: auto;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  border-radius: 9px;
  color: #59616c;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
}

.tiptap-floating-menu button:hover {
  background: #f6f7fa;
  color: #313844;
}

.tiptap-heading-menu button span,
.tiptap-list-menu button > span {
  width: auto;
  height: auto;
  margin: 0;
  background: transparent;
  color: #646b75;
  font-size: 16px;
}

.tiptap-heading-menu button span {
  min-width: 28px;
  font-weight: 500;
}

.tiptap-heading-menu {
  min-width: 190px;
}

.tiptap-heading-menu button {
  font-size: 17px;
}

.tiptap-list-menu {
  min-width: 190px;
  padding: 12px;
}

.tiptap-list-menu button {
  height: 38px;
  min-height: 38px;
  font-size: 17px;
}

.tiptap-list-menu button > svg {
  width: 22px;
  height: 22px;
  min-width: 22px;
  color: #646b75;
}

.tiptap-color-menu {
  left: auto;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 18px;
}

.tiptap-color-menu button {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 2px solid color-mix(in srgb, var(--swatch, #fff) 70%, #7c8796);
  border-radius: 999px;
  background: var(--swatch, #fff);
}

.tiptap-color-menu button:hover {
  background: var(--swatch, #fff);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.tiptap-color-menu .tiptap-menu-divider {
  width: 1px;
  height: 26px;
  margin: 0 2px;
  background: #e3e7ee;
}

.tiptap-color-menu .tiptap-clear-highlight {
  position: relative;
  border-color: #8a929d;
  background: #fff;
}

.tiptap-color-menu .tiptap-clear-highlight::before,
.tiptap-color-menu .tiptap-clear-highlight::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: #636b76;
  transform: rotate(45deg);
}

.tiptap-color-menu .tiptap-clear-highlight::after {
  transform: rotate(-45deg);
}

.tiptap-link-menu {
  left: auto;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 360px;
  padding: 12px 14px;
  border-radius: 18px;
}

.tiptap-link-menu input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 2px solid #e3e8f0;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: #303742;
  font: inherit;
  font-size: 16px;
}

.tiptap-link-menu input:focus {
  border-color: #d7dee9;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.04);
}

.tiptap-link-menu input::placeholder {
  color: #9aa2ad;
}

.tiptap-link-button-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tiptap-link-menu .tiptap-menu-divider {
  width: 1px;
  height: 30px;
  margin: 0 2px;
  background: #e3e7ee;
}

.tiptap-link-menu button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  justify-content: center;
  padding: 0;
  color: #7c8490;
  font-size: 18px;
  line-height: 1;
}

.tiptap-link-menu svg {
  display: block;
  width: 19px;
  height: 19px;
}

@keyframes tiptap-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tiptap-editor {
  min-height: 280px;
  color: var(--text);
  line-height: 1.65;
  outline: none;
  cursor: text;
}

.tiptap-editor:focus-within,
.tiptap-editor.ProseMirror-focused,
.tiptap-editor.is-fallback:focus {
  box-shadow: none;
}

.tiptap-editor .ProseMirror {
  min-height: 280px;
  padding: 14px 16px;
  outline: none;
}

.tiptap-editor.is-fallback {
  padding: 14px 16px;
}

.tiptap-editor p {
  margin: 0 0 0.72em;
}

.tiptap-editor h2,
.tiptap-editor h3,
.tiptap-editor h4 {
  margin: 0.35em 0 0.55em;
}

.tiptap-editor h1 {
  margin: 0.35em 0 0.55em;
  font-size: 1.45rem;
}

.tiptap-editor h2 {
  font-size: 1.28rem;
}

.tiptap-editor h3 {
  font-size: 1.12rem;
}

.tiptap-editor h4 {
  font-size: 1rem;
}

.tiptap-editor ul,
.tiptap-editor ol {
  padding-left: 1.4rem;
  margin: 0 0 0.75em;
}

.tiptap-editor ul[data-type="taskList"] {
  padding-left: 0;
  list-style: none;
}

.tiptap-editor li[data-type="taskItem"] {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

.tiptap-editor li[data-type="taskItem"] > label {
  flex: 0 0 auto;
  margin-top: 0.24rem;
}

.tiptap-editor li[data-type="taskItem"] > div {
  flex: 1;
}

.tiptap-editor blockquote {
  margin: 0 0 0.75em;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
  color: var(--muted);
}

.tiptap-editor a {
  color: var(--primary);
  text-decoration: underline;
}

.tiptap-editor code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.92em;
}

.tiptap-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.9em;
}

.tiptap-editor th,
.tiptap-editor td {
  border: 1px solid var(--line-strong);
  padding: 8px 10px;
  vertical-align: top;
}

.tiptap-editor th {
  background: #f6f8fc;
  font-weight: 900;
}

.tiptap-editor mark {
  border-radius: 3px;
  padding: 0 2px;
}

.tiptap-mention-menu {
  position: fixed;
  z-index: 120;
  display: grid;
  gap: 4px;
  min-width: 180px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.tiptap-mention-menu[hidden] {
  display: none;
}

.tiptap-mention-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.tiptap-mention-option:hover,
.tiptap-mention-option.is-active {
  background: #eaf2ff;
  color: var(--primary);
}

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

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.delivery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.delivery-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 8.5px solid var(--primary);
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
}

.delivery-card strong {
  font-size: 14px;
  line-height: 1.4;
}

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

.delivery-editor {
  margin-top: 10px;
}

.selected-deliveries {
  margin-top: 0;
}

.selected-delivery-card {
  position: relative;
  padding-right: 72px;
}

.selected-delivery-card > a {
  display: grid;
  gap: 4px;
  color: inherit;
}

.delivery-remove {
  position: absolute;
  right: 10px;
  top: 50%;
  min-height: 30px;
  padding: 0 10px;
  border-color: #f3b5b5;
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
  font-size: 12px;
  opacity: 0;
  transform: translateY(-50%) translateX(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.selected-delivery-card:hover .delivery-remove,
.selected-delivery-card:focus-within .delivery-remove {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.delivery-picker-modal[hidden] {
  display: none;
}

.delivery-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}

.delivery-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.delivery-picker-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(720px, calc(100vw - 36px));
  max-height: min(640px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.delivery-picker-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.delivery-picker-panel h3 {
  margin: 2px 0 0;
  font-size: 20px;
}

.delivery-selectable {
  text-align: left;
  cursor: pointer;
  position: relative;
}

.delivery-selectable.is-selected {
  background: #f4fbf7;
  outline: 2px solid #22a06b;
  outline-offset: -2px;
}

.delivery-check {
  position: absolute;
  right: 10px;
  top: 10px;
  color: #22a06b;
  font-size: 20px;
  line-height: 1;
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 120ms ease, transform 120ms ease;
}

.delivery-selectable.is-selected .delivery-check {
  opacity: 1;
  transform: scale(1);
}

.delivery-checkboxes {
  display: none;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatches.compact {
  margin-top: 10px;
}

.color-swatch {
  width: 24px;
  min-height: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid #d7deea;
  box-shadow: none;
}

.color-swatch.is-active {
  border-color: #111827;
  transform: scale(1.06);
}

.color-swatch.color-slate { background: #64748b; }
.color-swatch.color-blue { background: #3b82f6; }
.color-swatch.color-teal { background: #14b8a6; }
.color-swatch.color-green { background: #22a06b; }
.color-swatch.color-amber { background: #f59e0b; }
.color-swatch.color-orange { background: #f97316; }
.color-swatch.color-rose { background: #f43f5e; }
.color-swatch.color-violet { background: #8b5cf6; }

.sr-only-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.subtasks { display: grid; gap: 8px; margin: 12px 0; }

.subtask-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.subtask {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.subtask [data-subtask-title] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.check {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 5px;
  box-shadow: none;
}

.check.checked { background: var(--ok); border-color: var(--ok); }
.done { color: var(--muted); text-decoration: line-through; }

.subtask-inline-editor {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  resize: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font: inherit;
  line-height: 1.45;
  color: inherit;
  background: #fff;
}

.icon-danger {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-color: transparent;
  box-shadow: none;
  color: var(--danger);
  background: transparent;
  font-size: 20px;
  line-height: 1;
}

.icon-danger:hover {
  border-color: #f3b5b5;
  background: var(--danger-soft);
}

.add-subtask-form {
  margin-top: 12px;
}

.subtask-actions {
  display: block;
  margin-top: 12px;
}

.subtask-actions .add-subtask-form {
  margin-top: 0;
}

.add-subtask-form textarea[name="title"] {
  width: 100%;
  min-height: 42px;
  resize: vertical;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.subtask-template-menu {
  position: relative;
  flex: 0 0 auto;
}

.subtask-template-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  box-shadow: var(--shadow-sm);
}

.subtask-template-menu summary::-webkit-details-marker {
  display: none;
}

.subtask-template-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  display: grid;
  gap: 6px;
  width: 150px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.subtask-template-menu button {
  width: 100%;
  justify-content: flex-start;
  min-height: 36px;
  padding: 0 10px;
  box-shadow: none;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.media-upload-form {
  display: block;
}

.media-file-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.media-file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.media-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  background: #eef4ff;
  color: var(--primary);
  font-weight: 800;
}

.media-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-upload-form button[type="submit"] {
  min-width: 104px;
}

.media-upload-form .errorlist {
  grid-column: 1 / -1;
  margin: 0;
}

.attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.attachment {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-soft);
}

.attachment-preview {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0f172a;
  box-shadow: none;
  cursor: zoom-in;
}

.attachment-preview:hover img,
.attachment-preview:hover video,
.attachment-preview:focus-visible img,
.attachment-preview:focus-visible video {
  opacity: 0.86;
}

.attachment-preview img,
.attachment-preview video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transition: opacity 140ms ease;
}

.attachment-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.attachment-file-link {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--primary);
  font-weight: 900;
}

.attachment figcaption {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.attachment figcaption > span {
  min-width: 0;
}

.attachment[data-attachment-card] figcaption {
  justify-content: center;
  min-height: 38px;
  background: #fff;
}

.attachment[data-attachment-card] .attachment-label {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}

.attachment figcaption form {
  flex: 0 0 auto;
}

.attachment-delete {
  min-height: 28px;
  padding: 0 10px;
  border-color: #f3b5b5;
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
  font-size: 12px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.attachment:hover .attachment-delete,
.attachment:focus-within .attachment-delete {
  opacity: 1;
  transform: translateX(0);
}

.attachment[data-attachment-card] {
  position: relative;
}

.attachment[data-attachment-card] figcaption form {
  position: absolute;
  top: 6px;
  right: 6px;
  margin: 0;
}

.attachment[data-attachment-card] .attachment-delete-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--danger);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}

.attachment[data-attachment-card] .attachment-delete-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment[data-attachment-card] .attachment-delete-icon:hover,
.attachment[data-attachment-card] .attachment-delete-icon:focus-visible {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.36);
}

.media-lightbox[hidden] {
  display: none;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
}

.media-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.64);
}

.media-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.32);
}

.media-lightbox-close {
  opacity: 1;
  transform: none;
}

.media-lightbox-body {
  display: grid;
  min-height: min(58vh, 620px);
  place-items: center;
  background: #0f172a;
}

.media-lightbox-body img,
.media-lightbox-body video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 136px);
}

.media-lightbox-body img[hidden],
.media-lightbox-body video[hidden] {
  display: none;
}

.media-lightbox-caption {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  word-break: break-word;
}

.attachment-gallery-lightbox {
  padding: 16px;
}

.attachment-gallery-lightbox .media-lightbox-panel {
  width: min(1440px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
}

.attachment-gallery-lightbox .media-lightbox-body {
  min-height: calc(100vh - 104px);
  overflow: auto;
}

.attachment-gallery-lightbox .media-lightbox-body img,
.attachment-gallery-lightbox .media-lightbox-body video {
  max-width: 100%;
  max-height: calc(100vh - 136px);
  transform-origin: center center;
  transition: transform 140ms ease;
}

.attachment-gallery-lightbox.is-zoomed .media-lightbox-body {
  place-items: start center;
  padding: 28px;
}

.attachment-gallery-lightbox.is-fullscreen {
  padding: 0;
}

.attachment-gallery-lightbox.is-fullscreen .media-lightbox-panel {
  width: 100vw;
  max-height: 100vh;
  height: 100vh;
  border-radius: 0;
}

.attachment-gallery-lightbox.is-fullscreen .media-lightbox-body {
  min-height: calc(100vh - 44px);
}

.attachment-gallery-nav,
.attachment-gallery-fullscreen,
.attachment-gallery-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}

.attachment-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.attachment-gallery-nav.is-prev {
  left: 14px;
}

.attachment-gallery-nav.is-next {
  right: 14px;
}

.attachment-gallery-nav[hidden] {
  display: none;
}

.attachment-gallery-fullscreen {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.attachment-gallery-tools {
  position: absolute;
  right: 16px;
  bottom: 58px;
  z-index: 4;
  display: flex;
  gap: 8px;
}

.attachment-gallery-tools button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.attachment-gallery-nav svg,
.attachment-gallery-fullscreen svg,
.attachment-gallery-tools svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment-gallery-nav:hover,
.attachment-gallery-nav:focus-visible,
.attachment-gallery-fullscreen:hover,
.attachment-gallery-fullscreen:focus-visible,
.attachment-gallery-tools button:hover,
.attachment-gallery-tools button:focus-visible {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.32);
  background: #fff;
}

.comments, .timeline { display: grid; gap: 10px; margin-bottom: 12px; }

.comment, .timeline > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.timeline strong {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.comment span, .timeline span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.comment p, .timeline p { margin: 8px 0 0; }

.meta-list {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px 12px;
}

.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; }

.week-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.week-picker {
  position: relative;
}

.week-shift-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.week-shift-button svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.week-shift-button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.week-picker > summary {
  list-style: none;
}

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

.week-picker-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.week-picker-week {
  color: var(--text);
  font-weight: 900;
}

.week-picker-caret {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.week-picker-caret path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.todo-shell {
  padding: 14px;
  height: calc(100dvh - 220px);
  min-height: 560px;
  overflow: hidden;
}

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

.todo-tab-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  align-self: flex-end;
}

.todo-tab-toggle a {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.todo-tab-toggle a svg {
  width: 18px;
  height: 18px;
}

.todo-tab-toggle a path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.todo-tab-toggle a.is-active {
  background: var(--primary);
  color: #fff;
}

.todo-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(420px, 40vw);
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  height: 100%;
  align-items: stretch;
}

.todo-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.todo-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.todo-column-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.todo-items {
  display: grid;
  gap: 10px;
  padding: 12px;
  min-height: 0;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}

.todo-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.todo-item.is-unread {
  border-color: #f2b8b5;
  background: #fff5f5;
  box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.08), var(--shadow-sm);
}

.todo-item.is-unread .todo-item-header strong::after {
  content: "新";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-width: 18px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.todo-item:hover {
  border-color: var(--line-strong);
}

.todo-item.is-dragging,
.todo-subitem.is-dragging {
  opacity: 0.6;
}

.todo-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.todo-item-header strong {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
}

.todo-source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--muted);
  border-radius: 50%;
  opacity: 0;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
}

.todo-source-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.todo-source-link:hover,
.todo-source-link:focus-visible {
  background: #eaf2ff;
  color: var(--primary);
}

.todo-item-header:hover .todo-source-link,
.todo-source-link:focus-visible {
  opacity: 1;
}

[data-edit-category-title],
[data-edit-item-title],
[data-edit-subitem-title] {
  cursor: text;
}

.todo-inline-edit-input {
  width: 100%;
  min-height: 36px;
}

.todo-toggle {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  border-radius: 999px;
  border: 1px solid #c7d7ed;
  background: var(--surface);
  cursor: pointer;
  box-shadow: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.todo-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: translate(-50%, -58%) rotate(45deg);
  transition: transform 120ms ease;
}

.todo-toggle.is-collapsed::before {
  transform: translate(-50%, -52%) rotate(-45deg);
}

.todo-subitems {
  display: grid;
  gap: 6px;
}

.todo-subitems[hidden] {
  display: none !important;
}

.todo-subitem {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 48px 8px 10px;
  border-color: var(--todo-subitem-border, var(--line));
  background: var(--todo-subitem-bg, var(--surface));
}

.todo-subitem.todo-subitem-color-white {
  --todo-subitem-bg: var(--surface);
  --todo-subitem-border: var(--line);
}

.todo-subitem.todo-subitem-color-blue {
  --todo-subitem-border: #bfdbfe;
  --todo-subitem-bg: #eff6ff;
}

.todo-subitem.todo-subitem-color-green {
  --todo-subitem-border: #bbf7d0;
  --todo-subitem-bg: #f0fdf4;
}

.todo-subitem.todo-subitem-color-yellow {
  --todo-subitem-border: #fde68a;
  --todo-subitem-bg: #fffbeb;
}

.todo-subitem.todo-subitem-color-pink {
  --todo-subitem-border: #fecdd3;
  --todo-subitem-bg: #fff1f2;
}

.todo-subitem span {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.todo-subitem input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  flex: 0 0 18px;
}

.todo-subitem.is-done span {
  text-decoration: line-through;
  color: var(--muted);
}

.todo-subitem-color-menu {
  position: absolute;
  right: 24px;
  top: 50%;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  transform: translateY(-50%);
  z-index: 2;
}

.todo-subitem-color-trigger {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  box-shadow: none;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  opacity: 0;
  padding: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
  transform: none;
  vertical-align: middle;
}

.todo-subitem:hover .todo-subitem-color-trigger,
.todo-subitem:focus-within .todo-subitem-color-trigger,
.todo-subitem.is-color-menu-open .todo-subitem-color-trigger {
  opacity: 1;
}

.todo-subitem-color-trigger:hover,
.todo-subitem-color-trigger:focus-visible,
.todo-subitem.is-color-menu-open .todo-subitem-color-trigger {
  background: #eff4ff;
  color: var(--primary);
}

.todo-subitem-color-trigger svg {
  display: block;
  width: 13px;
  height: 13px;
  transform: translate(-1px, -1px);
}

.todo-subitem-color-trigger path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.todo-subitem-color-trigger:active {
  transform: none;
}

.todo-subitem-color-panel {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  z-index: 30;
  display: flex;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateY(-50%);
}

.todo-subitem-color-panel[hidden] {
  display: none !important;
}

.todo-subitem-color-option {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
}

.todo-subitem-color-option.todo-subitem-color-white { background: #fff; }
.todo-subitem-color-option.todo-subitem-color-blue { background: #bfdbfe; }
.todo-subitem-color-option.todo-subitem-color-green { background: #bbf7d0; }
.todo-subitem-color-option.todo-subitem-color-yellow { background: #fde68a; }
.todo-subitem-color-option.todo-subitem-color-pink { background: #fecdd3; }

.todo-subitem-color-option.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 79, 143, 0.16);
}

.todo-inline-add {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.todo-inline-add .button[hidden],
.todo-inline-add input[hidden],
.todo-inline-add textarea[hidden] {
  display: none !important;
}

.todo-inline-add-item {
  padding: 0;
  margin-top: 2px;
}

.todo-inline-add-item .button {
  width: 100%;
  min-height: 44px;
  justify-self: stretch;
  justify-content: center;
  font-size: 16px;
}

.todo-inline-add-category {
  padding: 12px;
  margin-top: 2px;
}

.todo-inline-add-category .button {
  width: 100%;
  min-height: 44px;
  justify-self: stretch;
  justify-content: center;
  font-size: 16px;
}

.todo-inline-add-category .input {
  width: 100%;
}

.todo-subitems > .todo-inline-add {
  padding: 0;
  gap: 6px;
  justify-items: end;
}

.todo-subitems > .todo-inline-add .input {
  width: 100%;
}

.todo-column .todo-inline-add .button,
.todo-column-add .button {
  justify-self: start;
}

.todo-column-add .todo-inline-add-category .button {
  justify-self: stretch;
}

.todo-subitems > .todo-inline-add .button {
  justify-self: end;
}

.todo-column-add {
  min-height: 140px;
  height: auto;
  max-height: 100%;
}

.todo-delete-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: #9aa5bc;
  border-radius: 6px;
  box-shadow: none;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
}

.todo-column-menu {
  position: relative;
}

.todo-column-menu summary {
  list-style: none;
}

.todo-column-menu summary::-webkit-details-marker {
  display: none;
}

.todo-column-menu-trigger {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  border-radius: 8px;
  box-shadow: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.todo-column-menu-trigger svg {
  width: 18px;
  height: 18px;
}

.todo-column-menu-trigger circle {
  fill: currentColor;
}

.todo-column-menu-trigger:hover,
.todo-column-menu-trigger:focus-visible,
.todo-column-menu[open] .todo-column-menu-trigger {
  color: var(--primary);
  background: #eff4ff;
}

.todo-column-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 116px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.todo-column-menu-panel button {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.todo-column-menu-panel button:hover,
.todo-column-menu-panel button:focus-visible {
  background: #eff4ff;
  color: var(--primary);
}

.todo-delete-btn.subtle {
  position: absolute;
  right: 0;
  top: 50%;
  opacity: 0;
  color: #a1acc2;
  font-size: 18px;
  transform: translateY(-50%);
}

.todo-delete-btn.subtle:active {
  transform: translateY(-50%);
}

.todo-column-header:hover .todo-delete-btn,
.todo-item-header:hover .todo-delete-btn,
.todo-subitem:hover .todo-delete-btn,
.todo-delete-btn:focus-visible {
  opacity: 1;
}

.todo-delete-btn:hover,
.todo-delete-btn:focus-visible {
  background: #fff1f1;
  color: var(--danger);
}

.week-picker-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: 300px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.week-picker-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.week-picker-panel header strong {
  color: var(--text);
  font-size: 15px;
}

.week-picker-panel header button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
  cursor: pointer;
}

.week-picker-month-link {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
}

.week-picker-month-link svg {
  width: 18px;
  height: 18px;
}

.week-picker-month-link path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.week-picker-panel header button svg {
  width: 18px;
  height: 18px;
}

.week-picker-panel header button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.week-picker-list {
  display: grid;
  gap: 8px;
}

.week-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #fbfdff;
}

.week-picker-option span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
}

.week-current-label {
  font-style: normal;
  color: #0f8f7a;
  font-size: 12px;
  font-weight: 800;
}

.week-picker-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.week-picker-option.is-current {
  border-color: #bad4ff;
  background: #f4f8ff;
}

.week-picker-option.is-selected {
  border-color: var(--primary);
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px #bad4ff;
}

.week-view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  min-width: 0;
}

.view-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  max-width: 100%;
}

.view-tabs a {
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 700;
}

.view-tabs a.is-active {
  background: #e9eefb;
  color: var(--text);
}

.week-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}

.week-filter select {
  width: 220px;
  min-height: 42px;
  height: 42px;
  background-color: var(--surface);
}

.week-filter .week-status-filter {
  width: 150px;
  font-weight: 800;
}

.week-filter .custom-select {
  flex: 0 0 150px;
  width: 150px;
}

.week-filter .custom-select summary {
  min-height: 42px;
  height: 42px;
}

.week-filter .custom-select-panel {
  left: auto;
  right: 0;
  width: 180px;
  max-width: calc(100vw - 32px);
}

.filter-multiselect {
  position: relative;
  width: 240px;
  max-width: 100%;
}

.filter-multiselect summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 42px 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, #667085 50%) calc(100% - 22px) 20px / 6px 6px no-repeat,
    linear-gradient(135deg, #667085 50%, transparent 50%) calc(100% - 16px) 20px / 6px 6px no-repeat,
    var(--surface);
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.filter-multiselect summary::-webkit-details-marker {
  display: none;
}

.filter-multiselect-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  gap: 10px;
  width: 280px;
  max-width: calc(100vw - 32px);
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.filter-multiselect-panel input[type="search"] {
  min-height: 42px;
  height: 42px;
}

.filter-option-list {
  display: grid;
  gap: 4px;
}

.filter-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.filter-option[hidden] {
  display: none;
}

.filter-option:hover,
.filter-option.is-selected {
  background: #eef5ff;
  color: var(--primary-dark);
}

.filter-option input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--primary);
}

.week-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.person-lane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 420px;
  box-shadow: var(--shadow-sm);
}

.person-lane header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.person-lane h2 { margin: 0; font-size: 20px; }
.person-lane header span { color: var(--muted); }
.goals, .week-tasks { display: grid; gap: 10px; margin-bottom: 16px; }

.goal, .week-task {
  display: block;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.goal div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.goal span, .week-task span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.goal-progress {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.goal-progress .progress {
  margin: 0;
}

.status-done { border-left-color: var(--ok); }
.status-risk, .status-delayed { border-left-color: var(--danger); }
.status-doing, .status-review { border-left-color: var(--warn); }
.empty { color: var(--muted); margin: 0; }

.gantt-board {
  display: grid;
  gap: 14px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.people-gantt-board {
  overflow-x: hidden;
}

.gantt-product {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.gantt-product > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fcfdff;
}

.gantt-product h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #475569;
}

.gantt-product header span {
  color: var(--muted);
  font-size: 12px;
}

.goal-block {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

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

.goal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

summary.goal-head {
  cursor: pointer;
  list-style: none;
}

summary.goal-head::-webkit-details-marker {
  display: none;
}

.goal-priority-block {
  padding-top: 18px;
}

.goal-priority-block .goal-head {
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #dbe6f3;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.goal-head strong {
  font-size: 16px;
}

.goal-priority-block .goal-head strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}

.goal-head strong a {
  color: inherit;
}

.goal-title-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.goal-collapse-icon {
  position: relative;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid #c7d7ed;
  border-radius: 999px;
  background: #ffffff;
}

.goal-collapse-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: translate(-50%, -58%) rotate(45deg);
  transition: transform 120ms ease;
}

.goal-block:not([open]) .goal-collapse-icon::before {
  transform: translate(-50%, -52%) rotate(-45deg);
}

.compact-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.goal-create-task-button {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.goal-copy-button {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.goal-priority-block .goal-head:hover .goal-create-task-button,
.goal-priority-block .goal-head:focus-within .goal-create-task-button,
.goal-priority-block .goal-head:hover .goal-copy-button,
.goal-priority-block .goal-head:focus-within .goal-copy-button {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

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

.goal-copy-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.goal-copy-meta p {
  margin: 0;
}

.goal-copy-meta .goal-copy-title {
  color: var(--text);
  font-size: 16px;
}

.goal-copy-preview h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
}

.goal-copy-preview ul {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.goal-copy-preview li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.goal-copy-preview li:last-child {
  border-bottom: 0;
}

.goal-copy-preview li strong {
  color: var(--text);
  font-size: 14px;
}

.goal-copy-preview li span {
  color: var(--muted);
  white-space: nowrap;
}

.goal-copy-preview li.is-empty {
  color: var(--muted);
  justify-content: flex-start;
}

.goal-copy-modal .form-error {
  margin: 10px 0 0;
  color: #dc2626;
  font-weight: 700;
}

.goal-copy-modal.is-blocked [data-goal-copy-target-week] {
  color: #dc2626;
  font-weight: 700;
}

.gantt-week-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(420px, 2.4fr) 110px;
  align-items: center;
  gap: 10px;
}

.gantt-week-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.gantt-week-header span {
  text-align: center;
}

.gantt-task-list {
  display: grid;
  gap: 8px;
}

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

.chain-block {
  position: relative;
  overflow: hidden;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background: #fbfdff;
}

.chain-block.is-independent {
  background: #fff;
}

.chain-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5ebf3;
  background: #f5f8fc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chain-head strong {
  color: var(--text);
}

.chain-task-list {
  position: relative;
  gap: 0;
}

.chain-task-list::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 27px;
  bottom: 27px;
  width: 2px;
  transform: translateX(-1px);
  background: #b8c7dc;
}

.gantt-task-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(420px, 2.4fr) 110px;
  align-items: center;
  gap: 10px;
}

.people-task-board {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.people-task-week-row,
.people-task-list {
  min-width: 900px;
}

.people-task-week-row,
.people-task-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(420px, 2.1fr) 92px;
  align-items: center;
  gap: 10px;
}

.people-task-week-row {
  padding: 10px 14px 4px 218px;
  border-bottom: 1px solid var(--line);
  background: #fcfdff;
}

.people-task-list {
  display: grid;
}

.people-task-group {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf2f7;
}

.people-task-group:last-child {
  border-bottom: 0;
}

.people-task-person {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: start;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background: #f8fbff;
}

.people-task-person strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.people-task-person span:not(.product-icon) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.people-task-items {
  display: grid;
  gap: 6px;
}

.people-task-row {
  min-height: 42px;
}

.people-task-row .gantt-task-track {
  height: 26px;
}

.people-task-row .gantt-task-bar {
  top: 3px;
}

.people-task-row .gantt-task-meta strong {
  font-size: 13px;
}

.people-task-row .meta-tags {
  margin-top: 4px;
}

.chain-task-row {
  padding: 9px 12px;
  border-bottom: 1px solid #edf2f7;
}

.chain-task-row:last-child {
  border-bottom: 0;
}

.chain-task-meta {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  min-height: 52px;
}

.chain-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-self: start;
  width: 20px;
  height: 20px;
  margin-top: 8px;
  border-radius: 999px;
  background: #fbfdff;
  box-shadow: 0 0 0 5px #fbfdff;
}

.chain-node > span {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid #3b82f6;
  border-radius: 999px;
  background: #fbfdff;
  box-shadow: inset 0 0 0 4px #fbfdff;
}

.chain-task-row:not(.is-first) .chain-node > span {
  border-radius: 6px;
  transform: rotate(45deg);
}

.chain-task-row:not(.is-first) .chain-node > span::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin: 4px 0 0 4px;
  border-right: 2px solid #3b82f6;
  border-bottom: 2px solid #3b82f6;
}

.chain-block.is-independent .chain-task-list::before,
.chain-block.is-independent .chain-node {
  display: none;
}

.chain-block.is-independent .chain-task-meta {
  grid-template-columns: 1fr;
}

.chain-task-copy {
  min-width: 0;
}

.gantt-task-meta strong {
  display: block;
  font-size: 14px;
}

.gantt-task-title {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gantt-task-title > a:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-delivery-action {
  flex: 0 0 auto;
  opacity: 0;
  pointer-events: none;
  padding: 3px 8px;
  border: 1px solid #c7ddff;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  transition: opacity 120ms ease, transform 120ms ease;
  transform: translateX(-3px);
}

.gantt-task-row:hover .task-delivery-action,
.people-task-row:hover .task-delivery-action,
.task-delivery-action:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.gantt-task-meta strong a {
  color: inherit;
}

.gantt-task-meta span {
  color: var(--muted);
  font-size: 12px;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.gantt-task-meta .meta-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid #d8e1ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.gantt-task-meta .meta-tag.product-tag {
  border-color: #c7ddff;
  background: #eef5ff;
  color: #24599c;
}

.gantt-task-meta .meta-tag.muted {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: var(--muted);
}

.gantt-task-track {
  position: relative;
  height: 30px;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, #f8fafc 0, #f8fafc calc(14.285% - 1px), #e7edf5 calc(14.285% - 1px), #e7edf5 14.285%);
}

.gantt-task-track.has-days {
  height: 42px;
}

.gantt-track-days {
  position: absolute;
  inset: 3px 0 auto;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  color: #718096;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.gantt-track-days span {
  text-align: center;
}

.gantt-track-days .is-today {
  color: #1d4ed8;
  font-weight: 900;
}

.gantt-task-bar {
  position: absolute;
  top: 4px;
  height: 20px;
  min-width: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #5b7cff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.gantt-task-track.has-days .gantt-task-bar {
  top: 20px;
  height: 18px;
}

.gantt-task-bar.priority-low {
  background: #22a06b;
}

.gantt-task-bar.priority-normal {
  background: #3b82f6;
}

.gantt-task-bar.priority-high {
  background: #f59e0b;
}

.gantt-task-bar.priority-urgent {
  background: #ef4444;
}

.gantt-task-bar.card-color-slate {
  background: #64748b;
}

.gantt-task-bar.card-color-blue {
  background: #3b82f6;
}

.gantt-task-bar.card-color-teal {
  background: #14b8a6;
}

.gantt-task-bar.card-color-green {
  background: #22a06b;
}

.gantt-task-bar.card-color-amber {
  background: #f59e0b;
}

.gantt-task-bar.card-color-orange {
  background: #f97316;
}

.gantt-task-bar.card-color-rose {
  background: #f43f5e;
}

.gantt-task-bar.card-color-violet {
  background: #8b5cf6;
}

.gantt-task-bar .bar-progress {
  display: block;
  height: 100%;
  background: rgba(15, 23, 42, 0.22);
}

.gantt-task-bar .bar-percent {
  position: absolute;
  z-index: 1;
  left: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.gantt-task-status {
  display: flex;
  justify-content: flex-end;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.gantt-task-status .status-pill {
  justify-self: end;
  min-width: 54px;
  padding: 4px 9px;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  line-height: 1;
}

.status-pill.status-todo {
  border-color: #d8e1ee;
  background: #f8fafc;
  color: #64748b;
}

.status-pill.status-doing {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.status-pill.status-review {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.status-pill.status-done {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.status-pill.status-delayed {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.status-pill.status-archived {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #475569;
}

.compose-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.compose-hero {
  margin-bottom: 18px;
  padding: 26px 28px;
  border: 1px solid rgba(18, 24, 38, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: var(--shadow-md);
}

.compose-hero h1 {
  margin-bottom: 8px;
}

.compose-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.compose-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.compose-main {
  display: grid;
  gap: 14px;
}

.compose-side {
  position: sticky;
  top: 88px;
}

.form-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.span-two {
  grid-column: 1 / -1;
}

.form-field {
  position: relative;
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.form-field:first-of-type {
  margin-top: 0;
}

.form-grid-two > .form-field {
  margin-top: 0;
}

.form-field label {
  font-weight: 760;
}

.form-field.has-field-error input:not([type="hidden"]),
.form-field.has-field-error textarea {
  border-color: var(--danger);
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(201, 52, 52, 0.10);
}

.form-field.has-field-error .ck-editor__editable,
.ck-editor__editable.has-field-error,
.form-field.has-field-error .tiptap-editor,
.tiptap-editor.has-field-error {
  border-color: var(--danger) !important;
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(201, 52, 52, 0.10);
}

.participant-field > div[id^="id_"],
.participant-field #participants-container > div[id^="id_"],
.participant-field #bug-participants-container > div[id^="id_"],
.participant-field ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  list-style: none;
}

.participant-field > div[id^="id_"] > div,
.participant-field #participants-container > div[id^="id_"] > div,
.participant-field #bug-participants-container > div[id^="id_"] > div,
.participant-field li {
  min-width: 0;
  padding: 0;
}

.participant-field > div[id^="id_"] label,
.participant-field #participants-container > div[id^="id_"] label,
.participant-field #bug-participants-container > div[id^="id_"] label,
.participant-field li label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.participant-field > div[id^="id_"] label:hover,
.participant-field #participants-container > div[id^="id_"] label:hover,
.participant-field #bug-participants-container > div[id^="id_"] label:hover,
.participant-field li label:hover {
  border-color: var(--line-strong);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.participant-field > div[id^="id_"] label:has(input:checked),
.participant-field #participants-container > div[id^="id_"] label:has(input:checked),
.participant-field #bug-participants-container > div[id^="id_"] label:has(input:checked),
.participant-field li label:has(input:checked) {
  border-color: #bad4ff;
  background: #eef5ff;
  color: var(--primary-dark);
}

.participant-field input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: none;
  cursor: pointer;
}

.participant-field input[type="checkbox"]:checked {
  border-color: var(--primary);
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 9.2 7.7 12 13.4 6' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
}

.participant-field input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.10);
}

.attachment-dropzone {
  position: relative;
  display: grid;
  gap: 12px;
  border: 1.5px dashed #b8c8dc;
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
  padding: 18px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.attachment-dropzone:hover,
.attachment-dropzone:focus-visible,
.attachment-dropzone.is-dragover {
  border-color: var(--primary);
  background: #eef6ff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  outline: none;
}

.attachment-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.attachment-dropzone-body {
  display: grid;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

.attachment-dropzone-body strong {
  color: var(--text);
  font-size: 15px;
}

.attachment-dropzone-body small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attachment-file-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachment-file-list:empty {
  display: none;
}

.attachment-file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
}

.attachment-file-list small {
  flex: 0 0 auto;
}

.attachment-file-remove {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: #8c98ad;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.attachment-file-remove:hover {
  color: #c93434;
}

.attachment-upload-progress {
  position: relative;
  overflow: hidden;
  min-height: 24px;
  border: 1px solid #cfe0f5;
  border-radius: 999px;
  background: #eef4fb;
}

.attachment-upload-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 120ms ease;
}

.attachment-upload-progress strong {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 24px;
  place-items: center;
  color: var(--text);
  font-size: 12px;
}

.vertical-actions {
  display: grid;
  gap: 10px;
}

.compact-shell {
  max-width: 980px;
}

.narrow-step {
  max-width: 560px;
  margin: 0 auto;
}

.member-table {
  display: grid;
  padding: 0;
  overflow: hidden;
}

.goals-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
}

.goals-filter label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.goals-filter select {
  width: 240px;
  height: 42px;
  min-height: 42px;
  background-color: var(--surface);
}

.goals-filter .custom-select {
  flex: 0 0 240px;
  width: 240px;
}

.goals-filter .custom-select summary {
  min-height: 42px;
  height: 42px;
}

.weekly-goal-sections {
  display: grid;
  gap: 14px;
}

.goals-list-surface[aria-busy="true"] {
  opacity: 0.62;
}

.weekly-goal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.weekly-goal-section-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.weekly-goal-section-head > span {
  color: var(--muted);
  font-weight: 800;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 800;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 120px 110px 110px 120px 180px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.goal-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 150px 130px 100px 120px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.product-row {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 80px 100px 150px 120px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) 150px 180px 140px 190px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.member-row:last-child {
  border-bottom: 0;
}

.goal-row:last-child {
  border-bottom: 0;
}

.product-row:last-child {
  border-bottom: 0;
}

.archive-row:last-child {
  border-bottom: 0;
}

.member-head,
.goal-head,
.product-head {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.member-person {
  display: grid;
  gap: 3px;
}

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

.product-person,
.product-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-inline.compact {
  gap: 7px;
}

.product-person > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

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

.product-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 850;
}

.product-icon.small {
  width: 30px;
  height: 30px;
}

.product-icon.tiny {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
}

.product-icon.placeholder {
  font-size: 14px;
}

.product-form-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.product-icon-panel {
  display: grid;
  gap: 10px;
}

.product-icon-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
  overflow: hidden;
}

.product-icon-picker {
  cursor: pointer;
}

.product-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-icon-meta {
  display: grid;
  gap: 4px;
  width: 100%;
}

.product-icon-meta strong {
  font-size: 13px;
}

.product-icon-path {
  max-width: 220px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.product-icon-action {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.74);
  color: #fff;
}

.product-icon-action svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.product-icon-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
}

.product-icon-input-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.form-stack {
  display: grid;
  gap: 14px;
}

.form-stack .form-field {
  margin-top: 0;
}

.goal-progress-cell {
  display: grid;
  gap: 2px;
}

.goal-progress-cell span {
  color: var(--muted);
  font-size: 12px;
}

.role-pill,
.status-pill {
  justify-self: start;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 750;
  font-size: 12px;
}

.status-pill.is-hidden {
  display: none !important;
}

.status-pill {
  background: var(--ok-soft);
  color: var(--ok);
}

.muted-pill {
  background: var(--surface-soft);
  color: var(--muted);
}

.member-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.member-actions form {
  margin: 0;
}

.member-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.member-form {
  padding: 22px;
}

.switch-field {
  align-content: start;
}

.switch-field input[type="checkbox"],
.member-toggle-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  accent-color: var(--primary);
}

.member-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-toggle-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.member-toggle-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.member-toggle-option strong {
  line-height: 1.2;
}

.form-field small {
  color: var(--muted);
}

.version-head {
  margin-bottom: 12px;
}

.version-tabs-wrap {
  position: relative;
  margin-bottom: 16px;
  overflow: hidden;
}

.version-tabs-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(246, 248, 252, 0), var(--bg));
}

.version-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 54px 8px 0;
  scrollbar-width: thin;
}

.version-tab {
  flex: 0 0 auto;
  max-width: 240px;
  overflow: hidden;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-tab:hover,
.version-tab.is-active {
  border-color: #bad4ff;
  background: #eef5ff;
  color: var(--primary-dark);
}

.version-tab.is-empty {
  cursor: default;
}

.version-layout {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
}

.version-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  min-height: 0;
}

.version-column,
.version-compose {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.version-column {
  display: flex;
  min-height: 0;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.version-column > header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.version-column > header .button {
  min-height: 34px;
  padding: 0 12px;
}

.version-column-heading {
  min-width: 0;
}

.version-column h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 18px;
}

.version-column h2 span {
  flex: 0 0 auto;
}

.version-column h2 small {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef6ff;
  color: #245a9c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-timeline {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  gap: 0;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 18px;
}

.version-timeline::before {
  display: none;
}

.version-timeline.is-empty::before {
  display: none;
}

.version-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 16px;
}

.version-item::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 11px;
  top: 19px;
  bottom: -16px;
  width: 2px;
  background: #dce6f5;
}

.version-item:last-child {
  padding-bottom: 0;
}

.version-item:last-child::before {
  display: none;
}

.version-node {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12px;
}

.version-node span,
.version-full-node span {
  display: block;
  width: 14px;
  height: 14px;
  border: 3px solid #3b82f6;
  border-radius: 999px;
  background: #fff;
}

.version-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.version-card.is-compact {
  padding: 10px 12px;
}

.version-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.version-card.is-compact .version-card-head {
  margin-bottom: 0;
}

.version-card-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.version-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.version-card-title strong,
.version-card-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-card-head strong {
  font-size: 15px;
}

.version-card-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.version-title-line span,
.version-full-node em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--primary-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.version-meta {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.version-meta span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.version-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.version-card:hover .version-card-actions,
.version-card:focus-within .version-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.version-card-actions form {
  margin: 0;
}

.version-card-actions .button,
.version-card-actions button,
.version-card-actions .danger-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.version-full-node {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
}

.version-full-node span {
  width: 12px;
  height: 12px;
  border-color: #22a06b;
}

.version-full-node strong {
  font-size: 13px;
}

.version-form {
  display: grid;
  gap: 14px;
}

.version-form .actions {
  justify-content: flex-end;
}

.version-compose {
  position: sticky;
  top: 88px;
}

.readonly-field {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-weight: 850;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.version-modal[hidden] {
  display: none;
}

.version-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
}

.version-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.version-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.version-modal-panel.small-panel {
  width: min(420px, calc(100vw - 40px));
}

.version-modal-panel.version-record-panel {
  width: min(1080px, calc(100vw - 56px));
}

.version-modal-panel > header {
  padding-right: 38px;
}

.version-modal-panel h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.version-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.version-modal-close {
  opacity: 1;
  transform: none;
}

.version-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 68px);
  overflow: hidden;
  padding-bottom: 18px;
}

.version-page .page-head,
.version-tabs-wrap {
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .topbar, .page-head, .week-head, .list-row, .detail-title {
    align-items: stretch;
    flex-direction: column;
  }
  .topbar { gap: 14px; padding: 14px 18px; }
  .nav { flex-wrap: wrap; }
  .app-shell {
    display: block;
  }
  .sidebar {
    position: sticky;
    z-index: 30;
    height: auto;
    min-height: 0;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-brand {
    margin-bottom: 12px;
  }
  .sidebar-nav {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .sidebar-section {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .sidebar-section h2 {
    padding: 0;
    white-space: nowrap;
  }
  .sidebar-collapsed .app-shell {
    display: block;
  }
  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .sidebar-label,
  .sidebar-collapsed .sidebar-section h2 {
    display: inline;
  }
  .sidebar-collapsed .sidebar-toggle {
    position: static;
    width: 34px;
    min-height: 34px;
    border-radius: 8px;
  }
  .app-header {
    min-height: 58px;
    padding: 0 18px;
  }
  .filters, .task-layout, .kanban, .metrics, .compose-form, .form-grid-two, .task-summary, .member-toggle-group {
    grid-template-columns: 1fr;
  }
  .version-layout,
  .version-board {
    grid-template-columns: 1fr;
  }
  .version-page {
    height: auto;
    overflow: visible;
  }
  .version-layout,
  .version-board,
  .version-column {
    min-height: 0;
  }
  .version-timeline {
    max-height: none;
    overflow: visible;
  }
  .version-compose {
    position: static;
  }
  .week-view-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .week-filter {
    justify-content: flex-start;
  }
  .filter-multiselect {
    width: 100%;
  }
  .filter-multiselect-panel {
    left: 0;
    right: auto;
    width: 100%;
  }
  .week-filter select {
    width: 100%;
  }
  .week-filter .custom-select {
    flex: 1 1 100%;
    width: 100%;
  }
  .week-filter .custom-select-panel {
    left: 0;
    right: auto;
    width: 100%;
  }
  .gantt-task-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .chain-task-row {
    padding: 10px;
  }
  .gantt-week-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .people-task-board {
    min-width: 0;
  }
  .people-task-week-row {
    display: none;
  }
  .people-task-list {
    min-width: 0;
  }
  .people-task-group {
    grid-template-columns: 1fr;
  }
  .people-task-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .gantt-task-track {
    min-height: 30px;
  }
  .task-hero, .compose-hero {
    padding: 22px;
  }
  .hero-actions {
    justify-content: flex-start;
  }
  .compose-side {
    position: static;
  }
  .kanban-column { min-height: auto; }
  .member-row,
  .goal-row,
  .archive-row,
  .product-row,
  .product-form-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .goals-filter,
  .weekly-goal-section-head,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .goals-filter select {
    width: 100%;
  }
  .subtask-actions,
  .inline-form,
  .media-upload-form {
    grid-template-columns: 1fr;
  }
  .subtask-template-menu > div {
    left: 0;
    right: auto;
  }
  .member-head,
  .goal-head,
  .archive-head,
  .product-head {
    display: none;
  }
  .member-actions {
    justify-content: flex-start;
  }
.page { padding: 22px 18px 36px; }
}

.task-sidebar .content-panel + .content-panel {
  margin-top: 12px;
}

.task-sidebar .form.compact {
  gap: 12px;
}
.button.tiny {
  font-size: 12px;
  min-height: 28px;
  padding: 4px 10px;
}
.is-hidden {
  display: none !important;
}
.comment-replies {
  margin-top: 8px;
  padding-left: 14px;
}
.comment.reply {
  border-left: 2px solid #dce3ef;
  margin-top: 6px;
  padding-left: 10px;
}

.bug-status-toggle {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.bug-status-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bug-status-toggle-track {
  align-items: center;
  background: #e2e8f0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  height: 42px;
  padding: 4px;
  position: relative;
  width: 220px;
}

.bug-status-toggle-thumb {
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  display: block;
  height: 34px;
  position: relative;
  transform: translateX(0);
  transition: transform 0.18s ease;
  width: 106px;
  z-index: 1;
}

.bug-status-toggle input[type="checkbox"]:checked + .bug-status-toggle-track {
  background: #1f9d70;
}

.bug-status-toggle input[type="checkbox"]:checked + .bug-status-toggle-track .bug-status-toggle-thumb {
  transform: translateX(104px);
}

.bug-status-toggle-text {
  color: #475467;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  top: calc(50% + 1px);
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
  z-index: 3;
}

.toggle-text-left {
  left: 57px;
}

.toggle-text-right {
  left: 161px;
}

.bug-status-toggle input[type="checkbox"]:checked + .bug-status-toggle-track .toggle-text-left {
  color: rgba(255, 255, 255, 0.76);
}

.bug-status-toggle input[type="checkbox"]:checked + .bug-status-toggle-track .toggle-text-right {
  color: #1f2937;
}

.bug-status-toggle input[type="checkbox"]:not(:checked) + .bug-status-toggle-track .toggle-text-left {
  color: #1f2937;
}

.bug-status-toggle input[type="checkbox"]:not(:checked) + .bug-status-toggle-track .toggle-text-right {
  color: #64748b;
}

.demand-page .page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.demand-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demand-filters input[type="search"] {
  flex: 1 1 520px;
  min-width: 280px;
}

.demand-filters .custom-select {
  flex: 0 0 142px;
}

.demand-filters select:not(.native-select-enhanced) {
  flex: 0 0 142px;
}

.demand-filters select.native-select-enhanced {
  flex: 0 0 0 !important;
}

.demand-filters .custom-select-panel {
  width: max(100%, 240px);
  max-width: calc(100vw - 32px);
}

.demand-filters .custom-select-panel input[type="search"] {
  min-width: 0;
}

.demand-filters .custom-select-option {
  grid-template-columns: 18px minmax(0, 1fr);
  min-width: 0;
}

.demand-filters .custom-select-option span:last-child {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demand-filters [data-demand-reset] {
  flex: 0 0 92px;
  justify-content: center;
}

.demand-groups {
  display: grid;
  gap: 16px;
}

.demand-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.demand-status-new {
  color: #245c99;
  background: #e8f2ff;
  border: 1px solid #b9d8ff;
}

.demand-status-accepted {
  color: #087f5b;
  background: #e6fcf5;
  border: 1px solid #b2f2dc;
}

.demand-status-scheduled {
  color: #8a5a00;
  background: #fff4d6;
  border: 1px solid #ffe08a;
}

.demand-status-done {
  color: #137845;
  background: #e4f8ec;
  border: 1px solid #c9ecd7;
}

.demand-status-deferred {
  color: #7c5b13;
  background: #f8f0dc;
  border: 1px solid #e8d3a6;
}

.demand-status-invalid {
  color: #9f1239;
  background: #ffe4e6;
  border: 1px solid #fecdd3;
}

.demand-product-section header {
  align-items: flex-start;
}

.demand-table td:first-child {
  min-width: 240px;
}

.demand-detail .rich-content:empty::before {
  content: "暂无描述。";
  color: var(--faint);
}

.demand-detail .detail-list {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px 16px;
  margin: 18px 0 0;
}

.demand-detail .detail-list dt,
.demand-detail .detail-list dd {
  margin: 0;
}

.demand-detail .detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.demand-detail .detail-list dd {
  min-width: 0;
  color: var(--text);
  word-break: break-word;
}

.demand-detail .detail-inline-value {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.demand-detail .detail-inline-value:not(:disabled):hover {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demand-detail .detail-inline-value:disabled {
  cursor: default;
}

.demand-detail .detail-inline-select {
  max-width: 260px;
}

.demand-detail .detail-inline-select .custom-select summary {
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.demand-detail .detail-inline-select .custom-select-panel {
  width: max(100%, 260px);
}

.demand-hero-product-pill {
  position: relative;
  overflow: visible;
  cursor: pointer;
}

.demand-hero-product-pill:not(:has(.demand-hero-product-editor)) {
  cursor: default;
}

.demand-hero-product-pill.is-editable::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.68;
  transform: translateY(1px);
}

.demand-hero-product-text {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  padding: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
}

.demand-hero-product-editor {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 55;
  display: grid;
  gap: 10px;
  width: 280px;
  max-width: calc(100vw - 32px);
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.demand-hero-product-editor[hidden] {
  display: none !important;
}

.demand-hero-product-editor input[type="search"] {
  min-height: 42px;
  height: 42px;
}

.demand-hero-product-options {
  display: grid;
  gap: 6px;
}

.demand-hero-product-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.demand-hero-product-option span:last-child {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demand-hero-product-option:hover,
.demand-hero-product-option.is-selected {
  background: #eef5ff;
  color: var(--primary-dark);
}

.demand-hero-product-option.is-selected .custom-select-check {
  border-color: var(--primary);
  background: var(--primary);
}

.demand-hero-product-option.is-selected .custom-select-check::after {
  content: "";
  width: 8px;
  height: 12px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg) translateY(-1px);
}

.demand-form-grid {
  align-items: start;
  margin-top: -6px;
}

.demand-form .ck-editor__editable {
  min-height: 220px;
}

.growth-meeting-head .week-actions {
  justify-content: flex-end;
}

.growth-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.growth-info-button {
  width: 22px;
  height: 22px;
  min-height: 0;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  transform: translateY(1px);
  appearance: none;
  -webkit-appearance: none;
}

.growth-info-button:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--primary);
}

.growth-info-button:active {
  transform: translateY(1px);
}

.growth-info-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.growth-info-panel {
  width: min(860px, calc(100vw - 40px));
}

.growth-info-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style-position: inside;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.growth-info-list li {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

.growth-info-list li:last-child {
  border-bottom: 0;
}

.growth-meeting-page {
  max-width: 1320px;
}

.growth-product-switch {
  min-width: 180px;
}

.growth-product-current {
  min-height: 44px;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-meeting-panel {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.growth-meeting-grid,
.growth-meeting-row {
  display: grid;
  grid-template-columns: 100px minmax(380px, 1fr) 280px;
}

.growth-meeting-grid-head {
  background: #f7fbff;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.growth-meeting-grid-head span,
.growth-section-title,
.growth-section-content,
.growth-section-attachments {
  padding: 16px;
}

.growth-meeting-row {
  min-height: 168px;
  border-bottom: 1px solid var(--line);
}

.growth-meeting-row:last-child {
  border-bottom: 0;
}

.growth-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  background: #fbfdff;
}

.growth-section-content {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.growth-section-preview {
  flex: 1;
  min-height: 136px;
  padding: 24px 28px;
  border: 0;
  border-radius: 0;
  cursor: text;
  box-sizing: border-box;
}

.growth-section-preview:empty::before {
  content: "点击编辑内容";
  color: var(--faint);
}

.growth-section-preview:hover {
  background: #fbfdff;
}

.growth-anchor-highlight {
  animation: growth-anchor-highlight 2.6s ease;
}

@keyframes growth-anchor-highlight {
  0%,
  60% {
    background: #fff7cc;
    box-shadow: 0 0 0 6px rgba(255, 218, 94, 0.28);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.growth-meeting-row.is-readonly .growth-section-preview {
  cursor: default;
}

.growth-meeting-row.is-readonly .growth-section-preview:hover {
  background: transparent;
}

.growth-section-editor {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.growth-section-editor .tiptap-toolbar {
  border-radius: 0;
}

.growth-section-editor .tiptap-editor {
  min-height: 220px;
}

.growth-section-editor .tiptap-editor .ProseMirror {
  min-height: 220px;
  padding: 24px 28px;
}

.growth-save-state {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 4px 14px rgba(20, 36, 68, 0.08);
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.growth-save-state[hidden] {
  display: none !important;
}

.growth-save-state[data-state="saving"],
.growth-save-state[data-state="dirty"] {
  color: var(--muted);
}

.growth-save-state[data-state="error"] {
  color: var(--danger);
}

.growth-section-attachments {
  min-width: 0;
  position: relative;
  transition: box-shadow 120ms ease, background 120ms ease;
}

.growth-section-attachments.is-cell-active {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.38);
  background: #fbfdff;
}

.growth-section-attachments [data-growth-upload] {
  display: none;
}

.growth-section-attachments.is-cell-active [data-growth-upload] {
  display: block;
}

.compact-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.compact-attachment .attachment-preview {
  height: 72px;
}

.growth-section-attachments .compact-attachment {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.growth-section-attachments .compact-attachment figcaption {
  position: static;
  min-height: 34px;
  justify-content: center;
  padding: 7px 8px;
  background: #fff;
  pointer-events: auto;
}

.growth-section-attachments .compact-attachment figcaption > span {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}

.growth-section-attachments .compact-attachment .attachment-delete {
  position: static;
  display: inline-flex;
  width: 30px;
  height: 30px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--danger);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.growth-section-attachments .compact-attachment .attachment-delete svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.growth-section-attachments .compact-attachment .attachment-delete:hover,
.growth-section-attachments .compact-attachment .attachment-delete:focus-visible {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.36);
}

.growth-section-attachments .compact-attachment:hover .attachment-delete,
.growth-section-attachments .compact-attachment:focus-within .attachment-delete {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.growth-section-attachments .compact-attachment figcaption form {
  position: absolute;
  top: 6px;
  right: 6px;
  margin: 0;
  pointer-events: auto;
}

.growth-media-lightbox {
  padding: 16px;
}

.growth-media-lightbox .media-lightbox-panel {
  width: min(1440px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
}

.growth-media-lightbox .media-lightbox-body {
  min-height: calc(100vh - 104px);
  overflow: auto;
}

.growth-media-lightbox .media-lightbox-body img,
.growth-media-lightbox .media-lightbox-body video {
  max-width: 100%;
  max-height: calc(100vh - 136px);
  transform-origin: center center;
  transition: transform 140ms ease;
}

.growth-media-lightbox.is-zoomed .media-lightbox-body {
  place-items: start center;
  padding: 28px;
}

.growth-media-nav,
.growth-media-fullscreen,
.growth-media-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}

.growth-media-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.growth-media-nav.is-prev {
  left: 14px;
}

.growth-media-nav.is-next {
  right: 14px;
}

.growth-media-nav[hidden] {
  display: none;
}

.growth-media-fullscreen {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.growth-media-lightbox.is-fullscreen {
  padding: 0;
}

.growth-media-lightbox.is-fullscreen .media-lightbox-panel {
  width: 100vw;
  max-height: 100vh;
  height: 100vh;
  border-radius: 0;
}

.growth-media-lightbox.is-fullscreen .media-lightbox-body {
  min-height: calc(100vh - 44px);
}

.growth-media-nav svg,
.growth-media-fullscreen svg,
.growth-media-tools svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.growth-media-tools {
  position: absolute;
  right: 16px;
  bottom: 58px;
  z-index: 4;
  display: flex;
  gap: 8px;
}

.growth-media-tools button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.growth-media-nav:hover,
.growth-media-nav:focus-visible,
.growth-media-fullscreen:hover,
.growth-media-fullscreen:focus-visible,
.growth-media-tools button:hover,
.growth-media-tools button:focus-visible {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.32);
  background: #fff;
}

.growth-dropzone {
  min-height: 96px;
  padding: 14px;
}

.growth-dropzone .attachment-dropzone-body {
  gap: 3px;
}

@media (max-width: 980px) {
  .growth-meeting-panel {
    overflow-x: auto;
  }

  .growth-meeting-grid,
  .growth-meeting-row {
    min-width: 720px;
  }
}

.demand-form > label:first-of-type {
  padding-top: 10px;
}
