:root {
  color-scheme: light;
  --canvas: #f3f5f1;
  --surface: #ffffff;
  --surface-muted: #f7f8f5;
  --ink: #17221f;
  --ink-soft: #53615c;
  --ink-faint: #7b8782;
  --line: #dce2dc;
  --line-strong: #cbd4ce;
  --brand: #246b5a;
  --brand-dark: #195044;
  --brand-soft: #e1efe9;
  --blue: #4968a8;
  --blue-soft: #e7ecf7;
  --orange: #b76a35;
  --orange-soft: #f8ebe1;
  --rose: #a94f64;
  --rose-soft: #f8e7eb;
  --warning: #b55a35;
  --warning-soft: #fff0e8;
  --danger: #b53f3f;
  --good: #28745f;
  --good-soft: #def0e9;
  --shadow-sm: 0 1px 2px rgba(25, 42, 36, 0.05);
  --shadow-md: 0 14px 38px rgba(28, 46, 39, 0.11);
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 14px;
  font-family:
    "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  border: 0;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(36, 107, 90, 0.22);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

.icon {
  display: block;
  flex: 0 0 auto;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
  background: #f8f9f6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 28px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 5px 14px rgba(36, 107, 90, 0.2);
}

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

.brand strong {
  font-size: 16px;
  line-height: 1.25;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    background 140ms ease,
    color 140ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: #eef1ed;
}

.nav-item.is-active {
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 650;
}

.nav-badge {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  text-align: center;
}

.nav-badge.is-alert {
  color: #9d482b;
  background: #f9ded3;
}

.sidebar-focus {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  display: block;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-focus strong {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  line-height: 1.1;
}

.sidebar-focus > span:last-of-type {
  color: var(--ink-soft);
  font-size: 12px;
}

.mini-progress {
  height: 5px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ede8;
}

.mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 4px 0;
}

.device-identity,
.device-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.device-identity > span:last-child,
.device-panel-head > div {
  min-width: 0;
}

.device-identity strong,
.device-identity small,
.device-panel-head strong,
.device-panel-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-identity strong,
.device-panel-head strong {
  font-size: 12px;
}

.device-identity small,
.device-panel-head small {
  color: var(--ink-faint);
  font-size: 10px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 13px;
  font-weight: 750;
}

.workspace {
  min-width: 0;
  padding: 0 28px 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 116px;
  padding: 22px 0 20px;
}

.topbar-title h1 {
  margin-top: 2px;
  font-size: 28px;
  line-height: 1.2;
}

.topbar-title p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.topbar-actions,
.cloud-actions,
.week-controls,
.modal-actions > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.primary-button,
.secondary-button,
.small-button,
.text-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.primary-button {
  min-height: 40px;
  padding: 0 15px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 3px 10px rgba(36, 107, 90, 0.15);
  font-weight: 650;
}

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

.primary-button:active,
.secondary-button:active,
.small-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.secondary-button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--surface);
  font-weight: 600;
}

.secondary-button:hover {
  border-color: #aebbb4;
  color: var(--ink);
  background: #fbfcfa;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 620;
}

.small-button:hover {
  color: var(--brand-dark);
  border-color: #9fb8ae;
}

.text-button {
  min-height: 34px;
  padding: 0 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 620;
}

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

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  color: var(--ink-soft);
  background: transparent;
}

.icon-button:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.icon-button.compact {
  width: 32px;
  height: 32px;
}

.wide {
  width: 100%;
}

.danger-text {
  color: var(--danger);
}

.danger-text:hover {
  color: #8c2929;
  background: #fcecec;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 650;
}

.status-chip.is-good {
  color: var(--good);
  border-color: #c4ded4;
  background: var(--good-soft);
}

.status-chip.is-warning {
  color: #9d482b;
  border-color: #f0c8b7;
  background: var(--warning-soft);
}

.status-chip.is-neutral {
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.view-stage {
  min-width: 0;
}

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

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

.summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 156px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.summary-item small,
.summary-item strong {
  display: block;
}

.summary-item small {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
}

.summary-item strong {
  margin-top: 1px;
  font-size: 16px;
}

.summary-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
}

