:root {
  color-scheme: light;
  --bg: #f4f4f4;
  --bg-elevated: #ffffff;
  --bg-solid: #ffffff;
  --text: #111111;
  --muted: #4f5057;
  --soft: #eeeeef;
  --line: rgba(17, 17, 17, 0.1);
  --line-strong: rgba(17, 17, 17, 0.2);
  --accent: #111111;
  --accent-soft: rgba(17, 17, 17, 0.08);
  --done: #111111;
  --danger: #a21d1d;
  --status-green: #0f7a3b;
  --status-green-soft: rgba(15, 122, 59, 0.1);
  --status-green-line: rgba(15, 122, 59, 0.28);
  --status-red: #b42318;
  --status-red-soft: rgba(180, 35, 24, 0.1);
  --status-red-line: rgba(180, 35, 24, 0.3);
  --status-gray: #777a82;
  --status-gray-soft: rgba(119, 122, 130, 0.12);
  --status-gray-line: rgba(119, 122, 130, 0.26);
  --sidebar-bg: #18191b;
  --sidebar-text: #f8f8f8;
  --sidebar-muted: #8d8f96;
  --sidebar-active: #2d2f35;
  --shadow: 0 24px 60px rgba(15, 15, 15, 0.07);
  --radius: 9px;
  --speed: 220ms;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --bg-elevated: #181818;
  --bg-solid: #202020;
  --text: #fafafa;
  --muted: #a7a7a7;
  --soft: #292929;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #f5f5f5;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --done: #fafafa;
  --danger: #ff6a6a;
  --status-green: #7ee3a1;
  --status-green-soft: rgba(126, 227, 161, 0.13);
  --status-green-line: rgba(126, 227, 161, 0.3);
  --status-red: #ff8b7f;
  --status-red-soft: rgba(255, 139, 127, 0.13);
  --status-red-line: rgba(255, 139, 127, 0.32);
  --status-gray: #8e8e93;
  --status-gray-soft: rgba(142, 142, 147, 0.14);
  --status-gray-line: rgba(142, 142, 147, 0.28);
  --sidebar-bg: #080808;
  --sidebar-text: #fafafa;
  --sidebar-muted: #888888;
  --sidebar-active: #1f1f1f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    "SF Pro Text",
    "SF Pro Display",
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Hiragino Sans GB",
    "Helvetica Neue",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
  line-height: 1.5;
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-140%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--bg-solid);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform var(--speed) ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px 14px;
  border-right: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: #f8f8f8;
  color: #111111;
}

.brand p,
.brand strong,
.mini-panel p,
.metric-card p,
.metric-card span,
.eyebrow {
  margin: 0;
}

.brand p,
.eyebrow,
.summary-card p,
.mini-panel p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0;
  color: var(--sidebar-text);
}

.brand p,
.mini-panel p {
  color: var(--sidebar-muted);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item,
.segment,
.ghost-button,
.icon-button,
.primary-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    background var(--speed) ease,
    border-color var(--speed) ease,
    color var(--speed) ease,
    transform var(--speed) ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  color: var(--sidebar-muted);
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--sidebar-active);
  color: var(--sidebar-text);
}

.mini-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sidebar-text);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08);
}

.workspace {
  position: relative;
  isolation: isolate;
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 24px 28px;
}

.workspace > :not(.interactive-grid) {
  position: relative;
  z-index: 1;
}

.interactive-grid {
  position: fixed;
  inset: -20vh 0 auto 236px;
  z-index: 0;
  height: 620px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.82;
  transform: skewY(10deg);
  -webkit-mask-image: radial-gradient(430px circle at 50% 22%, #000 0 42%, transparent 72%);
  mask-image: radial-gradient(430px circle at 50% 22%, #000 0 42%, transparent 72%);
}

.interactive-grid::before,
.interactive-grid::after {
  position: absolute;
  inset: -80px;
  content: "";
}

.interactive-grid::before {
  background-image:
    linear-gradient(to right, rgba(17, 17, 17, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 17, 17, 0.09) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-drift 18s linear infinite;
}

.interactive-grid::after {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.82), transparent 48%),
    linear-gradient(180deg, rgba(244, 244, 244, 0.1), var(--bg) 76%);
}

.interactive-grid span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  background: rgba(17, 17, 17, 0.08);
  opacity: 0;
  animation: grid-square-pulse 5.8s ease-in-out var(--delay) infinite;
}

