:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --panel: #ffffff;
  --panel-soft: #f9faf6;
  --line: #dfe4dc;
  --text: #26302d;
  --muted: #69736e;
  --muted-2: #87908b;
  --green: #287b5b;
  --green-soft: #e4f2eb;
  --amber: #b97216;
  --amber-soft: #fbedd6;
  --red: #b84034;
  --red-soft: #f8e4df;
  --blue: #2d6289;
  --blue-soft: #e3eef6;
  --ink: #1f2724;
  --shadow: 0 16px 36px rgba(46, 56, 52, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.auth-pending .app-shell {
  visibility: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.auth-ready .auth-gate {
  display: none;
}

.auth-card {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

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

.auth-brand h1,
.auth-brand p {
  margin: 0;
}

.auth-brand h1 {
  font-size: 26px;
  line-height: 1.2;
}

.auth-loading,
.auth-intro {
  display: grid;
  gap: 6px;
}

.auth-loading span,
.auth-intro span,
.auth-form p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

.auth-form input:focus {
  outline: 2px solid rgba(40, 123, 91, 0.2);
  border-color: var(--green);
}

.auth-submit {
  min-height: 46px;
  margin-top: 2px;
}

.auth-form p,
.auth-message {
  margin: 0;
}

.auth-message {
  min-height: 20px;
  margin-top: 14px;
  color: var(--red);
  font-size: 13px;
}

.sync-status {
  min-height: 34px;
  border: 1px solid #c7dfd2;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-status[data-state="syncing"] {
  border-color: #ecd4ad;
  background: var(--amber-soft);
  color: var(--amber);
}

.sync-status[data-state="error"],
.sync-status[data-state="conflict"] {
  border-color: #efc6bf;
  background: var(--red-soft);
  color: var(--red);
}

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

.sidebar,
.assistant-panel {
  background: var(--panel);
  border-color: var(--line);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 800;
  font-size: 22px;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.coach h3,
.coach p,
.new-task h3,
.daily-log h3,
.inbox h3,
.work-panel h3,
.work-panel p {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.1;
}

.brand p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--green-soft);
  border-color: #c7dfd2;
}

.nav-item strong {
  min-width: 26px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(40, 123, 91, 0.12);
  color: var(--green);
  font-size: 13px;
}

.nav-counts {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.followup-count {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 7px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.mini-panel,
.coach,
.daily-log,
.new-task,
.inbox {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 8px;
}

.mini-panel {
  padding: 14px;
  margin-top: auto;
}

.panel-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.mood-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.mood {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 34px;
  background: #fff;
  color: var(--muted);
}

.mood.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.mini-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.workspace {
  min-width: 0;
  min-height: 0;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}

.topbar h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.14;
  letter-spacing: 0;
}

.top-actions,
.inbox-actions,
.coach-actions,
.section-heading,
.quick-add {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
}

.primary-button {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 700;
}

.secondary-button:hover,
.icon-button:hover {
  border-color: #b9c4bd;
  background: #f7f9f6;
}

.icon-button {
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.wide {
  width: 100%;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(6, minmax(86px, 1fr));
  gap: 8px;
}

.view-tab {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.view-tab strong {
  min-width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

.view-tab:hover,
.view-tab.active {
  border-color: #b9d2c4;
  background: var(--green-soft);
  color: var(--text);
}

.view-tab.active strong {
  background: #fff;
  color: var(--green);
}

.view-stack {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: none;
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.metric {
  min-height: 78px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(46, 56, 52, 0.04);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 28px;
  line-height: 1;
}

.metric.urgent strong {
  color: var(--red);
}

.metric.calm strong {
  color: var(--blue);
}

.inbox {
  padding: 14px;
  background: var(--panel);
  flex: 0 0 auto;
}

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

.inbox textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: var(--panel-soft);
  line-height: 1.55;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 10px;
  min-height: 0;
}

.column {
  min-width: 220px;
  max-height: 100%;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  overflow-y: auto;
}

.column.drag-over {
  outline: 2px solid rgba(40, 123, 91, 0.35);
  outline-offset: 2px;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 2px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.column-header strong {
  min-width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

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

.task-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(46, 56, 52, 0.06);
}

.task-card[data-status="waiting"] {
  border-left-color: var(--amber);
}

.task-card[data-status="blocked"] {
  border-left-color: var(--red);
}

.task-card[data-status="later"] {
  border-left-color: var(--blue);
}

.task-card[data-status="done"] {
  border-left-color: #8a968f;
  opacity: 0.84;
}

.task-card.priority-card {
  border-color: #d7c08b;
  border-left-color: var(--amber);
}

.task-card.dragging {
  opacity: 0.5;
}

.task-card.compact-card {
  box-shadow: none;
}

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

.task-title {
  font-size: 15px;
  line-height: 1.35;
  margin: 0;
}

.tag {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-soft);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}

.next-action {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  background: #f7f8f4;
  border: 1px solid #e8ece4;
  border-radius: 7px;
  padding: 8px;
}

.next-action strong {
  color: var(--green);
  font-weight: 800;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}

.meta-pill.wait {
  background: var(--amber-soft);
  color: var(--amber);
}

.meta-pill.risk {
  background: var(--red-soft);
  color: var(--red);
}

.meta-pill.due {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

.meta-pill.quiet {
  background: #eef1ec;
  color: var(--muted);
}

.meta-pill.priority {
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.steps {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.step-dot {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.step-dot.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.step-dot.blocked {
  background: var(--red-soft);
  border-color: #e7afa8;
  color: var(--red);
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 6px;
}

.card-actions button {
  min-height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.card-actions button:hover {
  color: var(--text);
  border-color: #b8c3bc;
}

.card-actions .followup-action {
  background: var(--amber-soft);
  border-color: #efd2a2;
  color: var(--amber);
  font-weight: 800;
}

.assistant-panel {
  border-left: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 12px;
  min-height: 0;
}

.work-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 14px;
  min-height: 0;
  box-shadow: 0 8px 24px rgba(46, 56, 52, 0.04);
}

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

.work-panel h3 {
  font-size: 16px;
  line-height: 1.25;
}

.work-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
}

.compact-card-list,
.followup-list,
.life-list,
.proof-review-list,
.radar-list {
  display: grid;
  gap: 10px;
}

.main-focus .compact-card-list {
  grid-template-columns: 1fr;
}

.radar-item,
.proof-review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 11px;
  display: grid;
  gap: 6px;
}

.radar-item strong,
.proof-review-item strong {
  font-size: 14px;
  line-height: 1.35;
}

.radar-item p,
.proof-review-item p {
  margin: 0;
}

.followup-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  background: var(--panel);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.followup-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.followup-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.followup-card .meta-row {
  margin-top: 8px;
}

.followup-actions {
  display: grid;
  gap: 8px;
  min-width: 88px;
}

.table-desk {
  min-height: 0;
}

.table-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(70px, 1fr));
  gap: 6px;
  min-width: min(100%, 440px);
}

.table-filter {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.table-filter strong {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12px;
}

.table-filter.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.table-filter.active strong {
  background: #fff;
  color: var(--green);
}

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

.table-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
  display: grid;
  gap: 8px;
}

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

.table-stat strong {
  font-size: 22px;
  line-height: 1;
}

.task-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: auto;
}

.task-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.task-table th,
.task-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.task-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.task-table tbody tr:hover {
  background: #fbfcf8;
}

.task-table tbody tr.priority-row {
  background: #fffdf7;
}

.table-task-cell {
  min-width: 250px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.priority-button,
.priority-placeholder {
  width: 46px;
  height: 44px;
  flex: 0 0 46px;
}

.priority-button {
  border: 1px solid #d7decf;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.priority-button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.priority-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.priority-button.active:hover {
  color: #fff;
}

.priority-placeholder {
  display: block;
}

.table-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  object-fit: cover;
}

.table-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
}

.table-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.table-title strong {
  color: var(--text);
  line-height: 1.35;
}

.table-title span,
.table-next,
.table-muted {
  color: var(--muted);
  line-height: 1.45;
}

.table-next {
  min-width: 220px;
}

.status-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.today {
  background: var(--green-soft);
  color: var(--green);
}

.status-badge.waiting {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-badge.blocked,
.status-badge.due {
  background: var(--red-soft);
  color: var(--red);
}

.status-badge.done {
  background: #eef1ec;
  color: var(--muted);
}

.table-waiting,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 150px;
}

.table-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
}

.table-actions button:hover {
  border-color: #b8c3bc;
  color: var(--text);
}

.table-actions .followup-action {
  background: var(--amber-soft);
  border-color: #efd2a2;
  color: var(--amber);
  font-weight: 800;
}

.recap-highlight {
  border: 1px solid #cfe0d6;
  background: var(--green-soft);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
}

.coach,
.daily-log,
.new-task {
  padding: 14px;
}

.coach-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.coach h3,
.daily-log h3,
.new-task h3,
.inbox h3,
.work-panel h3 {
  font-size: 16px;
}

.coach p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.coach-message {
  min-height: 116px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 10px;
}

.coach-actions {
  align-items: stretch;
}

.coach-actions button {
  flex: 1;
  min-height: 36px;
  padding: 0 10px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 10px;
}

.quick-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
}

.quick-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

input,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  min-width: 0;
}

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

.proof-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.proof-list li::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--green);
}

