:root {
  --paper: #fff8dc;
  --paper-2: #fffef6;
  --ink: #213547;
  --muted: #5d7182;
  --line: #213547;
  --shadow: #213547;
  --blue: #3b82f6;
  --cyan: #10b6d8;
  --green: #35b86b;
  --yellow: #ffd166;
  --orange: #ff8a3d;
  --pink: #ff6b9f;
  --violet: #8b5cf6;
  --red: #ef4444;
  --teal: #14b8a6;
  --lime: #84cc16;
  --indigo: #6366f1;
  --sticker-blue: rgba(16, 182, 216, 0.16);
  --sticker-orange: rgba(255, 138, 61, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(33, 53, 71, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(33, 53, 71, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

body.no-scroll {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

button,
input,
select,
textarea {
  border-radius: var(--radius);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(59, 130, 246, 0.28);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}

h1,
h2,
.brand-block strong,
.status-strip strong,
.radial-stat strong {
  font-family: "Baloo 2", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
}

h1 {
  font-size: 44px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.16;
  letter-spacing: 0;
}

p,
small,
span,
strong,
button,
label,
dd,
dt,
li {
  overflow-wrap: anywhere;
}

svg {
  width: 20px;
  height: 20px;
  max-width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  padding: 12px 13px;
  box-shadow: 3px 3px 0 var(--shadow);
}

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}

.sprite {
  display: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-140%);
  background: var(--ink);
  color: #fff;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-decoration: none;
}

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

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  min-width: 0;
  display: grid;
  gap: 18px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 22px;
}

.auth-illustration {
  min-width: 0;
  display: flex;
  justify-content: center;
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-illustration img {
  width: min(100%, 360px);
  max-height: 184px;
  object-fit: contain;
  display: block;
}

body.auth-required .app-shell {
  display: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px 12px;
  border-right: 3px solid var(--line);
  background: #ffd166;
  box-shadow: 8px 0 0 rgba(33, 53, 71, 0.08);
}

body.sidebar-collapsed .app-shell {
  --sidebar-width: 82px;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 24px;
  font-weight: 800;
}

.brand-block strong,
.brand-block small {
  display: block;
}

.brand-block strong {
  font-size: 20px;
  line-height: 1;
}

.brand-block small {
  margin-top: 2px;
  color: #42556a;
  font-size: 13px;
  font-weight: 800;
}

.sidebar-toggle {
  justify-self: end;
}

.sidebar-toggle svg {
  transform: rotate(180deg);
  transition: transform 180ms ease;
}

body.sidebar-collapsed .sidebar-toggle {
  justify-self: start;
  width: calc(100% - 6px);
  min-height: 48px;
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(0);
}

body.sidebar-collapsed .brand-block {
  justify-content: flex-start;
}

body.sidebar-collapsed .brand-mark {
  width: calc(100% - 6px);
  min-height: 48px;
}

body.sidebar-collapsed .brand-block div,
body.sidebar-collapsed .nav-button span,
body.sidebar-collapsed .sidebar .primary-action span,
body.sidebar-collapsed .tool-action span,
body.sidebar-collapsed #logout-button {
  display: none;
}

.topnav {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -7px -8px 0;
  padding: 0 7px 8px 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.nav-button {
  width: calc(100% - 6px);
  min-height: 48px;
  border: 3px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nav-button:hover {
  background: #f4fbff;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.nav-button.is-active {
  color: var(--ink);
  background: #9be7ff;
}

body.sidebar-collapsed .nav-button {
  justify-content: center;
  padding: 0;
}

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

.top-actions .primary-action,
.top-actions .text-button {
  grid-column: 1 / -1;
  width: 100%;
}

body.sidebar-collapsed .top-actions {
  grid-template-columns: 1fr;
}

.icon-button,
.tool-action,
.primary-action,
.secondary-action,
.text-button {
  border: 3px solid var(--line);
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.icon-button {
  width: 46px;
  color: var(--ink);
  background: #fff;
}

.tool-action {
  min-width: 0;
  color: var(--ink);
  background: #fff;
  padding: 0 10px;
  font-weight: 900;
}

body.sidebar-collapsed .tool-action {
  width: calc(100% - 6px);
  justify-self: start;
  padding: 0;
}

body.sidebar-collapsed .top-actions .primary-action {
  width: calc(100% - 6px);
  justify-self: start;
}

.primary-action {
  color: var(--ink);
  background: var(--orange);
  padding: 0 14px;
  font-weight: 900;
}

.secondary-action {
  width: 100%;
  color: var(--ink);
  background: #fff;
  padding: 0 14px;
  font-weight: 900;
}

.text-button {
  min-height: 40px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.icon-button:hover,
.tool-action:hover,
.primary-action:hover,
.secondary-action:hover,
.text-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.full {
  width: 100%;
}

.form-note {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-note.is-error {
  color: var(--red);
}

.form-note.is-ok {
  color: var(--green);
}

.app-main {
  min-width: 0;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.screen {
  display: none;
}

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

.eyebrow {
  display: block;
  color: var(--muted);
  font-family: "Baloo 2", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.auth-card > div:not(.auth-illustration),
.section-heading,
.panel-head > div:not(.segmented),
.drawer-head > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.quest-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
  align-items: stretch;
  gap: 18px;
  margin-bottom: 16px;
}

.quest-copy {
  min-height: 188px;
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 14px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 6px 6px 0 var(--shadow), 10px 10px 0 var(--sticker-blue);
  padding: 26px;
}

.quest-copy h1 {
  line-height: 1.16;
}

.date-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #bdeffd;
  box-shadow: 4px 4px 0 var(--shadow);
  color: var(--ink);
  font-family: "Baloo 2", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  padding: 0 12px;
}

.hero-route {
  min-width: 0;
  min-height: 188px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 52px minmax(18px, 1fr) 52px minmax(18px, 1fr) 52px;
  align-items: center;
  gap: 6px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #bdeffd 0%, #e8fbff 54%, #fff3bc 100%);
  box-shadow: 6px 6px 0 var(--shadow), 10px 10px 0 var(--sticker-orange);
  padding: 20px 14px;
}

.route-step {
  min-width: 0;
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ink);
}

.route-step span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 4px 4px 0 var(--shadow);
}

.route-step svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.8;
}

.route-step b {
  max-width: 100%;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--shadow);
  font-size: 13px;
  line-height: 1;
  padding: 4px 6px;
  white-space: nowrap;
}

.route-step.is-done span {
  background: #b7f6c7;
}

.route-step.is-now span {
  background: var(--yellow);
}

.route-line {
  height: 10px;
  position: relative;
  z-index: 2;
  display: block;
  border-top: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  background: #fff;
  box-shadow: 0 3px 0 var(--shadow);
}

.member-switch {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-tools-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 5px 5px 0 var(--shadow), 9px 9px 0 var(--sticker-blue);
  padding: 14px;
}

.task-tools-panel[hidden] {
  display: none;
}

.search-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.task-tools-panel .form-note {
  grid-column: 1 / -1;
  min-height: 18px;
}

.task-tools-panel .search-field input,
.task-tools-panel .text-button {
  min-height: 52px;
  border-width: 3px;
}

.task-tools-panel .text-button {
  align-self: end;
}

.member-chip {
  min-height: 48px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 0 12px;
  font-weight: 900;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.member-chip:hover,
.member-chip.is-active {
  background: #d6f8ff;
}

.avatar {
  width: 30px;
  height: 30px;
  border: 2px solid var(--line);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  flex: 0 0 auto;
}

.avatar.all {
  background: var(--yellow);
}

.avatar.one {
  background: #9be7ff;
}

.avatar.two {
  background: #c4b5fd;
}

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

.status-strip div {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 5px 5px 0 var(--shadow);
  padding: 16px;
}

.status-strip span,
.status-strip small {
  color: var(--muted);
  font-weight: 800;
}

.status-strip strong {
  font-size: 31px;
  line-height: 1;
}

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

.today-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
}

.today-side {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 18px;
}

.panel-separator {
  height: 3px;
  margin: 18px 0;
  background: var(--line);
}

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

.panel-head.tight {
  margin-bottom: 12px;
}

.timeline-panel {
  grid-column: 1;
  grid-row: auto;
}

.action-panel {
  display: grid;
  gap: 14px;
  background: #fff3bc;
}

.plan-panel,
.tags-panel {
  grid-column: span 3;
}

.stats-panel {
  grid-column: span 6;
}

.today-side .action-panel,
.today-side .plan-panel,
.today-side .tags-panel,
.today-side .stats-panel {
  grid-column: auto;
}

.today-side .chart-wrap {
  min-height: 118px;
}

.today-side .chart-wrap svg {
  max-height: 118px;
}

.segmented {
  min-height: 44px;
  display: inline-flex;
  gap: 6px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 4px;
}

.segmented button {
  min-width: 64px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-weight: 900;
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--yellow);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-row {
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: 82px 28px minmax(0, 1fr) 132px;
  align-items: center;
  gap: 12px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 12px;
  text-align: left;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.timeline-row:hover {
  background: #f6fcff;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.timeline-row.is-done {
  background: #e6ffe9;
}

.timeline-row.is-delayed {
  background: #ffe7ef;
}

.time {
  color: var(--muted);
  font-family: "Baloo 2", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 900;
}

.pin {
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--cyan);
  display: grid;
  place-items: center;
}

.pin svg {
  width: 14px;
  height: 14px;
  stroke-width: 4;
}

.pin.cyan {
  background: var(--cyan);
}

.pin.blue {
  background: var(--blue);
}

.pin.teal {
  background: var(--teal);
  color: #fff;
}

.pin.green {
  background: var(--green);
  color: #fff;
}

.pin.lime {
  background: var(--lime);
}

.pin.yellow {
  background: var(--yellow);
}

.pin.orange {
  background: var(--orange);
}

.pin.violet {
  background: var(--violet);
  color: #fff;
}

.pin.rose {
  background: var(--pink);
}

.pin.red {
  background: var(--red);
  color: #fff;
}

.pin.indigo {
  background: var(--indigo);
  color: #fff;
}

.task-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.task-main strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.task-main small {
  color: var(--muted);
  font-weight: 800;
}

.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.pill svg {
  width: 14px;
  height: 14px;
}

.tag.cyan,
.pill.cyan {
  background: #bdeffd;
}

.tag.green,
.pill.green {
  background: #b7f6c7;
}

.tag.blue,
.pill.blue {
  background: #c7dcff;
}

.tag.teal,
.pill.teal {
  background: #b5f5e8;
}

.tag.orange,
.pill.orange {
  background: #ffd0a6;
}

.tag.lime,
.pill.lime {
  background: #dcf9a8;
}

.tag.yellow,
.pill.yellow {
  background: #fff08a;
}

.tag.violet,
.pill.violet {
  background: #ddd1ff;
}

.tag.rose,
.pill.rose {
  background: #ffc3d8;
}

.tag.red,
.pill.red {
  background: #ffb4b4;
}

.tag.indigo,
.pill.indigo {
  background: #c9d2ff;
}

.task-side {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.task-side b {
  color: var(--ink);
  font-size: 13px;
}

.quick-form,
.stack-form {
  display: grid;
  gap: 12px;
}

.quick-form label,
.stack-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

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

.progress-stack {
  display: grid;
  gap: 12px;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 8px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 3px 3px 0 var(--shadow);
  padding: 10px;
}

.progress-label {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.progress-label b {
  font-weight: 900;
}

.progress-label small {
  color: var(--muted);
  font-weight: 800;
}

.progress-meter {
  grid-column: 1 / -1;
  height: 12px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.progress-meter i {
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--cyan);
}

.progress-row.blue .progress-meter i {
  background: var(--blue);
}

.progress-row.teal .progress-meter i {
  background: var(--teal);
}

.progress-row.orange .progress-meter i {
  background: var(--orange);
}

.progress-row.green .progress-meter i {
  background: var(--green);
}

.progress-row.lime .progress-meter i {
  background: var(--lime);
}

.progress-row.yellow .progress-meter i {
  background: var(--yellow);
}

.progress-row.violet .progress-meter i {
  background: var(--violet);
}

.progress-row.rose .progress-meter i {
  background: var(--pink);
}

.progress-row.red .progress-meter i {
  background: var(--red);
}

.progress-row.indigo .progress-meter i {
  background: var(--indigo);
}

.progress-row strong {
  justify-self: end;
  font-family: "Baloo 2", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
}

.tag-cloud,
.tag-library {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-pill,
.library-tag {
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.tag-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-weight: 900;
}

.tag-pill:hover,
.library-tag:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}

.tag-pill b {
  color: var(--muted);
  font-size: 12px;
}

.tag-pill.cyan,
.library-tag.cyan {
  background: #bdeffd;
}

.tag-pill.blue,
.library-tag.blue {
  background: #c7dcff;
}

.tag-pill.teal,
.library-tag.teal {
  background: #b5f5e8;
}

.tag-pill.orange,
.library-tag.orange {
  background: #ffd0a6;
}

.tag-pill.green,
.library-tag.green {
  background: #b7f6c7;
}

.tag-pill.lime,
.library-tag.lime {
  background: #dcf9a8;
}

.tag-pill.yellow,
.library-tag.yellow {
  background: #fff08a;
}

.tag-pill.violet,
.library-tag.violet {
  background: #ddd1ff;
}

.tag-pill.rose,
.library-tag.rose {
  background: #ffc3d8;
}

.tag-pill.red,
.library-tag.red {
  background: #ffb4b4;
}

.tag-pill.indigo,
.library-tag.indigo {
  background: #c9d2ff;
}

.chart-wrap {
  min-height: 154px;
  display: grid;
  align-items: center;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  max-height: 156px;
}

.grid-line {
  stroke: rgba(33, 53, 71, 0.16);
  stroke-width: 2;
}

.area {
  fill: rgba(53, 184, 107, 0.16);
  stroke: none;
}

.line {
  fill: none;
  stroke: var(--green);
  stroke-width: 5;
}

.points {
  fill: #fff;
  stroke: var(--green);
  stroke-width: 4;
}

.stat-lines {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 3px solid var(--line);
}

.stat-lines p,
.member-hours p,
.settings-list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.stat-lines span,
.member-hours span,
.settings-list span {
  color: var(--muted);
}

.section-heading {
  max-width: 860px;
  gap: 10px;
  padding: 8px 0 22px;
}

.wide-panel {
  grid-column: span 8;
}

.side-panel {
  grid-column: span 4;
}

.plan-table {
  display: grid;
  gap: 10px;
}

.plan-row {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 120px 100px 60px;
  align-items: center;
  gap: 12px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 0 14px;
  text-align: left;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.plan-row:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
  background: #f6fcff;
}

.plan-row span {
  color: var(--muted);
  font-weight: 800;
}

.plan-row b {
  justify-self: end;
  font-family: "Baloo 2", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-list div {
  padding-bottom: 11px;
  border-bottom: 3px solid rgba(33, 53, 71, 0.16);
}

.detail-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-list dd {
  margin-top: 4px;
  font-weight: 900;
}

.tag-library {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.library-tag {
  min-height: 96px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 4px 10px;
  padding: 14px;
  text-align: left;
}

.library-tag i {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: #fff;
  grid-row: span 2;
}

.library-tag span {
  color: var(--muted);
  font-weight: 800;
}

.report-panel {
  grid-column: span 4;
  min-height: 270px;
}

.bar-chart {
  height: 184px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  padding-top: 12px;
}

.bar-chart span {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: end;
  height: 100%;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.bar-chart span::before {
  content: "";
  width: 100%;
  height: var(--h);
  background: var(--cyan);
}

.bar-chart b {
  position: absolute;
  bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.radial-stat {
  width: min(190px, 80%);
  aspect-ratio: 1;
  margin: 16px auto 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 57%, transparent 58%),
    conic-gradient(var(--orange) var(--value), #ffe8b3 0);
}

.radial-stat strong {
  font-size: 34px;
}

.radial-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.member-hours,
.settings-list {
  display: grid;
  gap: 16px;
  padding-top: 8px;
}

.member-hours span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.calendar-panel {
  padding: 16px;
}

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

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

.calendar-view-switch {
  display: inline-flex;
  border: 3px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.calendar-view-btn {
  min-height: 40px;
  border: 0;
  padding: 0 14px;
  background: #fff;
  font-weight: 900;
}

.calendar-view-btn.is-active {
  background: var(--cyan);
}

.calendar-view-btn:hover {
  background: #f6fcff;
}

.calendar-pager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.calendar-nav-btn {
  min-height: 40px;
  border: 3px solid var(--line);
  background: #fff;
  padding: 0 14px;
  font-weight: 900;
}

#calendar-period-label {
  min-width: 126px;
  text-align: center;
  font-size: 17px;
  font-weight: 900;
}

.calendar-today-btn {
  min-height: 40px;
  border: 3px solid var(--line);
  background: var(--yellow);
  font-weight: 900;
}

.calendar-grid .calendar-label,
.calendar-grid .calendar-day {
  min-height: 104px;
  display: grid;
  align-content: start;
  justify-items: start;
  border-radius: var(--radius);
  padding: 10px;
}

.calendar-grid .calendar-label {
  min-height: auto;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.calendar-grid .calendar-day {
  position: relative;
  gap: 6px;
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: 3px 3px 0 var(--shadow);
  font-weight: 900;
}

.calendar-grid .calendar-day i {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  font-size: 12px;
  font-style: normal;
}

.calendar-grid .calendar-day.is-today {
  background: #d6f8ff;
}

.calendar-grid .calendar-day.muted-cell {
  color: var(--muted);
  background: #fff3bc;
}

.calendar-grid .calendar-day.has-tasks {
  background: #fffdf5;
}

.calendar-task-list {
  width: 100%;
  display: grid;
  gap: 4px;
  padding-right: 28px;
}

.calendar-task {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  display: -webkit-box;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-task.is-done {
  color: var(--muted);
  text-decoration: line-through;
}

.calendar-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.calendar-grid.is-year {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.calendar-month-cell {
  min-height: 110px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 3px 3px 0 var(--shadow);
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  padding: 12px;
  text-align: left;
  font-weight: 900;
}

.calendar-month-cell b {
  color: var(--ink);
  font-size: 18px;
}

.calendar-month-cell span {
  color: var(--muted);
  font-size: 14px;
}

.calendar-month-cell small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.calendar-month-cell.is-current {
  background: #d6f8ff;
}

.calendar-month-cell.is-selected {
  outline: 3px solid var(--ink);
  outline-offset: -3px;
}

.review-list {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.review-list li {
  display: grid;
  gap: 4px;
  border: 3px solid rgba(33, 53, 71, 0.16);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.review-list span {
  color: var(--muted);
  font-weight: 800;
}

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

.action-list button {
  min-height: 52px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  padding: 0 12px;
  text-align: left;
  font-weight: 900;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.action-list button:hover {
  background: #fff3bc;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}

.sync-box {
  display: grid;
  gap: 10px;
}

.sync-box span,
.sync-box p {
  color: var(--muted);
  font-weight: 800;
}

.sync-box strong {
  font-family: "Baloo 2", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  font-size: 25px;
}

.empty-state {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 3px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
  padding: 16px;
  text-align: center;
  font-weight: 900;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(33, 53, 71, 0.34);
}

.backdrop[hidden] {
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(430px, calc(100vw - 24px));
  height: 100vh;
  overflow-y: auto;
  transform: translateX(104%);
  border-left: 3px solid var(--line);
  background: var(--paper-2);
  box-shadow: -8px 0 0 var(--shadow);
  transition: transform 220ms ease;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 3px solid var(--line);
  background: #bdeffd;
}

.drawer-body {
  display: grid;
  gap: 22px;
  padding: 20px;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.drawer-actions .primary-action,
.drawer-actions .secondary-action {
  width: 100%;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  max-width: min(360px, calc(100vw - 36px));
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: 5px 5px 0 var(--shadow);
  padding: 12px 14px;
  font-weight: 900;
}

.toast[hidden] {
  display: none;
}

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

@media (max-width: 1100px) {
  .app-shell,
  body.sidebar-collapsed .app-shell {
    --sidebar-width: 100%;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-right: 0;
    border-bottom: 3px solid var(--line);
    box-shadow: 0 8px 0 rgba(33, 53, 71, 0.08);
  }

  .sidebar-toggle {
    display: none;
  }

  .topnav {
    grid-column: 1 / -1;
    width: 100%;
    flex-direction: row;
    margin: 0;
    padding: 0 6px 6px 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-button {
    width: auto;
    min-width: 84px;
    justify-content: center;
  }

  body.sidebar-collapsed .brand-block div,
  body.sidebar-collapsed .nav-button span,
  body.sidebar-collapsed .sidebar .primary-action span,
  body.sidebar-collapsed .tool-action span {
    display: block;
  }

  body.sidebar-collapsed #logout-button {
    display: inline-flex;
  }

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

  .top-actions .primary-action,
  .top-actions .text-button {
    grid-column: auto;
    width: auto;
  }

  .timeline-panel,
  .plan-panel,
  .tags-panel,
  .stats-panel,
  .wide-panel,
  .side-panel,
  .report-panel {
    grid-column: 1 / -1;
  }

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

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

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

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 21px;
  }

  .auth-screen {
    padding: 16px;
  }

  .auth-card {
    width: calc(100vw - 32px);
  }

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

  .brand-block {
    justify-content: start;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .top-actions .primary-action,
  .top-actions .text-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .task-tools-panel {
    grid-template-columns: 1fr;
  }

  .task-tools-panel .text-button,
  .task-tools-panel .form-note {
    grid-column: 1 / -1;
    width: 100%;
  }

  .app-main {
    padding: 14px 12px 34px;
  }

  .quest-hero {
    grid-template-columns: 1fr;
  }

  .quest-copy,
  .hero-route {
    min-height: 150px;
  }

  .quest-copy {
    padding: 22px;
  }

  .today-side {
    grid-template-columns: 1fr;
  }

  .member-chip {
    flex: 1 1 138px;
    justify-content: center;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .panel-head {
    align-items: start;
    flex-direction: column;
  }

  .panel-head.tight {
    flex-direction: row;
    align-items: center;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .timeline-row {
    grid-template-columns: 58px 24px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .task-side {
    grid-column: 3;
    justify-items: start;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .form-pair,
  .plan-row {
    grid-template-columns: 1fr;
  }

  .plan-row b {
    justify-self: start;
  }

  .tag-library {
    grid-template-columns: 1fr;
  }

  .bar-chart {
    gap: 7px;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-grid .calendar-label,
  .calendar-grid .calendar-day,
  .calendar-month-cell {
    padding: 7px;
    font-size: 12px;
  }

  .calendar-grid .calendar-label {
    min-height: 40px;
  }

  .calendar-grid .calendar-day {
    min-height: 88px;
  }

  .calendar-month-cell {
    min-height: 82px;
  }

  .calendar-grid .calendar-day i {
    right: 4px;
    bottom: 4px;
    min-width: 20px;
    height: 20px;
  }

  .calendar-toolbar {
    gap: 8px;
  }

  .calendar-view-switch,
  .calendar-pager,
  .calendar-today-btn {
    width: 100%;
    justify-content: space-between;
  }

  #calendar-period-label {
    min-width: auto;
    flex: 1;
    text-align: center;
    font-size: 14px;
  }

  .calendar-grid.is-year {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawer-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-screen {
    justify-items: center;
  }

  .auth-card {
    max-width: 328px;
  }
}