[data-theme="dark"] .interactive-grid {
  opacity: 0.58;
  -webkit-mask-image: radial-gradient(430px circle at 50% 22%, #000 0 38%, transparent 72%);
  mask-image: radial-gradient(430px circle at 50% 22%, #000 0 38%, transparent 72%);
}

[data-theme="dark"] .interactive-grid::before {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
}

[data-theme="dark"] .interactive-grid::after {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(17, 17, 17, 0.08), var(--bg) 76%);
}

[data-theme="dark"] .interactive-grid span {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-family:
    "SF Pro Display",
    "SF Pro Text",
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Hiragino Sans GB",
    "Helvetica Neue",
    Arial,
    sans-serif;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  font-weight: 760;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.top-actions,
.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-color: var(--line);
  background: var(--bg-elevated);
  color: var(--text);
}

.file-button {
  cursor: pointer;
}

.file-input {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-button:hover,
.ghost-button:hover,
.segment:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.command-strip {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-width: 0;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.segment {
  width: 100%;
  padding: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 650;
}

.segment.is-active {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.12);
}

:root .segment.is-active {
  color: #ffffff;
}

[data-theme="dark"] .segment.is-active {
  color: #111111;
}

.item-meta a {
  color: var(--text);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.creator-url-input {
  display: none;
}

[data-active-view="creators"] .quick-form {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.1fr) auto;
}

[data-active-view="creators"] .creator-url-input {
  display: block;
}

.quick-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--bg-solid);
  color: var(--text);
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}

.quick-form input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-solid);
  font-weight: 700;
}

.active-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 12px;
  margin-bottom: 12px;
}

.summary-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.summary-card {
  min-height: 150px;
  padding: 18px;
}

.summary-card strong {
  display: block;
  margin: 18px 0 4px;
  font-size: 46px;
  line-height: 1;
}

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

.summary-note {
  display: grid;
  align-content: center;
  gap: 10px;
}

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

.panel {
  display: none;
  min-height: 520px;
  padding: 16px;
}

.panel.is-visible {
  display: block;
}

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

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.platform-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  overflow-x: auto;
  white-space: nowrap;
}

.platform-tab {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  transition:
    background var(--speed) ease,
    border-color var(--speed) ease,
    color var(--speed) ease;
}

.platform-tab:hover,
.platform-tab.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg-solid);
}

.ghost-button {
  padding: 0 12px;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.ghost-button:hover {
  background: var(--soft);
  color: var(--text);
}

.strong-action {
  background: var(--text);
  color: var(--bg-solid);
}

.strong-action:hover {
  background: var(--text);
  color: var(--bg-solid);
}

.list {
  display: grid;
  gap: 8px;
}

.gantt-panel {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-solid);
}

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

.gantt-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.gantt-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  min-width: 900px;
  overflow: hidden;
}

.gantt-day,
.gantt-bar,
.gantt-empty-row {
  min-height: 42px;
  border-radius: calc(var(--radius) - 2px);
}

.gantt-day {
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

.gantt-day span {
  font-size: 12px;
  font-weight: 700;
}

.gantt-day strong {
  color: var(--text);
  font-size: 13px;
}

.gantt-day.is-today {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg-solid);
}

.gantt-day.is-today strong {
  color: var(--bg-solid);
}

.gantt-bar {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--status-green-line);
  padding: 0 12px;
  background: var(--status-green-soft);
  color: var(--status-green);
  font-weight: 750;
  text-align: left;
  transition:
    transform var(--speed) ease,
    border-color var(--speed) ease,
    background var(--speed) ease;
}

.gantt-bar:hover {
  transform: translateY(-1px);
  border-color: var(--status-green);
}

.gantt-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-bar.is-complete {
  border-color: var(--status-gray-line);
  background: var(--status-gray-soft);
  color: var(--status-gray);
}

.gantt-bar.is-overdue-task {
  border-color: var(--status-red-line);
  background: var(--status-red-soft);
  color: var(--status-red);
}

.gantt-today-line {
  justify-self: center;
  align-self: stretch;
  width: 1px;
  min-height: 42px;
  border-radius: 999px;
  background: var(--text);
  opacity: 0.2;
  pointer-events: none;
}

.gantt-empty-row {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.unscheduled-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.unscheduled-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.unscheduled-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.unscheduled-pill {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.unscheduled-pill:hover {
  border-color: var(--text);
  color: var(--text);
}

.gantt-panel .empty {
  min-height: 150px;
}

.week-review-section {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-solid);
}

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

.review-head h3 {
  margin: 0;
  font-size: 17px;
}

.review-status,
#weekReviewStatus {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

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

.review-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.review-grid textarea {
  width: 100%;
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--bg-elevated);
  color: var(--text);
  line-height: 1.45;
  resize: vertical;
  transition:
    border-color var(--speed) ease,
    background var(--speed) ease,
    box-shadow var(--speed) ease;
}

.review-grid textarea:focus {
  border-color: var(--text);
  background: var(--bg-solid);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}

.review-wide {
  grid-column: 1 / -1;
}

