:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #172326;
  --muted: #647271;
  --line: #dfd8cc;
  --teal: #155e63;
  --teal-soft: #dff0ed;
  --coral: #bd4e3d;
  --coral-soft: #f8ded7;
  --indigo: #454f9a;
  --indigo-soft: #e3e6ff;
  --gold: #a66f16;
  --gold-soft: #f3e2bd;
  --green: #3d7c59;
  --shadow: 0 18px 50px rgba(30, 38, 39, 0.1);
  --radius: 8px;
  --sidebar-width: 280px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(21, 94, 99, 0.1), transparent 32%),
    linear-gradient(315deg, rgba(189, 78, 61, 0.1), transparent 34%),
    var(--bg);
  color: var(--ink);
}

body:not(.is-authenticated) .app-shell {
  display: none;
}

body.is-authenticated .auth-view {
  display: none;
}

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

button {
  cursor: pointer;
}

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

.auth-panel {
  display: grid;
  gap: 26px;
  width: min(100%, 420px);
}

.auth-brand {
  width: fit-content;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(31, 42, 43, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.auth-form h1 {
  margin-bottom: 0;
  font-size: 30px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid rgba(31, 42, 43, 0.1);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(21, 94, 99, 0.18);
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.nav-tab,
.segment,
.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.file-picker {
  border: 0;
  border-radius: var(--radius);
}

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

.nav-tab:hover,
.nav-tab.is-active {
  background: var(--teal-soft);
  color: var(--teal);
}

.quick-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
}

.compact-metrics {
  display: grid;
  gap: 10px;
  margin: 0;
}

.compact-metrics div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.compact-metrics dt {
  color: var(--muted);
  font-size: 13px;
}

.compact-metrics dd {
  margin: 0;
  font-weight: 800;
}

.main-content {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

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

.date-line {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  max-width: 180px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid rgba(31, 42, 43, 0.08);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--surface-strong);
  color: var(--teal);
  box-shadow: var(--shadow);
}

.icon-button:hover {
  background: var(--teal);
  color: #fff;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(31, 42, 43, 0.08);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

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

.metric-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
}

.metric-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
}

.accent-teal .metric-icon {
  background: var(--teal-soft);
  color: var(--teal);
}

.accent-coral .metric-icon {
  background: var(--coral-soft);
  color: var(--coral);
}

.accent-indigo .metric-icon {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.accent-gold .metric-icon {
  background: var(--gold-soft);
  color: var(--gold);
}

.workspace-grid,
.analytics-layout,
.journal-layout,
.data-layout {
  display: grid;
  gap: 18px;
}

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

.analytics-layout,
.calendar-layout,
.journal-layout,
.data-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-area,
.create-panel,
.analytics-panel,
.calendar-panel,
.calendar-agenda-panel,
.progress-editor,
.progress-history,
.data-panel {
  border: 1px solid rgba(31, 42, 43, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.task-area,
.analytics-panel,
.calendar-panel,
.calendar-agenda-panel,
.progress-editor,
.progress-history,
.data-panel {
  padding: 20px;
}

.create-panel {
  padding: 18px;
}

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

.section-heading.compact {
  align-items: flex-start;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(68px, 1fr));
  min-width: 152px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f0ebe2;
}

.segment {
  min-height: 34px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.segment.is-active {
  background: var(--surface-strong);
  color: var(--teal);
  box-shadow: 0 8px 18px rgba(31, 42, 43, 0.08);
}

.task-list,
.ranking-list,
.timeline {
  display: grid;
  gap: 12px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.task-card.is-active {
  border-color: rgba(21, 94, 99, 0.42);
  background: linear-gradient(180deg, #ffffff, #f4fbf9);
}

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

.task-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.task-title-row h3 {
  min-width: 0;
}

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

.badge.is-muted {
  background: #ece6dc;
  color: var(--muted);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.task-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.task-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 92px;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
}

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

.complete-button {
  background: var(--coral);
  color: #fff;
}

.pause-button {
  background: var(--gold);
  color: #fff;
}

.delete-button {
  min-width: 40px;
  width: 40px;
  padding: 0;
  background: #f3eee7;
  color: var(--muted);
}

.delete-button:hover {
  background: var(--coral-soft);
  color: var(--coral);
}

.edit-button {
  min-width: 40px;
  width: 40px;
  padding: 0;
  background: var(--indigo-soft);
  color: var(--indigo);
}

.edit-button:hover {
  background: var(--indigo);
  color: #fff;
}

.task-form,
.progress-form,
.server-form {
  display: grid;
  gap: 16px;
}

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

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

label > span,
legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 188px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(21, 94, 99, 0.14);
}

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

.repeat-grid label {
  position: relative;
  display: block;
}

.repeat-grid input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.repeat-grid span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--muted);
  font-weight: 750;
}

.repeat-grid input:checked + span {
  border-color: rgba(21, 94, 99, 0.25);
  background: var(--teal-soft);
  color: var(--teal);
}

.schedule-box {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf7ef;
}

.schedule-panel {
  display: none;
}

.schedule-panel.is-visible {
  display: grid;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.choice-grid label {
  position: relative;
  display: inline-flex;
}

.choice-grid input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.choice-grid input:checked + span {
  border-color: rgba(21, 94, 99, 0.28);
  background: var(--teal-soft);
  color: var(--teal);
}

.monthday-grid span {
  min-width: 34px;
}

.yearly-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.input-with-unit:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(21, 94, 99, 0.14);
}

.input-with-unit input {
  border: 0;
  box-shadow: none;
}

.input-with-unit span {
  padding-right: 12px;
  color: var(--muted);
  font-size: 13px;
}

.primary-button,
.secondary-button,
.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 850;
}

.compact-button {
  min-height: 42px;
  padding: 9px 12px;
}

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

.secondary-button,
.file-picker {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--teal);
}

.primary-button:hover,
.start-button:hover {
  background: #0f4e53;
}

.complete-button:hover {
  background: #a94234;
}

.badge.is-complete,
.status-pill.is-complete {
  background: #dff0e7;
  color: var(--green);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: #ece6dc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.pause-button:hover {
  background: #8f5f12;
}

.secondary-button:hover,
.file-picker:hover {
  background: var(--teal-soft);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.68);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 17px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-title .icon {
  color: var(--teal);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 260px;
}

.bar-item {
  display: grid;
  align-items: end;
  gap: 8px;
  height: 100%;
  min-width: 0;
}

.bar-track {
  position: relative;
  height: 210px;
  border-radius: var(--radius);
  background: #eee8df;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 4px;
  background: linear-gradient(180deg, var(--teal), var(--green));
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.bar-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.ranking-item,
.timeline-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.ranking-topline,
.timeline-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ranking-topline strong,
.timeline-topline strong {
  min-width: 0;
}

.ranking-meta,
.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.calendar-layout {
  align-items: start;
}

.calendar-panel {
  min-width: 0;
}

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

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

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 104px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  text-align: left;
}

.calendar-day.is-outside {
  opacity: 0.45;
}

.calendar-day.is-today {
  border-color: rgba(21, 94, 99, 0.45);
  box-shadow: inset 0 0 0 2px rgba(21, 94, 99, 0.1);
}

.calendar-day.is-selected {
  border-color: var(--teal);
  background: #f4fbf9;
}

.calendar-date {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.calendar-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.calendar-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
}

.calendar-dot.is-complete {
  background: var(--green);
}

.calendar-tasks {
  display: grid;
  gap: 4px;
}

.calendar-task {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-task.is-complete {
  color: var(--green);
}

.calendar-agenda {
  display: grid;
  gap: 10px;
}

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

.agenda-summary-item {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 850;
}

.agenda-summary-item strong {
  font-size: 18px;
}

.agenda-summary-item.is-pending {
  background: var(--coral-soft);
  color: var(--coral);
}

.agenda-summary-item.is-complete {
  background: #dff0e7;
  color: var(--green);
}

.agenda-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.agenda-item.is-pending {
  border-color: rgba(202, 85, 68, 0.26);
}

.agenda-item.is-complete {
  border-color: rgba(42, 119, 89, 0.22);
}

.agenda-item strong {
  overflow-wrap: anywhere;
}

.agenda-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.session-details {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.session-detail {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(31, 42, 43, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.session-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-detail-head strong {
  color: var(--ink);
  font-size: 13px;
}

.session-detail-head .estimate-status {
  margin-top: 0;
}

.session-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.session-metrics div {
  min-width: 0;
}

.session-metrics dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.session-metrics dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.session-pause-details {
  display: grid;
  gap: 6px;
}

.session-pause-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: var(--radius);
  background: #f4eee4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.session-pause-row strong {
  color: var(--ink);
  text-align: right;
}

.session-pauses-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.progress-bar {
  height: 7px;
  margin-top: 10px;
  border-radius: 999px;
  background: #eee8df;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  max-width: 100%;
  background: var(--coral);
}

.progress-bar.segmented-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  height: 8px;
  background: transparent;
  overflow: visible;
}

.segmented-progress .progress-segment {
  display: block;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8df;
}

.segmented-progress .progress-segment > span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
}

.segmented-progress .progress-segment.is-blue > span {
  background: #3278c6;
}

.segmented-progress .progress-segment.is-yellow > span {
  background: #d8a928;
}

.segmented-progress .progress-segment.is-orange > span {
  background: #df7a2e;
}

.segmented-progress .progress-segment.is-red > span {
  background: #c84a3f;
}

.pause-now {
  margin: 10px 0 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.estimate-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 850;
}

.estimate-status.is-under {
  background: #dff0e7;
  color: var(--green);
}

.estimate-status.is-on-time {
  background: var(--gold-soft);
  color: var(--gold);
}

.estimate-status.is-over {
  background: var(--coral-soft);
  color: var(--coral);
}

.pause-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pause-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.panel-copy {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.account-form {
  display: grid;
  gap: 14px;
}

.avatar-editor {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.avatar-preview,
.user-avatar {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
  background-position: center;
  background-size: cover;
}

.avatar-preview {
  width: 72px;
  height: 72px;
  font-size: 28px;
  box-shadow: 0 12px 28px rgba(21, 94, 99, 0.16);
}

.user-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  font-size: 12px;
}

.compact-picker {
  min-height: 40px;
  margin: 0;
}

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

.file-picker {
  width: 100%;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #172326;
  color: #fff;
  box-shadow: 0 16px 42px rgba(23, 35, 38, 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    z-index: 5;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    height: auto;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid rgba(31, 42, 43, 0.1);
  }

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

  .quick-panel {
    display: none;
  }

  .main-content {
    padding: 22px 18px 28px;
  }

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

@media (max-width: 860px) {
  .metric-grid,
  .analytics-layout,
  .calendar-layout,
  .journal-layout,
  .data-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sidebar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .brand small {
    display: none;
  }

  .nav-tabs {
    gap: 6px;
  }

  .nav-tab {
    justify-content: center;
    min-height: 42px;
    padding: 8px;
  }

  .nav-tab span:last-child {
    font-size: 13px;
  }

  .topbar {
    align-items: center;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 20px;
  }

  .metric-grid,
  .analytics-layout,
  .calendar-layout,
  .journal-layout,
  .data-layout {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 92px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
  }

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

  .task-actions {
    width: 100%;
  }

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

  .session-pause-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .session-pause-row strong {
    grid-column: 2;
    text-align: left;
  }

  .avatar-editor {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .avatar-editor .compact-button {
    grid-column: 2;
    width: fit-content;
  }

  .action-button {
    flex: 1;
  }

  .delete-button,
  .edit-button {
    flex: 0 0 42px;
  }

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

  .bar-chart {
    gap: 7px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    min-height: 82px;
    padding: 7px;
  }

  .calendar-task:nth-child(n + 3) {
    display: none;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}