.summary-icon.is-green {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.summary-icon.is-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.summary-icon.is-orange {
  color: var(--orange);
  background: var(--orange-soft);
}

.conflict-panel {
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid #edc5b4;
  border-radius: var(--radius-lg);
  background: #fffaf7;
}

.conflict-panel.is-clear {
  display: flex;
  align-items: center;
  gap: 11px;
  border-color: #ccdfd7;
  background: #f7fbf9;
}

.conflict-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.conflict-panel-head strong,
.conflict-panel.is-clear strong {
  display: block;
  font-size: 14px;
}

.conflict-panel-head p,
.conflict-panel.is-clear p {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
}

.conflict-lead-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: #9d482b;
  background: #f9ded3;
}

.is-clear .conflict-lead-icon {
  color: var(--good);
  background: var(--good-soft);
}

.conflict-list {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.conflict-item {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #f0d7cc;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.8);
}

.conflict-time {
  color: #9d482b;
  font-size: 12px;
  font-weight: 750;
}

.conflict-copy {
  min-width: 0;
}

.conflict-copy strong,
.conflict-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conflict-copy strong {
  font-size: 13px;
}

.conflict-copy span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 11px;
}

.conflict-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.calendar-header,
.calendar-body {
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(132px, 1fr));
  min-width: 1030px;
}

.calendar-header {
  position: sticky;
  top: 0;
  z-index: 15;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.calendar-corner {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
}

.day-heading {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  justify-content: center;
  column-gap: 8px;
  min-height: 72px;
  padding: 11px 8px 10px;
  border-left: 1px solid var(--line);
}

.day-heading > span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 650;
}

.day-heading > strong {
  font-size: 19px;
  line-height: 1;
}

.day-heading > small {
  grid-column: 1 / -1;
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 10px;
  text-align: center;
}

.day-heading.is-today {
  color: #fff;
  background: var(--brand);
}

.day-heading.is-today > span,
.day-heading.is-today > small {
  color: rgba(255, 255, 255, 0.76);
}

.calendar-body {
  position: relative;
  background: #fbfcfa;
}

.time-axis,
.day-track {
  position: relative;
  height: 100%;
}

.time-axis span {
  position: absolute;
  right: 9px;
  color: var(--ink-faint);
  font-size: 10px;
  transform: translateY(-50%);
}

.time-axis span:first-child {
  transform: translateY(0);
}

.day-track {
  border-left: 1px solid var(--line);
}

.day-track.is-today {
  background: rgba(225, 239, 233, 0.24);
}

.hour-line {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: #e7ebe7;
}

.now-line {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 4;
  height: 2px;
  background: #cf5f45;
}

.now-line::before {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cf5f45;
  content: "";
}

.calendar-task {
  --task-color: var(--brand);
  --task-soft: var(--brand-soft);
  position: absolute;
  z-index: 5;
  overflow: hidden;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--task-color) 28%, white);
  border-left: 3px solid var(--task-color);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--task-soft);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23, 34, 31, 0.04);
  transition:
    box-shadow 140ms ease,
    transform 140ms ease,
    opacity 140ms ease;
}

.calendar-task:hover {
  z-index: 8;
  box-shadow: 0 8px 20px rgba(23, 34, 31, 0.13);
  transform: translateY(-1px);
}

.calendar-task.is-conflict {
  border-color: #d77a54;
  border-left-color: #b94c2a;
  background: #fff0e8;
}

.calendar-task.is-completed {
  opacity: 0.58;
}

.calendar-task.is-completed strong {
  text-decoration: line-through;
}