.history-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.history-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.archive-item {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--status-gray-line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, var(--status-gray-soft), transparent 34%),
    var(--bg-solid);
  color: var(--status-gray);
}

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

.archive-title {
  margin: 0;
  color: var(--status-gray);
  font-size: 15px;
  font-weight: 760;
}

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

.archive-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 30px;
  color: var(--status-gray);
}

.archive-task span {
  width: 8px;
  height: 8px;
  border: 1px solid var(--status-gray-line);
  border-radius: 50%;
}

.archive-task.is-done span {
  border-color: var(--status-gray);
  background: var(--status-gray);
}

.archive-task p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.archive-task.is-done p {
  color: var(--status-gray);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.archive-review {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--status-gray-line);
  padding-top: 12px;
}

.archive-review-title {
  margin: 0;
  color: var(--status-gray);
  font-size: 13px;
  font-weight: 800;
}

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

.archive-review-grid section {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--status-gray-line);
  border-radius: calc(var(--radius) - 2px);
  padding: 9px;
  background: var(--bg-solid);
}

.archive-review-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.archive-review-grid p {
  margin: 0;
  color: var(--status-gray);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

.item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-solid);
  animation: rise 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.task-item {
  border-color: var(--status-green-line);
  background:
    linear-gradient(90deg, var(--status-green-soft), transparent 34%),
    var(--bg-solid);
}

.task-item .check {
  border-color: var(--status-green-line);
}

.task-item .item-title {
  color: var(--status-green);
}

.task-item .tag {
  background: var(--status-green-soft);
  color: var(--status-green);
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  align-self: center;
  white-space: nowrap;
}

.task-today.is-complete {
  border-color: var(--status-gray-line);
  background:
    linear-gradient(90deg, var(--status-gray-soft), transparent 34%),
    var(--bg-solid);
}

.task-today.is-complete .item-title,
.task-today.is-complete .item-meta {
  color: var(--status-gray);
}

.task-today.is-complete .tag {
  background: var(--status-gray-soft);
  color: var(--status-gray);
}

.task-today.is-complete .check.is-done {
  border-color: var(--status-gray);
  background: var(--status-gray);
  color: var(--bg-solid);
}

.task-today.is-overdue-task {
  border-color: var(--status-red-line);
  background:
    linear-gradient(90deg, var(--status-red-soft), transparent 34%),
    var(--bg-solid);
}

.task-today.is-overdue-task .check {
  border-color: var(--status-red-line);
}

.task-today.is-overdue-task .item-title,
.task-today.is-overdue-task .item-meta {
  color: var(--status-red);
}

.task-today.is-overdue-task .tag,
.task-today .tag.is-overdue {
  background: var(--status-red);
  color: var(--bg-solid);
}

.task-week .check.is-done {
  border-color: var(--status-green);
  background: var(--status-green);
  color: var(--bg-solid);
}

.task-week.is-complete {
  border-color: var(--status-gray-line);
  background:
    linear-gradient(90deg, var(--status-gray-soft), transparent 34%),
    var(--bg-solid);
}

.task-week.is-complete .item-title,
.task-week.is-complete .item-meta {
  color: var(--status-gray);
}

.task-week.is-complete .tag {
  background: var(--status-gray-soft);
  color: var(--status-gray);
}

.task-week.is-complete .check.is-done {
  border-color: var(--status-gray);
  background: var(--status-gray);
  color: var(--bg-solid);
}

.task-week.is-overdue-task {
  border-color: var(--status-red-line);
  background:
    linear-gradient(90deg, var(--status-red-soft), transparent 34%),
    var(--bg-solid);
}

.task-week.is-overdue-task .item-title,
.task-week.is-overdue-task .item-meta {
  color: var(--status-red);
}

.task-week.is-overdue-task .tag.is-overdue {
  background: var(--status-red);
  color: var(--bg-solid);
}

.compact-list .item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.creator-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.compact-list .creator-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.creator-edit-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
}

.item-edit-row {
  z-index: 12;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
}

.week-edit-row {
  z-index: 18;
}

.compact-list .creator-edit-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.compact-list .item-edit-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.creator-edit-grid,
.item-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 10px;
}

.item-edit-grid {
  grid-template-columns: minmax(0, 1fr);
}

.week-date-edit {
  grid-template-columns: minmax(0, 1.2fr) minmax(210px, 0.9fr);
}

.two-field-edit {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.creator-edit-grid label,
.item-edit-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.creator-edit-grid input,
.item-edit-grid input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--bg-solid);
  color: var(--text);
}

.date-range-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.date-range-picker {
  position: relative;
}

.date-range-picker summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--bg-solid);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition:
    border-color var(--speed) ease,
    box-shadow var(--speed) ease,
    transform var(--speed) ease;
}

