:root {
  --ink: #1f2925;
  --muted: #708079;
  --line: #dce6e1;
  --paper: #f6f8f4;
  --card: #ffffff;
  --green: #26734d;
  --green-soft: #d9f4e4;
  --lime: #b8e978;
  --yellow: #f5d775;
  --orange: #e77a53;
  --blue: #85b8ff;
  --violet: #c7b5ff;
  --gray: #c7d0ca;
  --shadow: 0 18px 42px rgba(47, 78, 65, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 18% 4%,
      rgba(184, 233, 120, 0.22),
      transparent 22rem
    ),
    radial-gradient(
      circle at 92% 35%,
      rgba(217, 244, 228, 0.64),
      transparent 26rem
    ),
    var(--paper);
  font-family: "Manrope", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

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

.page-shell {
  width: min(100% - 48px, 1420px);
  margin: 0 auto 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 22px;
  border-bottom: 1px solid rgba(128, 153, 143, 0.3);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  color: white;
  border-radius: 13px;
  background: var(--ink);
  place-items: center;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.8;
}

.brand-name {
  font-family: "Unbounded", Arial, sans-serif;
  font-size: 1rem;
  letter-spacing: -0.08em;
}

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

.today {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-badge {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-badge[data-mode="api"],
.connection-badge[data-mode="google"] {
  border-color: rgba(38, 115, 77, 0.26);
  background: var(--green-soft);
  color: var(--green);
}

.connection-badge[data-mode="syncing"] {
  border-color: rgba(245, 215, 117, 0.8);
  background: rgba(245, 215, 117, 0.24);
  color: #8a6500;
}

.connection-badge[data-mode="error"] {
  border-color: rgba(231, 122, 83, 0.35);
  background: rgba(231, 122, 83, 0.14);
  color: #a34729;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  min-height: 300px;
  padding: 54px 2px 42px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

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

h1 {
  max-width: 840px;
  margin-bottom: 19px;
  font-family: "Unbounded", Arial, sans-serif;
  font-size: clamp(2.75rem, 6vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.1em;
}

h1 span {
  color: var(--green);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.score-card {
  display: flex;
  gap: 20px;
  align-items: center;
  width: 330px;
  padding: 22px;
  border: 1px solid rgba(190, 207, 198, 0.7);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 35px rgba(47, 78, 65, 0.05);
  backdrop-filter: blur(15px);
}

.score-ring {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0%, #e8eeea 0);
  place-items: center;
}

.score-ring::before {
  position: absolute;
  width: 69px;
  height: 69px;
  border-radius: 50%;
  background: #fbfcfa;
  content: "";
}

.score-ring div {
  position: relative;
  display: grid;
  place-items: center;
}

.score-ring strong {
  font-family: "Unbounded", Arial, sans-serif;
  font-size: 0.98rem;
  letter-spacing: -0.08em;
}

.score-ring span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.score-copy p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.score-copy strong {
  display: block;
  line-height: 1.35;
}

.control-card,
.panel,
.metric-card {
  border: 1px solid rgba(190, 207, 198, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.control-card {
  padding: 28px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.controls-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.controls-grid input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: #fbfcfa;
  color: var(--ink);
  outline: none;
}

.controls-grid input:focus {
  border-color: rgba(38, 115, 77, 0.55);
  box-shadow: 0 0 0 4px rgba(38, 115, 77, 0.1);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.sync-card {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #fbfcfa;
}

.sync-card > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.sync-card strong {
  display: block;
}

.sync-card p {
  grid-column: 2;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sync-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
}

.sync-dot[data-mode="google"],
.sync-dot[data-mode="api"] {
  background: var(--green);
}

.sync-dot[data-mode="error"] {
  background: var(--orange);
}

.secondary-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 0 18px;
  background: var(--green);
  color: white;
  font-weight: 800;
  text-decoration: none;
}

.secondary-link:hover {
  transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 16px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--ink);
  color: white;
}

.secondary-button {
  border: 0;
  background: var(--green);
  color: white;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fbfcfa;
  color: var(--ink);
}

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

.ghost-button:hover {
  background: #edf3ef;
}

.status-line {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

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

.metric-card {
  padding: 22px;
}

.metric-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Unbounded", Arial, sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: -0.08em;
}

.metric-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 20px;
  margin-top: 20px;
}

.panel {
  padding: 28px;
}

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

.panel-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.category-list,
.delegation-list,
.calendar-list {
  display: grid;
  gap: 12px;
}

.category-row {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcfa;
}

.category-main {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.category-main strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1.04rem;
}

.category-main p {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.category-main span {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.bar {
  overflow: hidden;
  height: 9px;
  margin-top: 14px;
  border-radius: 999px;
  background: #e8eeea;
}

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

.tone-lime .bar i {
  background: var(--lime);
}

.tone-orange .bar i {
  background: var(--orange);
}

.tone-yellow .bar i {
  background: var(--yellow);
}

.tone-blue .bar i {
  background: var(--blue);
}

.tone-violet .bar i {
  background: var(--violet);
}

.tone-gray .bar i {
  background: var(--gray);
}

.delegation-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcfa;
}

.delegation-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delegation-card strong {
  font-size: 1.02rem;
}

.delegation-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.delegation-card b {
  justify-self: start;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--green-soft);
  color: var(--green);
}

.calendar-panel {
  margin-top: 20px;
}

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

.calendar-column {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: #fbfcfa;
}

.calendar-column h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.calendar-item {
  padding: 14px;
  border-radius: 16px;
  background: white;
}

.calendar-item strong {
  display: block;
  margin-bottom: 6px;
}

.calendar-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.empty-state {
  border: 1px dashed rgba(112, 128, 121, 0.4);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  pointer-events: none;
}

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

@media (max-width: 1100px) {
  .hero,
  .workspace,
  .calendar-plan {
    grid-template-columns: 1fr;
  }

  .score-card {
    width: 100%;
  }

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 28px, 1420px);
  }

  .topbar,
  .topbar-actions,
  .category-main,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .control-card,
  .panel {
    padding: 20px;
    border-radius: 22px;
  }

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

  .button-row {
    display: grid;
  }

  .sync-card {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-actions {
    display: grid;
    justify-content: stretch;
  }

  .panel-note,
  .category-main span {
    white-space: normal;
  }
}