.calendar-task-main {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.calendar-task-copy {
  min-width: 0;
}

.calendar-task-copy strong,
.calendar-task-copy span,
.calendar-task-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-task-copy strong {
  font-size: 12px;
  line-height: 1.32;
}

.calendar-task-copy span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.calendar-task-copy small {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 9px;
}

.calendar-task.is-compact {
  padding: 5px 7px;
}

.calendar-task.is-compact .calendar-task-copy strong {
  padding-top: 1px;
}

.task-check {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  border: 1.5px solid color-mix(in srgb, var(--task-color, var(--brand)) 45%, white);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.task-check.is-checked {
  border-color: var(--task-color, var(--brand));
  background: var(--task-color, var(--brand));
}

.task-priority {
  position: absolute;
  right: 7px;
  bottom: 5px;
  padding: 1px 5px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  font-weight: 700;
}

.color-teal {
  --task-color: #2c7665;
  --task-soft: #e5f1ec;
}

.color-blue {
  --task-color: #506ca8;
  --task-soft: #e9eef8;
}

.color-orange {
  --task-color: #b76a35;
  --task-soft: #faece1;
}

.color-rose {
  --task-color: #a7596b;
  --task-soft: #f8e9ed;
}

.mobile-agenda {
  display: none;
}

.goals-summary .summary-item {
  min-width: 150px;
}

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

.goal-card {
  --goal-color: var(--brand);
  --goal-soft: var(--brand-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 352px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--goal-color);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

.goal-card:hover {
  box-shadow: 0 14px 32px rgba(23, 34, 31, 0.1);
  transform: translateY(-2px);
}

.goal-teal {
  --goal-color: #2c7665;
  --goal-soft: #e5f1ec;
}

.goal-blue {
  --goal-color: #506ca8;
  --goal-soft: #e9eef8;
}

.goal-orange {
  --goal-color: #b76a35;
  --goal-soft: #faece1;
}

.goal-rose {
  --goal-color: #a7596b;
  --goal-soft: #f8e9ed;
}

.goal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.goal-index {
  color: var(--goal-color);
  font-size: 11px;
  font-weight: 800;
}

.goal-due {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 650;
}

.goal-due.is-overdue {
  color: var(--danger);
  background: #fcecec;
}

.goal-card-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
}

.goal-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  color: var(--goal-color, var(--brand));
  background: var(--goal-soft, var(--brand-soft));
}

.goal-card-title h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.goal-card-title p {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.goal-progress-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 18px;
}

.progress-ring {
  --progress: 0deg;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--goal-color, var(--brand)) var(--progress),
    #edf0ec 0
  );
}

.progress-ring::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.progress-ring span {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 800;
}

.progress-ring.large {
  width: 92px;
  height: 92px;
}

.progress-ring.large span {
  font-size: 19px;
}

.goal-stats {
  display: grid;
  flex: 1;
  gap: 7px;
  min-width: 0;
}

.goal-stats > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.goal-stats small {
  color: var(--ink-faint);
  font-size: 10px;
}

.goal-stats strong {
  font-size: 11px;
  text-align: right;
}

.milestone-preview {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.milestone-preview > div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.milestone-preview > div > span {
  display: grid;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.milestone-preview .is-done > span {
  color: #fff;
  border-color: var(--goal-color);
  background: var(--goal-color);
}

.milestone-preview p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.milestone-preview .is-done p {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.milestone-empty {
  color: var(--ink-faint);
  font-size: 11px;
}

.card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 35px;
  margin-top: auto;
  padding: 0 2px;
  color: var(--goal-color);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.groups-view-head {
  align-items: center;
}

.group-error {
  margin-bottom: 14px;
}

.group-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.group-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.group-tabs button.is-active {
  color: var(--brand-dark);
  border-color: #9fc2b5;
  background: var(--brand-soft);
}

.group-tabs i {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #bd5a38;
  font-size: 9px;
  font-style: normal;
}

.group-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.group-panel,
.nudge-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.group-panel {
  padding: 18px;
}

.group-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.group-panel-head h2 {
  margin-top: 3px;
  font-size: 21px;
}

.group-panel-head p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 11px;
}

.invite-code {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0 8px;
  min-width: 152px;
  padding: 9px 11px;
  border: 1px dashed #9eb9af;
  border-radius: var(--radius-md);
  color: var(--brand-dark);
  background: #f2f8f5;
  cursor: pointer;
  text-align: left;
}

.invite-code small {
  grid-column: 1;
  color: var(--ink-faint);
  font-size: 9px;
}

.invite-code strong {
  grid-column: 1;
  font-size: 16px;
  letter-spacing: 0;
}

.invite-code .icon {
  grid-column: 2;
  grid-row: 1 / 3;
}

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

.member-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fcfdfb;
}

.member-card.is-self {
  border-color: #b9d4ca;
  background: #f7fbf9;
}

.member-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.member-card-head > div {
  min-width: 0;
}

.member-card-head strong,
.member-card-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card-head strong {
  font-size: 12px;
}

.member-card-head small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.owner-tag {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 9px;
  font-weight: 700;
}

.member-progress {
  align-self: center;
}

.member-progress-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.member-progress-copy span {
  color: var(--ink-faint);
  font-size: 10px;
}

.member-progress-copy strong {
  font-size: 21px;
  line-height: 1;
}

.member-progress-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece8;
}