.proof-list button {
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-2);
  border-radius: 6px;
}

.proof-list button:hover {
  background: #fff;
  border-color: var(--line);
  color: var(--red);
}

.achievement-filters {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 6px;
}

.period-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0 10px;
}

.period-filter.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

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

.achievement-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 10px;
}

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

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

.category-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.category-bar {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.category-track {
  height: 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.category-fill {
  height: 100%;
  width: var(--value);
  background: var(--green);
}

.activity-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.activity-day-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.activity-list {
  display: grid;
}

.activity-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-type {
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
}

.activity-detail strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 39, 36, 0.28);
}

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

.task-modal {
  width: min(860px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.modal-header {
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.draft-status {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.modal-grid label {
  display: grid;
  gap: 6px;
}

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

.modal-grid textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.thumbnail-toggle {
  align-content: start;
}

.thumbnail-toggle input {
  width: 18px;
  height: 18px;
}

.thumbnail-toggle em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.thumbnail-editor {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.thumbnail-preview {
  width: 150px;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--muted);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 13px;
}

.thumbnail-preview img,
.task-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-actions {
  display: grid;
  gap: 8px;
}

.task-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.history-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.history-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

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

.modal-actions {
  margin-top: 14px;
  position: sticky;
  bottom: -18px;
  z-index: 2;
  padding: 12px 0 0;
  background: linear-gradient(to top, var(--panel) 78%, rgba(255, 255, 255, 0));
}

.recap-box {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.empty-state {
  min-height: 86px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .assistant-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace,
  .view-panel {
    overflow: visible;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    padding-bottom: 74px;
  }

  .workspace {
    order: 1;
  }

  .sidebar {
    order: 2;
  }

  .assistant-panel {
    order: 3;
  }

  .sidebar,
  .workspace,
  .assistant-panel {
    width: 100%;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-section {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .focus-strip,
  .assistant-panel,
  .achievement-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-switch {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 20;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .view-tab {
    min-height: 48px;
    padding: 0 4px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
  }

  .view-tab strong {
    min-width: 22px;
    height: 20px;
    font-size: 11px;
  }

  .today-grid,
  .main-focus .compact-card-list {
    grid-template-columns: 1fr;
  }

  .topbar,
  .inbox-header,
  .work-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .work-panel-header .secondary-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .workspace,
  .sidebar,
  .assistant-panel {
    padding: 18px 14px;
  }

  .nav-section,
  .focus-strip,
  .assistant-panel {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .inbox-actions,
  .coach-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .primary-button,
  .secondary-button {
    flex: 1;
  }

  .auth-card {
    padding: 22px 18px;
  }

  .sync-status {
    flex: 0 0 auto;
  }

  .board {
    grid-template-columns: repeat(5, 82vw);
  }

  .followup-card {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: stretch;
  }

  .task-modal {
    max-height: calc(100vh - 20px);
  }

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

  .achievement-summary,
  .quick-meta,
  .thumbnail-editor {
    grid-template-columns: 1fr;
  }

  .activity-item {
    grid-template-columns: 1fr;
  }

  .modal-header,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
