:root {
  --bg: #f4f0e8;
  --panel: rgba(255, 251, 245, 0.84);
  --panel-strong: #fffaf4;
  --text: #1f1a16;
  --muted: #6f6258;
  --line: rgba(31, 26, 22, 0.08);
  --accent: #2f7d69;
  --accent-soft: #d7efe7;
  --accent-deep: #1d5748;
  --warn: #d06a39;
  --warn-soft: rgba(208, 106, 57, 0.14);
  --shadow: 0 24px 60px rgba(70, 52, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(110, 181, 159, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(226, 181, 127, 0.24), transparent 26%),
    linear-gradient(145deg, #f9f4ec 0%, #efe5d7 100%);
}

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

.ambient {
  position: fixed;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(14px);
  opacity: 0.6;
  pointer-events: none;
}

.ambient-left {
  top: -8rem;
  left: -6rem;
  background: rgba(125, 196, 174, 0.5);
}

.ambient-right {
  right: -8rem;
  bottom: -8rem;
  background: rgba(224, 159, 111, 0.4);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.back-link,
.storage-mode,
.sync-status,
.user-pill,
.toolbar-button,
.primary-button,
.close-button,
.edit-button,
.delete-button,
.ghost-button {
  border-radius: 999px;
}

.session-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

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

.back-link {
  display: inline-flex;
  align-items: center;
  padding: 11px 16px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 250, 244, 0.9);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(70, 52, 35, 0.08);
}

.top-toolbar,
.summary-grid,
.focus-panel,
.hero,
.composer,
.summary-card,
.goal-card {
  backdrop-filter: blur(12px);
}

.top-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 18px;
}

.storage-mode,
.sync-status,
.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  background: rgba(255, 250, 244, 0.9);
  border: 1px solid var(--line);
  color: var(--muted);
}

.storage-mode {
  font-weight: 700;
  color: var(--text);
}

.sync-status.is-error {
  color: #9c461f;
  border-color: rgba(208, 106, 57, 0.24);
  background: rgba(255, 240, 234, 0.92);
}

.auth-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

#logoutButton[hidden] {
  display: none;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-button,
.primary-button,
.close-button,
.edit-button,
.delete-button,
.ghost-button,
.add-trigger {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.toolbar-button,
.ghost-button,
.edit-button,
.close-button {
  padding: 12px 18px;
  background: rgba(255, 250, 244, 0.92);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(70, 52, 35, 0.08);
}

.danger-button {
  background: var(--warn-soft);
  color: #9c461f;
  border-color: rgba(208, 106, 57, 0.24);
}

.hero,
.composer,
.summary-card,
.focus-panel,
.goal-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  border-radius: 32px;
}

.eyebrow,
.section-label,
.card-label,
.memo-title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--muted);
}

.hero h1,
.summary-card h2,
.focus-panel h2,
.goal-card h3,
.composer h2,
.goals-section h2 {
  margin: 12px 0 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.06;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
}

.hero-copy p:last-child,
.summary-copy,
.goal-memo,
.progress-caption {
  color: var(--muted);
  line-height: 1.65;
}

.hero-copy p:last-child {
  max-width: 580px;
  margin: 20px 0 0;
}

.add-trigger {
  width: 88px;
  height: 88px;
  font-size: 3rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #53a38c 100%);
  border-radius: 28px;
  box-shadow: 0 22px 40px rgba(47, 125, 105, 0.28);
}

.composer {
  display: none;
  margin-top: 22px;
  padding: 28px;
  border-radius: 28px;
}

.composer.is-open {
  display: block;
}

.composer-header,
.card-top,
.form-actions,
.section-header,
.focus-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.goal-form,
.edit-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

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

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

label span {
  font-size: 0.94rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(47, 125, 105, 0.24);
  border-color: rgba(47, 125, 105, 0.42);
}

.primary-button {
  padding: 12px 18px;
  background: var(--text);
  color: #fff9f4;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.summary-card {
  padding: 24px;
  border-radius: 26px;
}

.summary-card h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.accent-card {
  background: linear-gradient(135deg, rgba(225, 246, 239, 0.96), rgba(244, 252, 249, 0.88));
}

.focus-panel {
  margin-top: 22px;
  padding: 24px 28px;
  border-radius: 28px;
}

.focus-metrics {
  display: flex;
  gap: 14px;
}

.focus-metric {
  min-width: 150px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 250, 244, 0.86);
  border: 1px solid var(--line);
}

.focus-metric span {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
}

.focus-metric strong {
  display: block;
  margin-top: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
}

.goals-section {
  margin-top: 26px;
}

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

.goal-card {
  padding: 24px;
  border-radius: 28px;
  background: var(--panel-strong);
}

.goal-title {
  font-size: 1.7rem;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.delete-button {
  padding: 12px 18px;
  color: #9c461f;
  background: linear-gradient(180deg, rgba(255, 240, 234, 0.98), rgba(251, 223, 212, 0.96));
  border: 1px solid rgba(208, 106, 57, 0.16);
}

.edit-button,
.ghost-button {
  padding: 12px 18px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.priority-badge,
.status-badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.priority-high {
  background: rgba(208, 106, 57, 0.15);
  color: #9b451e;
}

.priority-medium {
  background: rgba(84, 119, 191, 0.14);
  color: #355692;
}

.priority-low {
  background: rgba(47, 125, 105, 0.14);
  color: var(--accent-deep);
}

.status-complete {
  background: rgba(47, 125, 105, 0.14);
  color: var(--accent-deep);
}

.status-on-track {
  background: rgba(206, 178, 87, 0.18);
  color: #8f6a1f;
}

.status-at-risk {
  background: rgba(208, 106, 57, 0.14);
  color: #9b451e;
}

.progress-block {
  margin-top: 18px;
}

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

.progress-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 26, 22, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #69b79e 100%);
}

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

.metric-box {
  padding: 14px;
  border-radius: 18px;
  background: #fff4e8;
}

.metric-box span {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
}

.metric-box strong {
  display: block;
  margin-top: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
}

.card-note {
  margin-top: 6px;
}

.hidden {
  display: none;
}

.empty-state {
  margin-top: 14px;
  padding: 42px 24px;
  text-align: center;
  border: 1px dashed rgba(31, 26, 22, 0.18);
  border-radius: 26px;
  color: var(--muted);
  background: rgba(255, 250, 244, 0.72);
}

@media (max-width: 980px) {
  .summary-grid,
  .goals-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1160px);
    padding-top: 22px;
  }

  .hero,
  .composer,
  .focus-panel,
  .card-top,
  .form-actions,
  .section-header,
  .top-toolbar,
  .session-bar,
  .session-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions,
  .card-actions,
  .focus-metrics {
    flex-direction: column;
  }

  .toolbar-button,
  .edit-button,
  .delete-button,
  .ghost-button,
  .primary-button {
    width: 100%;
  }

  .add-trigger {
    width: 100%;
    height: 64px;
    font-size: 2.2rem;
  }

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