.member-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.member-progress > small {
  display: block;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 9px;
}

.member-card > .small-button,
.self-status {
  align-self: end;
}

.member-card > .small-button {
  width: 100%;
}

.self-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 11px;
  font-weight: 650;
}

.group-side {
  min-width: 0;
}

.nudge-panel {
  padding: 18px;
}

.nudge-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.nudge-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid #efd0c3;
  border-radius: var(--radius-md);
  background: #fff9f6;
}

.nudge-item.is-read {
  border-color: var(--line);
  background: var(--surface-muted);
  opacity: 0.72;
}

.nudge-item > div {
  min-width: 0;
}

.nudge-item strong,
.nudge-item p {
  display: block;
}

.nudge-item strong {
  font-size: 11px;
}

.nudge-item p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.nudge-item time {
  color: var(--ink-faint);
  font-size: 9px;
  white-space: nowrap;
}

.group-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.group-tools > article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.section-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
}

.section-icon.is-green {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.section-icon.is-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.group-tools h3 {
  font-size: 13px;
}

.group-tools p {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.group-tools form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 4px;
}

.group-tools input {
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: 0;
}

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

.cloud-main {
  display: grid;
  align-content: start;
  gap: 16px;
}

.cloud-status-panel,
.cloud-log-panel,
.settings-panel,
.device-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.cloud-status-panel {
  padding: 22px;
}

.cloud-status-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.cloud-brand-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 13px;
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.cloud-brand-icon.is-online {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.cloud-status-head h2 {
  margin-top: 3px;
  font-size: 21px;
}

.cloud-status-head p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.sync-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sync-metrics > div {
  min-width: 0;
  padding: 16px 14px;
  border-right: 1px solid var(--line);
}

.sync-metrics > div:last-child {
  border-right: 0;
}

.sync-metrics small,
.sync-metrics strong {
  display: block;
}

.sync-metrics small {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
}

.sync-metrics strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

.cloud-log-panel,
.settings-panel,
.device-panel {
  padding: 18px;
}

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

.section-heading h2,
.section-heading h3 {
  margin-top: 2px;
  font-size: 16px;
}

.section-heading > span {
  color: var(--ink-faint);
  font-size: 11px;
}

.sync-log {
  display: grid;
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.sync-log-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 12px;
  background: var(--surface);
}

.sync-log-item + .sync-log-item {
  border-top: 1px solid var(--line);
}

.log-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa59f;
}

.log-good {
  background: var(--good);
}

.log-warning {
  background: #c2603c;
}

.sync-log-item strong,
.sync-log-item p {
  display: block;
}

.sync-log-item strong {
  font-size: 12px;
}

.sync-log-item p {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.sync-log-item time {
  color: var(--ink-faint);
  font-size: 10px;
  white-space: nowrap;
}

.cloud-settings {
  display: grid;
  align-content: start;
  gap: 14px;
}

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

.account-main {
  display: grid;
  align-content: start;
  gap: 16px;
}

.account-welcome,
.account-auth-panel,
.local-data-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-welcome {
  min-height: 390px;
  padding: 34px;
}

.account-welcome-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 28px;
  place-items: center;
  border-radius: 14px;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.account-welcome h2 {
  max-width: 580px;
  margin-top: 5px;
  font-size: 30px;
  line-height: 1.22;
}

.account-welcome > p {
  max-width: 650px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.account-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}

.account-benefits > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--brand-dark);
  background: var(--surface-muted);
}

.account-benefits > div > span {
  min-width: 0;
}

.account-benefits strong,
.account-benefits small {
  display: block;
}

.account-benefits strong {
  color: var(--ink);
  font-size: 12px;
}

.account-benefits small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.local-data-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.local-data-strip > span {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-soft);
}