.date-range-picker summary::-webkit-details-marker {
  display: none;
}

.date-range-picker summary:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.date-range-picker summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.date-range-picker summary svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.date-range-picker summary strong {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 760;
}

.date-range-picker[open] summary {
  border-color: var(--text);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.date-range-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(520px, 86vw);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.date-range-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(54px, 1fr));
  gap: 6px;
}

.range-day {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  padding: 6px;
  background: var(--bg-solid);
  color: var(--muted);
  transition:
    border-color var(--speed) ease,
    background var(--speed) ease,
    color var(--speed) ease,
    transform var(--speed) ease;
}

.range-day:hover {
  border-color: var(--text);
  color: var(--text);
  transform: translateY(-1px);
}

.range-day span {
  font-size: 12px;
  font-weight: 740;
}

.range-day strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.range-day.is-today {
  border-color: var(--line-strong);
}

.range-day.is-in-range {
  border-color: var(--status-green-line);
  background: var(--status-green-soft);
  color: var(--status-green);
}

.range-day.is-in-range strong {
  color: var(--status-green);
}

.range-day.is-start,
.range-day.is-end {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg-solid);
}

.range-day.is-start strong,
.range-day.is-end strong {
  color: var(--bg-solid);
}

.date-range-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.date-range-helper button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--bg-solid);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.date-range-helper button:hover {
  border-color: var(--text);
  color: var(--text);
}

.check {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: transparent;
}

.check.is-done {
  border-color: var(--done);
  background: var(--done);
  color: white;
}

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

.task-hit-area {
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  outline: none;
}

.task-hit-area:focus-visible {
  box-shadow: 0 0 0 3px var(--ring);
}

.item-title {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag.is-overdue {
  background: var(--text);
  color: var(--bg-solid);
}

.source-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.delete-button,
.edit-button,
.derive-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  transition: background var(--speed) ease, color var(--speed) ease;
}

.derive-button:hover,
.edit-button:hover,
.strong-edit {
  background: var(--soft);
  color: var(--text);
}

.strong-edit {
  background: var(--text);
  color: var(--bg-solid);
}

.delete-button:hover {
  background: rgba(200, 38, 38, 0.1);
  color: var(--danger);
}

.empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 36px));
  transform: translateY(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--bg-solid);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--speed) ease, transform var(--speed) ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.confetti-burst {
  position: fixed;
  z-index: 40;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.confetti-burst span {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--s);
  height: calc(var(--s) * 1.55);
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.12);
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: confetti-pop 760ms cubic-bezier(0.18, 0.9, 0.2, 1) var(--delay) forwards;
}

@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes confetti-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--x) - 50%), calc(var(--y) + 54px)) scale(0.96)
      rotate(var(--r));
  }
}

@keyframes grid-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(40px, 40px, 0);
  }
}

@keyframes grid-square-pulse {
  0%,
  68%,
  100% {
    opacity: 0;
    transform: scale(0.82);
  }
  18%,
  42% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-burst {
    display: none;
  }
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand div,
  .nav-item span,
  .mini-panel div {
    display: none;
  }

  .brand,
  .nav-item,
  .mini-panel {
    justify-content: center;
  }

  .active-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
    padding-bottom: 80px;
  }

  .sidebar {
    position: fixed;
    inset: auto 12px 12px;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr;
    width: auto;
    height: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .brand,
  .mini-panel {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-item {
    justify-content: center;
    min-width: 0;
    padding: 10px 6px;
  }

  .workspace {
    padding: 16px;
  }

  .interactive-grid {
    inset: -16vh 0 auto 0;
    height: 460px;
  }

  .topbar,
  .command-strip,
  .quick-form,
  .content-grid,
  .active-summary {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: end;
  }

  .command-strip {
    align-items: stretch;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }

  .segment {
    width: 100%;
    min-height: 40px;
    font-size: 14px;
  }

  [data-active-view="creators"] .quick-form,
  .review-grid,
  .archive-review-grid,
  .creator-edit-grid,
  .item-edit-grid,
  .week-date-edit,
  .two-field-edit {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 108px;
  }

  .date-range-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .date-range-grid {
    grid-template-columns: repeat(7, minmax(36px, 1fr));
  }

  .range-day {
    min-height: 52px;
    padding: 5px 3px;
  }

  .task-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .item-actions {
    gap: 2px;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 32px;
  }

  .panel-head {
    display: grid;
  }

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

  .range-day span {
    font-size: 11px;
  }

  .range-day strong {
    font-size: 13px;
  }

  .panel-actions .ghost-button {
    width: 100%;
  }

  .derive-button,
  .edit-button,
  .delete-button {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .interactive-grid {
    display: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