.local-data-strip strong,
.local-data-strip small {
  display: block;
}

.local-data-strip strong {
  font-size: 13px;
}

.local-data-strip small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.account-auth-panel {
  align-self: start;
  padding: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.auth-tabs button {
  min-height: 36px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.auth-tabs button.is-active {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.account-note {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.6;
}

.account-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
}

.account-summary > div {
  min-width: 0;
}

.account-summary strong,
.account-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary strong {
  font-size: 13px;
}

.account-summary small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.avatar.large {
  width: 42px;
  height: 42px;
}

.account-setting-list {
  display: grid;
  gap: 1px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.account-setting-list > * {
  min-height: 45px;
  padding: 10px 12px;
  background: var(--surface);
}

.account-setting-list > * + * {
  border-top: 1px solid var(--line);
}

.account-setting-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-setting-list > div > span {
  color: var(--ink-faint);
  font-size: 11px;
}

.account-setting-list > div > strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: var(--brand-dark) !important;
  background: var(--brand-soft);
}

.settings-panel form {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span,
.field legend {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: #fcfdfb;
  font-size: 13px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #b7c1bb;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(36, 107, 90, 0.1);
}

.field small {
  color: var(--ink-faint);
  font-size: 10px;
}

.advanced-fields {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.advanced-fields summary {
  padding: 10px 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.advanced-fields[open] summary {
  margin-bottom: 7px;
}

.advanced-fields .field + .field {
  margin-top: 11px;
}

.advanced-fields .field:last-child {
  margin-bottom: 12px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
}

.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.device-panel dl {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.device-panel dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.device-panel dt {
  color: var(--ink-faint);
  font-size: 11px;
}

.device-panel dd {
  max-width: 190px;
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  justify-items: center;
  min-height: 300px;
  padding: 48px 24px;
  place-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.empty-state .icon {
  margin-bottom: 13px;
  color: var(--brand);
}

.empty-state strong {
  font-size: 16px;
}

.empty-state span {
  margin: 6px 0 18px;
  font-size: 12px;
}

.compact-empty {
  min-height: 132px;
  padding: 24px;
}

.compact-empty .icon {
  margin-bottom: 8px;
}

.modal-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 28px 18px;
  place-items: center;
  background: rgba(18, 29, 26, 0.45);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(17, 28, 24, 0.24);
  animation: modal-in 160ms ease-out both;
}

.modal.modal-wide {
  width: min(760px, 100%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-top: 2px;
  font-size: 20px;
}

.modal-body {
  max-height: calc(100vh - 152px);
  padding: 20px;
  overflow-y: auto;
}

.modal-form {
  display: grid;
  gap: 18px;
}

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

.span-2 {
  grid-column: span 2;
}

.time-field > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.time-field i {
  color: var(--ink-faint);
  font-size: 11px;
  font-style: normal;
}

.input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fcfdfb;
}

.input-suffix input {
  border: 0;
  background: transparent;
}

.input-suffix > span {
  padding: 0 12px;
  color: var(--ink-faint);
  font-size: 11px;
}

.color-field {
  padding: 0;
  border: 0;
}

.color-field legend {
  margin-bottom: 7px;
}

.color-field > div {
  display: flex;
  gap: 9px;
}

.color-option {
  display: grid;
  grid-template-columns: 24px auto;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.color-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.color-option > span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--goal-color);
}

.color-option small {
  font-size: 11px;
}

.color-option:has(input:checked) {
  border-color: var(--goal-color);
  box-shadow: inset 0 0 0 1px var(--goal-color);
}

.form-alert {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface-muted);
  font-size: 11px;
}

.form-alert:empty {
  display: none;
}

.form-alert > .icon {
  display: inline-block;
  margin-right: 5px;
  vertical-align: -3px;
}

.form-alert.is-clear {
  color: var(--good);
  border-color: #c5ded5;
  background: #f1f9f6;
}

.form-alert.is-warning {
  color: #9d482b;
  border-color: #efc5b3;
  background: var(--warning-soft);
}

.form-alert.is-error {
  color: var(--danger);
  border-color: #edc0c0;
  background: #fcecec;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.goal-detail {
  display: grid;
  gap: 18px;
}

.goal-detail-hero {
  --goal-color: var(--brand);
  --goal-soft: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--goal-soft);
}

.goal-detail-hero h3 {
  margin-top: 12px;
  font-size: 20px;
}

.goal-detail-hero p {
  max-width: 520px;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.goal-detail-hero .progress-ring::before {
  background: var(--goal-soft);
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.detail-metrics > div {
  padding: 13px;
  border-right: 1px solid var(--line);
}

.detail-metrics > div:last-child {
  border-right: 0;
}

.detail-metrics small,
.detail-metrics strong {
  display: block;
}

.detail-metrics small {
  color: var(--ink-faint);
  font-size: 10px;
}

.detail-metrics strong {
  margin-top: 3px;
  font-size: 14px;
}

.detail-section {
  display: grid;
  gap: 11px;
}

.milestone-list,
.goal-task-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.milestone-row,
.goal-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.milestone-row + .milestone-row,
.goal-task-row + .goal-task-row {
  border-top: 1px solid var(--line);
}

.milestone-row:hover,
.goal-task-row:hover {
  background: var(--surface-muted);
}

.milestone-row > span {
  display: grid;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #fff;
}

.milestone-row.is-done > span {
  border-color: var(--brand);
  background: var(--brand);
}

.milestone-row.is-done strong {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.milestone-row strong {
  font-size: 12px;
}

.goal-task-row > span:nth-child(2) {
  min-width: 0;
}

.goal-task-row strong,
.goal-task-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-task-row strong {
  font-size: 12px;
}

.goal-task-row small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.goal-task-row .task-check {
  --task-color: var(--brand);
}

.goal-task-row.is-done strong {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.priority-dot {
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: #9aa59f;
}

.priority-high {
  background: #c24c35;
}

.priority-medium {
  background: #bd7a37;
}

.priority-low {
  background: #64867b;
}

.detail-empty {
  padding: 15px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-faint);
  font-size: 11px;
}

.sync-conflict-copy > p {
  color: var(--ink-soft);
  font-size: 13px;
}

.version-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.version-compare article {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.version-compare strong,
.version-compare small {
  display: block;
}

.version-compare strong {
  margin-top: 7px;
  font-size: 14px;
}

.version-compare small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.conflict-resolution-actions {
  margin-top: 18px;
}

#toast-root {
  position: fixed;
  z-index: 500;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: #fff;
  background: #20312c;
  box-shadow: 0 12px 32px rgba(17, 28, 24, 0.22);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  font-size: 12px;
}

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

.toast-warning {
  background: #8f462d;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1220px) {
  .goal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cloud-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

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

  .workspace {
    padding-right: 20px;
    padding-left: 20px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

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

  .cloud-layout,
  .account-layout,
  .group-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 0 16px 100px;
  }

  .topbar {
    min-height: 102px;
  }

  .topbar-title h1 {
    font-size: 24px;
  }

  .topbar-actions .status-chip {
    display: none;
  }

  .calendar-shell {
    display: none;
  }

  .mobile-agenda {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }

  .mobile-day-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    background: var(--surface-muted);
  }

  .mobile-day-tabs button {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 2px;
    min-height: 72px;
    padding: 8px 2px;
    color: var(--ink-soft);
    background: transparent;
    cursor: pointer;
  }

  .mobile-day-tabs button + button {
    border-left: 1px solid var(--line);
  }

  .mobile-day-tabs button.is-active {
    color: #fff;
    background: var(--brand);
  }

  .mobile-day-tabs button > span {
    font-size: 10px;
  }

  .mobile-day-tabs button > strong {
    font-size: 16px;
  }

  .mobile-day-tabs button > i {
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.75);
    font-size: 9px;
    font-style: normal;
    line-height: 16px;
  }

  .mobile-day-tabs button.is-active > i {
    color: var(--brand-dark);
    background: #fff;
  }

  .mobile-task-list {
    display: grid;
  }

  .mobile-task {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 70px;
    padding: 12px 14px;
    cursor: pointer;
  }

  .mobile-task + .mobile-task {
    border-top: 1px solid var(--line);
  }

  .mobile-task.is-conflict {
    background: #fff8f4;
  }

  .mobile-task.is-completed {
    opacity: 0.58;
  }

  .mobile-task.is-completed strong {
    text-decoration: line-through;
  }

  .mobile-task > div {
    min-width: 0;
  }

  .mobile-task strong,
  .mobile-task span {
    display: block;
  }

  .mobile-task strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-task > div > span {
    margin-top: 4px;
    color: var(--ink-faint);
    font-size: 10px;
  }

  .mobile-task .task-check {
    --task-color: var(--brand);
  }

  .mobile-nav {
    position: fixed;
    z-index: 80;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    min-height: 66px;
    padding: 6px;
    border: 1px solid rgba(220, 226, 220, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 44px rgba(23, 34, 31, 0.18);
    backdrop-filter: blur(12px);
  }

  .mobile-nav button {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 2px;
    min-height: 50px;
    padding: 4px;
    border-radius: 11px;
    color: var(--ink-faint);
    background: transparent;
    cursor: pointer;
    font-size: 9px;
  }

  .mobile-nav button.is-active {
    color: var(--brand-dark);
    background: var(--brand-soft);
  }

  .mobile-nav .mobile-add {
    width: 48px;
    height: 48px;
    min-height: 48px;
    margin: -22px auto 0;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 7px 18px rgba(36, 107, 90, 0.27);
  }

  .mobile-nav i {
    position: absolute;
    top: 2px;
    right: calc(50% - 22px);
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #b55332;
    font-size: 9px;
    font-style: normal;
  }

  #toast-root {
    right: 16px;
    bottom: 90px;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 12px;
    padding: 18px 0 15px;
  }

  .topbar-title .eyebrow,
  .topbar-title p {
    display: none;
  }

  .topbar-title h1 {
    margin: 0;
    font-size: 22px;
  }

  .topbar-actions .cloud-chip {
    width: 40px;
    padding: 0;
  }

  .topbar-actions .cloud-chip span {
    display: none;
  }

  .topbar-actions .primary-button {
    width: 40px;
    padding: 0;
  }

  .topbar-actions .primary-button span {
    display: none;
  }

  .view-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .summary-item,
  .goals-summary .summary-item {
    display: grid;
    justify-items: start;
    gap: 6px;
    min-width: 0;
    padding: 9px;
  }

  .summary-icon {
    width: 30px;
    height: 30px;
  }

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

  .week-controls {
    align-self: flex-end;
  }

  .conflict-panel {
    padding: 13px;
  }

  .conflict-item {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .conflict-actions {
    justify-content: flex-start;
  }

  .conflict-list .conflict-item:nth-child(n + 3) {
    display: none;
  }

  .goal-card {
    min-height: 330px;
  }

  .cloud-status-panel {
    padding: 17px;
  }

  .account-welcome {
    min-height: 0;
    padding: 23px;
  }

  .account-welcome h2 {
    font-size: 25px;
  }

  .account-benefits {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .account-auth-panel {
    padding: 17px;
  }

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

  .invite-code {
    width: 100%;
  }

  .member-grid,
  .group-tools {
    grid-template-columns: 1fr;
  }

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

  .cloud-status-head {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .cloud-status-head > .status-chip {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .cloud-brand-icon {
    width: 44px;
    height: 44px;
  }

  .cloud-status-head h2 {
    font-size: 18px;
  }

  .sync-metrics {
    grid-template-columns: 1fr;
  }

  .sync-metrics > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sync-metrics > div:last-child {
    border-bottom: 0;
  }

  .cloud-actions > button {
    flex: 1 1 120px;
  }

  .sync-log-item {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .sync-log-item time {
    grid-column: 2;
  }

  .modal-overlay {
    align-items: end;
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    border-radius: 14px 14px 0 0;
  }

  .modal-body {
    max-height: calc(100vh - 105px);
    padding: 17px;
  }

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

  .span-2 {
    grid-column: span 1;
  }

  .color-field > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .modal-actions > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-actions > button,
  .modal-actions .primary-button,
  .modal-actions .secondary-button {
    width: 100%;
  }

  .goal-detail-hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .detail-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .detail-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .version-compare {
    grid-template-columns: 1fr;
  }

  .conflict-resolution-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
