:root {
  color-scheme: light;
  --ivory-50: #fbfaf7;
  --ivory-100: #f7f6f2;
  --ivory-200: #efede6;
  --forest-950: #17342e;
  --forest-900: #1d4038;
  --forest-800: #254e45;
  --forest-700: #32665b;
  --forest-600: #477b6e;
  --forest-100: #e4eee9;
  --forest-50: #f0f5f2;
  --sage-500: #89a698;
  --sage-300: #b8c9bf;
  --sage-200: #d5e0da;
  --sage-100: #e9efeb;
  --sand-500: #ac9875;
  --sand-300: #d7c9ae;
  --sand-200: #e7ddca;
  --sand-100: #f3ede2;
  --ink-900: #26312e;
  --ink-700: #52605c;
  --ink-500: #74807c;
  --line: #dedfd8;
  --white: #ffffff;
  --danger: #a94b43;
  --danger-soft: #f8e9e6;
  --amber: #8b691b;
  --amber-soft: #f7efd9;
  --shadow-sm: 0 1px 2px rgba(24, 52, 46, 0.04), 0 8px 24px rgba(24, 52, 46, 0.05);
  --shadow-md: 0 18px 48px rgba(24, 52, 46, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --sidebar-width: 230px;
  --content-width: 1200px;
  --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ivory-100);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 85% -15%, rgba(184, 201, 191, 0.22), transparent 34rem),
    var(--ivory-100);
  color: var(--ink-900);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

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

button,
[role="button"],
select,
label[for] {
  cursor: pointer;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

::selection {
  background: var(--sage-300);
  color: var(--forest-950);
}

:focus-visible {
  outline: 3px solid rgba(50, 102, 91, 0.3);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.text-muted {
  color: var(--ink-500);
}

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

.app-shell > :not(.sidebar) {
  min-width: 0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  padding: 27px 17px 18px;
  border-right: 1px solid rgba(37, 78, 69, 0.1);
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 8px;
  margin-bottom: 30px;
}

.brand-mark,
.auth-brand .brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px 14px 14px 6px;
  background: var(--forest-800);
  box-shadow: 0 8px 18px rgba(37, 78, 69, 0.2);
  color: var(--white);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-name {
  display: block;
  margin: 0;
  color: var(--forest-950);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.brand-caption {
  display: block;
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.25;
}

.nav-group {
  display: grid;
  gap: 5px;
  margin-bottom: 22px;
}

.nav-group-title,
.nav-label {
  padding: 0 12px;
  margin: 0 0 5px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 13px;
  color: var(--ink-700);
  font-size: 14px;
  font-weight: 700;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}

.nav-link:hover {
  background: var(--forest-50);
  color: var(--forest-800);
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--forest-100);
  color: var(--forest-900);
}

.nav-link.active::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: -17px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--forest-800);
  content: "";
}

.nav-icon {
  display: grid;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--sage-500);
}

.nav-link.active .nav-icon {
  color: var(--forest-700);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-bottom > .button {
  margin-top: 10px;
}

.sidebar-message {
  margin: 0 8px 14px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.65;
}

.profile {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 60px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--sand-200);
  color: var(--forest-900);
  font-size: 13px;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  display: block;
  margin: 0;
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.profile-role {
  display: block;
  margin: 1px 0 0;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.4;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px clamp(22px, 4vw, 54px);
  border-bottom: 1px solid rgba(37, 78, 69, 0.08);
  background: rgba(247, 246, 242, 0.84);
  backdrop-filter: blur(18px);
}

.breadcrumb {
  min-width: 0;
  color: var(--ink-500);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb strong,
.breadcrumb span:last-child {
  color: var(--ink-900);
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.main-content {
  width: min(100%, calc(var(--content-width) + clamp(44px, 8vw, 108px)));
  padding: 42px clamp(22px, 4vw, 54px) 72px;
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--forest-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--sage-500);
  content: "";
}

.page-title {
  margin: 0;
  color: var(--forest-950);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.055em;
}

.page-subtitle {
  max-width: 670px;
  margin: 9px 0 0;
  color: var(--ink-500);
  font-size: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button.primary {
  border-color: var(--forest-800);
  background: var(--forest-800);
  box-shadow: 0 7px 16px rgba(37, 78, 69, 0.18);
  color: var(--white);
}

.button.primary:hover:not(:disabled) {
  border-color: var(--forest-900);
  background: var(--forest-900);
  box-shadow: 0 9px 20px rgba(37, 78, 69, 0.23);
}

.button.secondary {
  border-color: var(--sage-200);
  background: var(--forest-50);
  color: var(--forest-800);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--sage-300);
  background: var(--forest-100);
}

.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink-700);
}

.button.ghost:hover:not(:disabled) {
  border-color: var(--sage-300);
  background: var(--white);
  color: var(--forest-800);
}

.button.danger {
  border-color: #e8c7c1;
  background: var(--danger-soft);
  color: var(--danger);
}

.button.danger:hover:not(:disabled) {
  border-color: #daa8a0;
  background: #f5dcd8;
}

.button.small {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
}

.button.wide {
  width: 100%;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--sand-300);
  border-radius: 999px;
  background: var(--sand-100);
  color: #715d3d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.demo-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 18px;
  border-bottom: 1px solid var(--sand-300);
  background: linear-gradient(90deg, var(--sand-100), #f8f3ea, var(--sand-100));
  color: #705e40;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.85fr);
  gap: 20px;
  margin-bottom: 22px;
}

.goal-card {
  position: relative;
  isolation: isolate;
  min-height: 318px;
  padding: clamp(27px, 4vw, 42px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 90% 5%, rgba(255, 255, 255, 0.17), transparent 23rem),
    linear-gradient(135deg, var(--forest-900), var(--forest-700));
  box-shadow: 0 22px 50px rgba(37, 78, 69, 0.2);
  color: var(--white);
}

.goal-card::before {
  position: absolute;
  z-index: -1;
  right: -86px;
  bottom: -124px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(255, 255, 255, 0.04), 0 0 0 92px rgba(255, 255, 255, 0.025);
  content: "";
}

.goal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 21px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.goal-meta .badge {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.goal-title {
  max-width: 520px;
  margin: 0 0 7px;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.025em;
}

.goal-number {
  display: inline-block;
  margin-right: 8px;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Malgun Gothic", sans-serif;
  font-size: clamp(50px, 7vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.07em;
}

.goal-unit {
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.goal-target {
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.goal-minutes {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.goal-period {
  margin-top: 17px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.progress-track {
  width: 100%;
  height: 9px;
  margin-top: 25px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-fill {
  width: var(--progress, 0%);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d7e1d5, #fff2cf);
  box-shadow: 0 0 18px rgba(255, 242, 207, 0.35);
  transition: width 500ms var(--ease);
}

.goal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.goal-illustration {
  position: absolute;
  right: 23px;
  bottom: 17px;
  z-index: -1;
  width: min(31%, 185px);
  color: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.quick-card {
  display: flex;
  min-height: 318px;
  flex-direction: column;
  padding: 29px;
  border: 1px solid rgba(37, 78, 69, 0.1);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(251, 250, 247, 0.92));
  box-shadow: var(--shadow-sm);
}

.card-title {
  margin: 0;
  color: var(--forest-950);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.035em;
}

.quick-card > .text-muted,
.quick-card > p {
  margin: 6px 0 20px;
  font-size: 12px;
}

.quick-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.time-chip {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 800;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.time-chip:hover {
  border-color: var(--sage-500);
  color: var(--forest-800);
}

.time-chip.selected {
  border-color: var(--forest-700);
  background: var(--forest-100);
  box-shadow: 0 0 0 2px rgba(50, 102, 91, 0.08);
  color: var(--forest-900);
}

.quick-card .button.wide {
  margin-top: auto;
}

.quick-card form,
.modal-body form,
.draw-grid form {
  display: grid;
  gap: 14px;
}

.quick-card form {
  flex: 1 1 auto;
}

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

.label {
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 800;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink-900);
  outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}

.input,
.select {
  padding: 9px 12px;
}

.textarea {
  min-height: 116px;
  padding: 12px;
  line-height: 1.65;
  resize: vertical;
}

.select {
  padding-right: 36px;
}

.input::placeholder,
.textarea::placeholder {
  color: #9aa39f;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--sage-300);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px rgba(71, 123, 110, 0.13);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  cursor: not-allowed;
  background: var(--ivory-200);
  color: var(--ink-500);
}

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

.form-grid .field.full,
.form-grid .field:has(.textarea) {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 20px;
}

.helper {
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.55;
}

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

.stat-card {
  position: relative;
  min-height: 136px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid rgba(37, 78, 69, 0.09);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 58px;
  height: 4px;
  border-radius: 0 0 0 8px;
  background: var(--sage-300);
  content: "";
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 800;
}

.stat-value {
  display: block;
  margin: 0;
  color: var(--forest-950);
  font-family: ui-rounded, "Arial Rounded MT Bold", "Malgun Gothic", sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.stat-note {
  display: block;
  margin: 6px 0 0;
  color: var(--ink-500);
  font-size: 11px;
}

.stat-label .nav-icon {
  width: 18px;
  height: 18px;
  color: var(--sage-500);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(270px, 0.8fr);
  gap: 20px;
}

.panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(37, 78, 69, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

.panel + .panel {
  margin-top: 18px;
}

.section-grid > .panel + .panel,
.settings-grid > .panel + .panel {
  margin-top: 0;
}

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

.panel-title {
  margin: 0;
  color: var(--forest-950);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.panel-subtitle {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 11px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--ivory-50);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.data-table td {
  color: var(--ink-700);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background-color 140ms ease;
}

.data-table tbody tr:hover {
  background: var(--forest-50);
}

.empty-state {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 36px 20px;
  color: var(--ink-500);
  font-size: 13px;
  text-align: center;
}

.empty-state svg {
  width: 42px;
  margin: 0 auto 12px;
  color: var(--sage-500);
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-700);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.badge.green {
  border-color: #c9ddd3;
  background: var(--forest-100);
  color: var(--forest-800);
}

.badge.amber {
  border-color: #e5d4a9;
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.neutral {
  border-color: var(--line);
  background: var(--ivory-200);
  color: var(--ink-700);
}

.tabs {
  display: flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ivory-200);
}

.tab {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tab:hover {
  color: var(--forest-800);
}

.tab.active {
  background: var(--white);
  box-shadow: 0 2px 9px rgba(24, 52, 46, 0.08);
  color: var(--forest-900);
}

.record-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 67px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.record-item:first-child {
  padding-top: 4px;
}

.record-item:last-child {
  padding-bottom: 4px;
  border-bottom: 0;
}

.record-date {
  display: grid;
  justify-items: center;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.record-day {
  color: var(--forest-900);
  font-family: ui-rounded, "Arial Rounded MT Bold", "Malgun Gothic", sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.record-duration {
  color: var(--forest-800);
  font-size: 15px;
  font-weight: 800;
}

.record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.record-detail {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.record-detail strong {
  color: var(--forest-900);
  font-size: 14px;
}

.record-detail .helper {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-actions .button {
  min-width: 38px;
}

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

.member-grid > * {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
}

.member-grid .avatar {
  width: 46px;
  height: 46px;
  margin-bottom: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.setting-section {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 16px;
}

.setting-section:not(.panel) + .setting-section:not(.panel) {
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.setting-row {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row strong {
  display: block;
  color: var(--ink-900);
  font-size: 13px;
}

.setting-row p {
  margin: 2px 0 0;
  color: var(--ink-500);
  font-size: 11px;
}

.toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  padding: 3px;
  border: 1px solid var(--sage-300);
  border-radius: 999px;
  background: var(--ivory-200);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.toggle::after {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 7px rgba(24, 52, 46, 0.2);
  content: "";
  transition: transform 180ms var(--ease);
}

.toggle.active,
.toggle[aria-checked="true"] {
  border-color: var(--forest-700);
  background: var(--forest-700);
}

.toggle.active::after,
.toggle[aria-checked="true"]::after {
  transform: translateX(20px);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-700);
  font-size: 12px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--forest-700);
}

.draw-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr);
  gap: 20px;
  align-items: stretch;
}

.draw-stage {
  display: grid;
  min-height: 440px;
  place-items: center;
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgba(37, 78, 69, 0.12);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 42%, rgba(184, 201, 191, 0.3), transparent 14rem),
    linear-gradient(160deg, var(--ivory-50), var(--forest-50));
  text-align: center;
}

.draw-result {
  width: min(100%, 480px);
  text-align: center;
}

.winner-card {
  position: relative;
  padding: 38px 28px;
  overflow: hidden;
  border: 1px solid var(--sand-300);
  border-radius: 28px;
  background: linear-gradient(145deg, #fffdf7, var(--sand-100));
  box-shadow: 0 20px 44px rgba(112, 94, 64, 0.14);
}

.winner-card::before,
.winner-card::after {
  position: absolute;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(172, 152, 117, 0.35);
  border-radius: 50%;
  content: "";
}

.winner-card::before {
  top: -34px;
  left: -26px;
}

.winner-card::after {
  right: -23px;
  bottom: -38px;
}

.winner-name {
  margin: 8px 0 3px;
  color: var(--forest-950);
  font-size: clamp(30px, 5vw, 45px);
  font-weight: 800;
  letter-spacing: -0.055em;
}

.winner-number {
  color: var(--sand-500);
  font-size: 13px;
  font-weight: 800;
}

.candidate-list {
  display: grid;
  max-height: 470px;
  gap: 8px;
  padding-right: 4px;
  overflow-y: auto;
}

.candidate-item {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink-700);
  font-size: 12px;
}

.draw-empty {
  display: grid;
  width: 90px;
  height: 90px;
  place-items: center;
  margin: 22px auto 5px;
  border: 1px solid var(--sage-200);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  color: var(--forest-600);
}

.draw-empty .nav-icon {
  width: 36px;
  height: 36px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(430px, 0.85fr) minmax(460px, 1.15fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ivory-100);
}

.auth-card {
  display: flex;
  width: min(100%, 520px);
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 7vw, 84px);
  margin: 0 auto;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 4px;
  margin: 25px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ivory-200);
}

.auth-tabs .tab {
  width: 100%;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.auth-intro {
  margin-bottom: 8px;
}

.auth-intro h1 {
  margin: 0 0 10px;
  color: var(--forest-950);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.25;
  letter-spacing: -0.055em;
}

.auth-intro p {
  color: var(--ink-500);
  font-size: 14px;
}

.auth-card form {
  display: grid;
  gap: 16px;
}

.auth-visual {
  position: relative;
  display: grid;
  isolation: isolate;
  min-height: 100%;
  place-items: center;
  padding: 60px;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.17), transparent 18rem),
    linear-gradient(145deg, var(--forest-900), var(--forest-700));
  color: var(--white);
}

.auth-visual::before,
.auth-visual::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  content: "";
}

.auth-visual::before {
  right: -12vw;
  bottom: -15vw;
  width: 40vw;
  height: 40vw;
  box-shadow: 0 0 0 6vw rgba(255, 255, 255, 0.025);
}

.auth-visual::after {
  top: 8%;
  left: 10%;
  width: 110px;
  height: 110px;
}

.auth-visual > * {
  max-width: 530px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(18, 37, 33, 0.52);
  backdrop-filter: blur(5px);
  animation: fade-in 160ms ease both;
}

.modal {
  width: min(100%, 520px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  background: var(--ivory-50);
  box-shadow: var(--shadow-md);
  animation: modal-in 220ms var(--ease) both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 23px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2,
.modal-head h3 {
  margin: 0;
  color: var(--forest-950);
  font-size: 18px;
}

.modal-body {
  padding: 23px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 17px 23px 22px;
  border-top: 1px solid var(--line);
}

#toast:empty {
  display: none;
}

.toast,
#toast:not(:empty) {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  max-width: min(390px, calc(100vw - 40px));
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: var(--forest-950);
  box-shadow: 0 16px 42px rgba(23, 52, 46, 0.28);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms var(--ease);
}

.toast.visible,
#toast.visible:not(:empty) {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid var(--sand-300);
  border-radius: 13px;
  background: var(--sand-100);
  color: #69583d;
  font-size: 12px;
}

.notice svg {
  flex: 0 0 auto;
  width: 18px;
  margin-top: 1px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--forest-700);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--forest-900);
}

.text-link .nav-icon {
  width: 16px;
  height: 16px;
}

.guide-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 105% 0%, rgba(184, 201, 191, 0.24), transparent 13rem),
    rgba(255, 255, 255, 0.76);
}

.guide-panel > .panel-title {
  margin-bottom: 21px;
  font-size: 20px;
  line-height: 1.5;
}

.guide-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.guide-step > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: var(--forest-100);
  color: var(--forest-700);
  font-size: 9px;
  font-weight: 800;
}

.guide-step strong {
  color: var(--ink-900);
  font-size: 12px;
}

.guide-step p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.55;
}

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

.admin-shortcuts a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 800;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.admin-shortcuts a:hover {
  border-color: var(--sage-300);
  background: var(--forest-50);
  color: var(--forest-800);
}

.admin-shortcuts .nav-icon {
  width: 19px;
  height: 19px;
}

.audit-list p {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.audit-list p:last-child {
  border-bottom: 0;
}

.audit-list strong {
  color: var(--ink-700);
  font-size: 12px;
}

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

.goal-list-card {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.goal-list-card > .goal-card {
  min-height: 286px;
  margin: -20px -20px 18px;
  border-radius: var(--radius-lg) var(--radius-lg) 16px 16px;
  box-shadow: none;
}

.goal-list-card > .goal-status {
  margin-top: auto;
  margin-bottom: 0;
}

.goal-list-card .progress-track {
  height: 7px;
  margin-top: auto;
  background: var(--sage-100);
}

.goal-list-card .progress-fill {
  background: var(--forest-600);
  box-shadow: none;
}

.goal-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.inline-form .field {
  flex: 1 1 auto;
}

.timer-display {
  padding: 26px 14px;
  color: var(--forest-950);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(44px, 9vw, 76px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.app-footer {
  padding: 8px clamp(22px, 4vw, 54px) 30px;
  color: var(--ink-500);
  font-size: 10px;
  text-align: center;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 204px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(285px, 0.85fr);
  }

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

  .member-grid,
  .goal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body {
    padding-bottom: 74px;
  }

  .app-shell {
    display: block;
    min-height: calc(100dvh - 74px);
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: block;
    width: auto;
    height: 74px;
    padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    overflow-x: auto;
    border-top: 1px solid rgba(37, 78, 69, 0.12);
    border-right: 0;
    background: rgba(251, 250, 247, 0.94);
  }

  .sidebar .brand,
  .sidebar .sidebar-bottom,
  .sidebar .nav-group-title,
  .sidebar .nav-label {
    display: none;
  }

  .sidebar nav {
    display: flex;
    width: max-content;
    min-width: 100%;
    justify-content: space-around;
    gap: 4px;
  }

  .sidebar .nav-group {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    margin: 0;
  }

  .nav-link {
    min-width: 68px;
    min-height: 58px;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    padding: 5px 9px;
    font-size: 10px;
    line-height: 1.2;
  }

  .nav-link:hover {
    transform: none;
  }

  .nav-link.active::before {
    top: auto;
    right: 17px;
    bottom: -7px;
    left: 17px;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
  }

  .nav-icon {
    width: 22px;
    height: 22px;
  }

  .topbar {
    min-height: 62px;
    padding: 9px 22px;
  }

  .main-content {
    padding-top: 30px;
    padding-bottom: 50px;
  }

  .hero-grid,
  .section-grid,
  .draw-grid {
    grid-template-columns: 1fr;
  }

  .quick-card {
    min-height: auto;
  }

  .section-grid > .panel + .panel {
    margin-top: 0;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-card {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .auth-visual {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 7px 10px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .breadcrumb {
    flex: 1 1 100%;
    font-size: 11px;
  }

  .header-actions {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .header-actions .demo-badge {
    margin-right: auto;
  }

  .button.small,
  .tab {
    min-height: 44px;
  }

  .main-content {
    padding: 25px 16px 42px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
  }

  .page-heading > .button,
  .page-heading > .header-actions {
    width: 100%;
  }

  .page-heading > .header-actions .button {
    display: inline-flex;
    flex: 1 1 auto;
  }

  .page-title {
    font-size: 29px;
  }

  .hero-grid {
    gap: 14px;
  }

  .goal-card,
  .quick-card {
    min-height: 0;
    border-radius: 23px;
  }

  .goal-card {
    padding: 26px 22px;
  }

  .goal-number {
    font-size: 56px;
  }

  .quick-card {
    padding: 23px 20px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    min-height: 124px;
    padding: 17px;
    border-radius: 17px;
  }

  .stat-value {
    font-size: 24px;
  }

  .panel {
    padding: 19px 16px;
    border-radius: 18px;
  }

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

  .form-grid,
  .settings-grid,
  .member-grid,
  .goal-list {
    grid-template-columns: 1fr;
  }

  .record-item {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 13px 2px;
  }

  .record-date {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .record-detail {
    grid-column: 2;
    grid-row: 1;
  }

  .record-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .draw-stage {
    min-height: 360px;
    padding: 22px;
  }

  .auth-card {
    justify-content: flex-start;
    padding: 32px 21px;
  }

  .auth-brand {
    margin-bottom: 44px;
  }

  .admin-shortcuts {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - 30px);
    border-radius: 22px 22px 0 0;
  }

  .modal-actions {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .toast,
  #toast:not(:empty) {
    right: 16px;
    bottom: 90px;
    left: 16px;
    max-width: none;
  }
}

@media (max-width: 390px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .header-actions .button.primary {
    max-width: 144px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    padding: 0;
    background: var(--white);
  }

  .sidebar,
  .topbar,
  .header-actions,
  .record-actions,
  .button,
  #toast {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main-content {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .panel,
  .stat-card,
  .goal-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* A quiet installation entry beside the existing prayer content. */
.home-install-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px solid #d7e2d6;
  border-radius: 18px;
  background: #edf2e9;
}
.home-install-banner > img { flex: 0 0 48px; border-radius: 13px; }
.home-install-banner > div { flex: 1; min-width: 0; }
.home-install-banner h2 { margin: 0 0 4px; color: var(--forest-900); font-size: 16px; font-weight: 800; letter-spacing: -.035em; }
.home-install-banner p { margin: 0; color: var(--ink-700); font-size: 13px; line-height: 1.7; }
.home-install-banner > .button { flex-shrink: 0; }
.footer-app-links { display: inline-flex; align-items: center; gap: 16px; }
.footer-app-links > a { color: var(--forest-700); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) {
  .home-install-banner { flex-wrap: wrap; gap: 12px; margin-top: 18px; padding: 18px; border-radius: 14px; }
  .home-install-banner h2 { font-size: 15px; }
  .home-install-banner p { font-size: 12px; }
  .home-install-banner > .button { width: 100%; min-height: 44px; }
}
@media (display-mode: standalone) {
  .home-install-banner { display: none; }
}
@media print {
  .home-install-banner, .footer-app-links > a { display: none !important; }
}

/* --------------------------------------------------------------------------
   Gijang First Church prayer companion — quiet editorial interface
   -------------------------------------------------------------------------- */

:root {
  --paper: #f6f2e8;
  --paper-deep: #eee8da;
  --surface: #fffdf8;
  --surface-soft: #faf7ef;
  --pine-950: #214846;
  --pine-900: #315f5d;
  --pine-800: #315f5d;
  --pine-700: #477471;
  --pine-600: #668b87;
  --pine-100: #e2ebe5;
  --pine-50: #eef3ef;
  --brass-700: #8c5d24;
  --brass-500: #b7792c;
  --brass-300: #d7c49c;
  --brass-100: #f1e8d5;
  --brick: #6b3f37;
  --brick-soft: #a77569;
  --charcoal: #26332f;
  --charcoal-soft: #5e6965;
  --charcoal-faint: #7c8581;
  --rule: #ded8cb;
  --rule-dark: #c9c1b1;
  --danger: #a3453f;
  --danger-soft: #f8e9e5;
  --amber: #82621f;
  --amber-soft: #f5edd7;
  --white: #fff;
  --line: var(--rule);
  --forest-950: var(--pine-950);
  --forest-900: var(--pine-900);
  --forest-800: var(--pine-800);
  --forest-700: var(--pine-700);
  --forest-600: var(--pine-600);
  --forest-100: var(--pine-100);
  --forest-50: var(--pine-50);
  --ink-900: var(--charcoal);
  --ink-700: var(--charcoal-soft);
  --ink-500: var(--charcoal-faint);
  --ivory-50: var(--surface);
  --ivory-100: var(--paper);
  --ivory-200: var(--paper-deep);
  --sand-500: var(--brass-700);
  --sand-300: var(--brass-300);
  --sand-200: #e5d8bd;
  --sand-100: var(--brass-100);
  --sage-500: #789a8f;
  --sage-300: #b4c8c0;
  --sage-200: #d1ded8;
  --sage-100: var(--pine-100);
  --content-width: 1180px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 0 rgba(16, 47, 42, 0.035);
  --shadow-md: 0 18px 50px rgba(16, 47, 42, 0.13);
}

html {
  background: var(--paper);
}

body {
  background: var(--paper);
  color: var(--charcoal);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(23, 61, 53, 0.017) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 61, 53, 0.012) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  pointer-events: none;
}

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

:focus-visible {
  outline: 3px solid rgba(177, 139, 72, 0.34);
  outline-offset: 3px;
}

.app-shell {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(420px, 1.7fr) minmax(210px, 0.72fr);
  align-items: center;
  min-height: 82px;
  padding: 0 max(30px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid rgba(23, 61, 53, 0.14);
  background: rgba(246, 242, 232, 0.96);
  backdrop-filter: blur(15px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  min-height: 56px;
  padding: 0;
  margin: 0;
}

.brand-mark,
.auth-brand .brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(23, 61, 53, 0.22);
  border-radius: 22px 22px 8px 8px;
  background: transparent;
  box-shadow: none;
  color: var(--pine-800);
}

.brand-mark svg {
  width: 27px;
  height: 32px;
}

.brand-caption {
  display: block;
  margin: 0 0 2px;
  color: var(--brass-700);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.09em;
}

.brand-name {
  display: block;
  color: var(--pine-950);
  font-family: Batang, "바탕", "Noto Serif KR", serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.primary-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  align-self: stretch;
  gap: 3px;
}

.primary-nav .nav-link,
.primary-nav .menu-toggle {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 0;
  background: transparent;
  color: var(--charcoal-soft);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease;
}

.primary-nav .nav-icon {
  display: none;
}

.primary-nav .nav-link:hover,
.primary-nav .menu-toggle:hover {
  background: transparent;
  color: var(--pine-800);
  transform: none;
}

.primary-nav .nav-link::after,
.primary-nav .menu-toggle::after {
  position: absolute;
  right: 15px;
  bottom: -1px;
  left: 15px;
  height: 2px;
  background: transparent;
  content: "";
}

.primary-nav .nav-link.active,
.primary-nav .menu-toggle[aria-expanded="true"] {
  background: transparent;
  color: var(--pine-950);
}

.primary-nav .nav-link.active::before {
  display: none;
}

.primary-nav .nav-link.active::after,
.primary-nav .menu-toggle[aria-expanded="true"]::after {
  background: var(--brass-500);
}

.menu-toggle {
  border: 0;
  cursor: pointer;
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.site-header .profile.account-link {
  min-height: 44px;
  padding: 5px 9px 5px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.site-header .profile.account-link:hover {
  background: rgba(255, 253, 248, 0.72);
}

.user-chip,
.user-summary,
.header-user {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--charcoal-soft);
  font-size: 13px;
  font-weight: 700;
}

.site-header .avatar {
  width: 32px;
  height: 32px;
  border: 1px solid var(--brass-300);
  background: var(--brass-100);
  color: var(--pine-900);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: calc(100dvh - 82px);
}

.workspace > .main-area:only-child {
  grid-column: 1 / -1;
}

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

.admin-sidebar {
  position: sticky;
  top: 82px;
  z-index: 30;
  width: 214px;
  height: calc(100dvh - 82px);
  padding: 30px 18px;
  border-right: 1px solid var(--rule);
  background: rgba(250, 247, 239, 0.78);
}

.admin-sidebar .nav-label,
.admin-sidebar .nav-group-title {
  padding: 0 12px;
  margin: 0 0 10px;
  color: var(--brass-700);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.admin-sidebar .nav-group {
  display: grid;
  gap: 3px;
  margin: 0;
}

.admin-sidebar .nav-link {
  min-height: 45px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--charcoal-soft);
  font-size: 13px;
}

.admin-sidebar .nav-link:hover {
  background: rgba(226, 235, 229, 0.65);
  color: var(--pine-900);
  transform: none;
}

.admin-sidebar .nav-link.active {
  background: var(--pine-100);
  color: var(--pine-950);
}

.admin-sidebar .nav-link.active::before {
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 2px;
  background: var(--brass-500);
}

.admin-sidebar .nav-icon {
  width: 19px;
  height: 19px;
  color: var(--pine-600);
}

.main-content {
  width: min(100%, calc(var(--content-width) + 96px));
  padding: 48px 48px 72px;
  margin: 0 auto;
}

.home-heading {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 30px;
  padding: 14px 0 36px;
}

.home-heading::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 1px;
  background: var(--brass-500);
  content: "";
}

.home-heading .eyebrow {
  margin-bottom: 10px;
  color: var(--brass-700);
}

.home-heading .eyebrow::before {
  display: none;
}

.home-heading h1,
.home-title {
  max-width: 720px;
  margin: 0;
  color: var(--pine-950);
  font-family: Batang, "바탕", "Noto Serif KR", serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.06em;
  white-space: pre-line;
}

.home-heading .page-subtitle,
.home-subtitle {
  max-width: 620px;
  margin: 15px 0 0;
  color: var(--charcoal-soft);
  font-size: 16px;
  line-height: 1.75;
}

.home-date {
  display: grid;
  grid-template-columns: 17px auto;
  align-items: center;
  justify-items: end;
  column-gap: 7px;
  padding-bottom: 6px;
  color: var(--charcoal-faint);
  font-family: Batang, "바탕", serif;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.home-date .nav-icon {
  width: 16px;
  height: 16px;
  color: var(--brass-500);
}

.home-date small {
  grid-column: 1 / -1;
  display: block;
  margin-top: 3px;
  color: var(--charcoal-soft);
  font-family: "Malgun Gothic", sans-serif;
  font-size: 11px;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 18px 0 28px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brass-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: none;
}

.eyebrow::before {
  width: 22px;
  height: 1px;
  background: var(--brass-500);
}

.page-title {
  color: var(--pine-950);
  font-family: Batang, "바탕", "Noto Serif KR", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.page-subtitle {
  max-width: 720px;
  margin-top: 10px;
  color: var(--charcoal-soft);
  font-size: 14px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.78fr);
  gap: 18px;
  margin-bottom: 18px;
}

.goal-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.5fr);
  min-height: 350px;
  padding: 38px 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: #2d5956;
  box-shadow: 0 13px 32px rgba(16, 47, 42, 0.12);
  color: #fbf8ef;
}

.goal-card::before {
  position: absolute;
  right: -90px;
  bottom: -155px;
  z-index: -1;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(215, 196, 156, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 56px rgba(215, 196, 156, 0.045), 0 0 0 112px rgba(215, 196, 156, 0.026);
  content: "";
}

.goal-copy {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  max-width: 72%;
}

.goal-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 22px;
  color: rgba(255, 253, 248, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.goal-meta::before {
  width: 23px;
  height: 1px;
  background: #d6a056;
  content: "";
}

.goal-meta .badge {
  margin-left: auto;
  border-color: rgba(215, 196, 156, 0.34);
  background: rgba(255, 253, 248, 0.08);
  color: #f8edd8;
}

.goal-title {
  max-width: 590px;
  margin-bottom: 7px;
  color: #fffdf8;
  font-family: Batang, "바탕", "Noto Serif KR", serif;
  font-size: clamp(19px, 2.2vw, 25px);
  font-weight: 700;
  line-height: 1.5;
}

.goal-number {
  display: inline-block;
  margin: 4px 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 7vw, 78px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.065em;
  font-variant-numeric: lining-nums tabular-nums;
}

.goal-unit,
.goal-target {
  font-family: "Malgun Gothic", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.goal-unit {
  margin-left: 6px;
  color: rgba(255, 253, 248, 0.86);
}

.goal-target {
  color: rgba(255, 253, 248, 0.58);
}

.goal-minutes,
.goal-period,
.goal-footer {
  color: rgba(255, 253, 248, 0.66);
}

.goal-minutes {
  margin: 8px 0 0;
  font-size: 12px;
}

.progress-track {
  height: 6px;
  margin-top: 27px;
  border-radius: 1px;
  background: rgba(255, 253, 248, 0.18);
}

.progress-fill {
  border-radius: 1px;
  background: var(--brass-300);
  box-shadow: none;
}

.goal-footer {
  margin-top: 11px;
  font-size: 11px;
}

.goal-period {
  margin-top: 18px;
  font-size: 11px;
}

.goal-art {
  position: absolute;
  right: 18px;
  bottom: 8px;
  z-index: 0;
  width: min(38%, 280px);
  color: var(--brass-300);
  pointer-events: none;
}

.art-caption {
  display: block;
  margin: -17px 18px 0 0;
  color: rgba(255, 253, 248, 0.46);
  font-family: Batang, "바탕", serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: right;
}

.goal-illustration {
  position: static;
  width: 100%;
  height: auto;
  color: inherit;
  opacity: 0.44;
}

.quick-card {
  display: flex;
  min-height: 350px;
  flex-direction: column;
  padding: 31px 29px 27px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-title {
  color: var(--pine-950);
  font-family: Batang, "바탕", "Noto Serif KR", serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.quick-card .panel-head {
  margin-bottom: 16px;
}

.quick-card .panel-head > .nav-icon {
  color: var(--brass-500);
}

.tabs {
  padding: 3px;
  border-color: var(--rule);
  border-radius: 10px;
  background: var(--paper-deep);
}

.tab {
  border-radius: 7px;
}

.tab.active {
  box-shadow: none;
}

.quick-options {
  gap: 7px;
  margin-bottom: 15px;
}

.time-chip {
  min-height: 44px;
  border-color: var(--rule);
  border-radius: 9px;
  background: var(--surface);
}

.time-chip.selected {
  border-color: var(--pine-700);
  background: var(--pine-50);
  box-shadow: inset 0 0 0 1px var(--pine-700);
}

.button {
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button.primary {
  border-color: var(--pine-900);
  background: var(--pine-900);
  box-shadow: none;
}

.button.primary:hover:not(:disabled) {
  border-color: var(--pine-950);
  background: var(--pine-950);
  box-shadow: none;
}

.button.secondary {
  border-color: var(--pine-700);
  background: transparent;
  color: var(--pine-800);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--pine-900);
  background: var(--pine-50);
}

.button.ghost {
  border-color: var(--rule);
  background: transparent;
  color: var(--charcoal-soft);
}

.button.ghost:hover:not(:disabled) {
  border-color: var(--rule-dark);
  background: var(--surface);
}

.button.small {
  min-height: 36px;
  border-radius: 8px;
}

.input,
.textarea,
.select {
  min-height: 47px;
  border-color: var(--rule);
  border-radius: 9px;
  background: var(--surface);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--pine-600);
  box-shadow: 0 0 0 3px rgba(71, 125, 112, 0.11);
}

.label {
  color: var(--charcoal-soft);
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 30px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--rule);
}

.stat-card {
  min-height: 132px;
  padding: 23px 22px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.stat-card::after {
  top: 20px;
  right: 0;
  width: 2px;
  height: 29px;
  border-radius: 0;
  background: var(--brass-300);
}

.stat-label {
  margin-bottom: 9px;
  color: var(--charcoal-faint);
  font-size: 11px;
}

.stat-value {
  color: var(--pine-950);
  font-family: Batang, "바탕", "Noto Serif KR", serif;
  font-size: 27px;
  font-weight: 700;
}

.stat-note {
  margin-top: 7px;
  font-size: 10px;
}

.stat-label .nav-icon {
  color: var(--brass-500);
}

.section-grid {
  grid-template-columns: minmax(0, 1.62fr) minmax(285px, 0.72fr);
  gap: 18px;
}

.section-grid.home-details {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
}

.panel {
  padding: 26px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-title {
  color: var(--pine-950);
  font-family: Batang, "바탕", "Noto Serif KR", serif;
  font-size: 18px;
  font-weight: 700;
}

.panel-subtitle,
.helper {
  color: var(--charcoal-faint);
}

.panel-head {
  margin-bottom: 19px;
}

.record-item {
  min-height: 70px;
  border-bottom-color: var(--rule);
}

.record-day {
  color: var(--pine-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
}

.record-detail strong {
  color: var(--pine-950);
}

.text-link {
  color: var(--pine-700);
}

.prayer-companion {
  position: relative;
  overflow: hidden;
  background: var(--surface-soft);
}

.prayer-companion::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  border-right: 1px solid rgba(177, 139, 72, 0.32);
  border-radius: 0 0 0 72px;
  content: "";
  pointer-events: none;
}

.prayer-companion .eyebrow {
  margin-bottom: 5px;
}

.prayer-topics,
.prayer-topic-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--rule);
}

.prayer-topic {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--charcoal);
  text-align: left;
}

.prayer-topic:hover .prayer-topic-name {
  color: var(--pine-700);
}

.topic-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--brass-300);
  border-radius: 50%;
  color: var(--brass-700);
}

.topic-icon svg,
.topic-icon .nav-icon {
  width: 15px;
  height: 15px;
}

.prayer-topic-name {
  display: block;
  font-size: 13px;
  font-weight: 800;
  transition: color 140ms ease;
}

.prayer-topic-detail {
  display: block;
  margin-top: 3px;
  color: var(--charcoal-faint);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
}

.prayer-topic > .nav-icon {
  width: 17px;
  height: 17px;
  color: var(--brass-500);
  transition: transform 140ms ease;
}

.prayer-topic:hover > .nav-icon {
  transform: translateX(2px);
}

.prayer-topic-group {
  min-width: 0;
  border-bottom: 1px solid var(--rule);
}

.prayer-topic-group > summary {
  border-bottom: 0;
  cursor: pointer;
  list-style: none;
}

.prayer-topic-group > summary::-webkit-details-marker {
  display: none;
}

.prayer-topic-group[open] > summary > .nav-icon {
  transform: rotate(90deg);
}

.prayer-topic-group[open] .topic-icon {
  border-color: var(--pine-700);
  background: var(--pine-100);
  color: var(--pine-900);
}

.prayer-topic-content {
  padding: 0 0 18px 10px;
}

.prayer-points {
  display: grid;
  gap: 10px;
  padding-left: 20px;
  margin: 0 0 14px;
  color: var(--charcoal-soft);
  font-size: 14px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.prayer-points li::marker {
  color: var(--brass-700);
}

.total-adjustment-panel {
  margin-bottom: 18px;
}

.total-adjustment-panel .panel-head {
  flex-wrap: wrap;
}

.total-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: var(--charcoal-soft);
  font-size: 14px;
}

.prayer-topic[aria-pressed="true"] {
  color: var(--pine-900);
}

.prayer-topic[aria-pressed="true"] .topic-icon {
  border-color: var(--pine-700);
  background: var(--pine-100);
  color: var(--pine-900);
}

.prayer-topic[aria-pressed="true"] > .nav-icon {
  color: var(--brick);
}

.topic-helper {
  margin: 14px 0 0;
  color: var(--charcoal-faint);
  font-size: 10px;
  line-height: 1.55;
}

.topic-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 8px 8px 8px 11px;
  border-left: 2px solid var(--brick-soft);
  background: var(--brass-100);
  color: var(--charcoal-soft);
  font-size: 11px;
  font-weight: 700;
}

.scripture {
  display: grid;
  justify-items: center;
  padding: 48px 20px 22px;
  margin: 0;
  color: var(--pine-950);
  font-family: Batang, "바탕", "Noto Serif KR", serif;
  font-size: 21px;
  line-height: 1.65;
  text-align: center;
}

.scripture-line {
  width: 1px;
  height: 28px;
  margin-bottom: 15px;
  background: var(--brick-soft);
}

.scripture p {
  margin: 0;
}

.scripture > span:last-child,
.scripture cite,
.scripture-reference {
  display: block;
  margin-top: 7px;
  color: var(--charcoal-faint);
  font-family: "Malgun Gothic", sans-serif;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.data-table {
  background: var(--surface);
}

.table-wrap {
  border-color: var(--rule);
  border-radius: 10px;
}

.data-table th,
.data-table td {
  border-bottom-color: var(--rule);
}

.data-table th {
  background: var(--surface-soft);
  color: var(--charcoal-faint);
}

.data-table tbody tr:hover {
  background: var(--pine-50);
}

.badge {
  border-radius: 999px;
}

.badge.green {
  border-color: #c3d6cd;
  background: var(--pine-100);
  color: var(--pine-900);
}

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

.goal-list-card {
  padding: 0;
  overflow: hidden;
  border-color: var(--rule);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

.goal-list-card > .goal-card {
  min-height: 330px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.goal-list-card > .goal-status {
  padding: 16px 19px;
  margin: 0;
}

.settings-grid {
  gap: 18px;
}

.setting-section {
  border-top: 3px solid var(--brick-soft);
}

.checkbox-row {
  border-bottom-color: var(--rule);
}

.draw-stage {
  background: var(--pine-900);
  color: #fffdf8;
}

.draw-stage .panel-title,
.draw-stage .eyebrow {
  color: #fffdf8;
}

.draw-stage .helper {
  color: rgba(255, 253, 248, 0.67);
}

.winner-card {
  border-color: rgba(215, 196, 156, 0.45);
  background: rgba(255, 253, 248, 0.08);
  color: #fffdf8;
}

.admin-shortcuts a {
  border-color: var(--rule);
  border-radius: 9px;
  background: var(--surface-soft);
}

.admin-shortcuts a:hover {
  border-color: var(--brass-300);
  background: var(--brass-100);
}

.notice {
  border-color: var(--brass-300);
  border-radius: 9px;
  background: var(--brass-100);
  color: #6b552d;
}

.modal-backdrop {
  background: rgba(16, 34, 30, 0.52);
  backdrop-filter: blur(5px);
}

.modal {
  border: 1px solid var(--rule-dark);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.modal-head {
  border-bottom: 1px solid var(--rule);
}

.modal-head h2,
.modal-head h3 {
  color: var(--pine-950);
  font-family: Batang, "바탕", "Noto Serif KR", serif;
}

.toast,
#toast:not(:empty) {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: var(--pine-950);
  box-shadow: 0 12px 30px rgba(16, 47, 42, 0.2);
}

.app-footer {
  display: flex;
  max-width: calc(var(--content-width) + 96px);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 48px 34px;
  margin: 0 auto;
  border-top: 1px solid var(--rule);
  color: var(--charcoal-faint);
  font-family: Batang, "바탕", serif;
  font-size: 11px;
  text-align: center;
}

.footer-inner {
  display: flex;
  max-width: var(--content-width);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    padding: 0 24px;
  }

  .primary-nav .nav-link,
  .primary-nav .menu-toggle {
    padding-right: 10px;
    padding-left: 10px;
    font-size: 13px;
  }

  .primary-nav .nav-link::after,
  .primary-nav .menu-toggle::after {
    right: 10px;
    left: 10px;
  }

  .main-content {
    padding-right: 32px;
    padding-left: 32px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  }

  .goal-copy {
    max-width: 78%;
  }

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

@media (max-width: 900px) {
  body {
    padding-bottom: 76px;
  }

  .site-header {
    min-height: 70px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 20px;
    backdrop-filter: none;
  }

  .site-header .brand {
    min-width: 0;
  }

  .site-header .primary-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 5px 8px env(safe-area-inset-bottom);
    border-top: 1px solid rgba(23, 61, 53, 0.16);
    background: rgba(255, 253, 248, 0.97);
    backdrop-filter: blur(16px);
  }

  .primary-nav .nav-link {
    min-height: 58px;
    flex-direction: column;
    gap: 2px;
    padding: 5px 3px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.2;
  }

  .primary-nav .nav-icon {
    display: block;
    width: 21px;
    height: 21px;
    color: var(--pine-600);
  }

  .primary-nav .nav-link::after {
    right: 24%;
    bottom: -5px;
    left: 24%;
  }

  .primary-nav .menu-toggle {
    display: none;
  }

  .workspace {
    display: block;
    min-height: calc(100dvh - 70px);
  }

  .admin-sidebar {
    position: sticky;
    top: 70px;
    z-index: 50;
    width: 100%;
    height: auto;
    padding: 8px 14px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    background: rgba(246, 242, 232, 0.98);
  }

  .admin-sidebar .nav-label,
  .admin-sidebar .nav-group-title {
    display: none;
  }

  .admin-sidebar nav,
  .admin-sidebar .nav-group {
    display: flex;
    width: max-content;
    gap: 4px;
  }

  .admin-sidebar .nav-link {
    min-height: 38px;
    padding: 7px 11px;
    white-space: nowrap;
  }

  .admin-sidebar .nav-link.active::before {
    display: none;
  }

  .main-content {
    padding-top: 38px;
  }

  .hero-grid,
  .section-grid,
  .section-grid.home-details,
  .draw-grid {
    grid-template-columns: 1fr;
  }

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

  .quick-card {
    min-height: 0;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .site-header {
    min-height: 66px;
    padding: 0 15px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark,
  .auth-brand .brand-mark {
    width: 34px;
    height: 40px;
    border-radius: 18px 18px 7px 7px;
  }

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

  .brand-caption {
    font-size: 8px;
  }

  .brand-name {
    font-size: 16px;
  }

  .site-header .header-actions {
    gap: 5px;
  }

  .site-header .profile.account-link {
    padding-right: 4px;
  }

  .site-header .header-actions .button.small {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .site-header .user-chip > span:not(.avatar),
  .site-header .user-summary > span:not(.avatar),
  .site-header .header-user > span:not(.avatar),
  .site-header .profile.account-link > span:not(.avatar) {
    display: none;
  }

  .main-content {
    padding: 28px 16px 48px;
  }

  .home-heading {
    display: block;
    padding: 13px 0 27px;
  }

  .home-heading h1,
  .home-title {
    font-size: clamp(34px, 10vw, 45px);
    line-height: 1.24;
  }

  .home-heading .page-subtitle,
  .home-subtitle {
    margin-top: 12px;
    font-size: 14px;
  }

  .home-date {
    display: grid;
    grid-template-columns: 16px auto;
    justify-content: start;
    justify-items: start;
    margin-top: 14px;
    padding: 0;
    font-size: 11px;
    text-align: left;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
    padding-top: 8px;
    margin-bottom: 18px;
  }

  .page-title {
    font-size: 32px;
  }

  .page-heading > .button,
  .page-heading > .header-actions {
    width: 100%;
  }

  .goal-card {
    display: block;
    min-height: 390px;
    padding: 28px 23px;
    border-radius: 15px;
  }

  .goal-copy {
    max-width: 100%;
  }

  .goal-title {
    max-width: 76%;
    font-size: 20px;
  }

  .goal-number {
    font-size: 58px;
  }

  .goal-art {
    right: -3px;
    width: 55%;
    opacity: 0.65;
  }

  .quick-card {
    padding: 25px 21px;
    border-radius: 15px;
  }

  .stats-grid {
    gap: 1px;
    border-radius: 14px;
  }

  .stat-card {
    min-height: 124px;
    padding: 19px 17px;
  }

  .stat-value {
    font-size: 23px;
  }

  .section-grid {
    gap: 14px;
  }

  .panel {
    padding: 20px 17px;
    border-radius: 14px;
  }

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

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

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .record-item {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .record-actions {
    gap: 5px;
  }

  .record-actions .button {
    min-width: 0;
    padding-right: 9px;
    padding-left: 9px;
  }

  .prayer-topic {
    min-height: 64px;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 13px 16px 26px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .modal {
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 390px) {
  .brand-caption {
    display: block;
    font-size: 9px;
    white-space: nowrap;
  }

  .brand-name {
    font-size: 15px;
  }

  .site-header .header-actions .account-label,
  .site-header .header-actions .logout-label {
    display: none;
  }

  .home-heading h1,
  .home-title {
    font-size: 32px;
  }

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

  .stat-value {
    font-size: 21px;
  }

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

@media print {
  .site-header,
  .admin-sidebar,
  .primary-nav,
  .header-actions,
  #toast {
    display: none !important;
  }

  .workspace {
    display: block;
  }
}

/* One prayer at a time, with room to read long passages. */
html.reading-prayer,
html.reading-prayer body {
  min-width: 0;
}

.prayer-reader {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 820px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  color: var(--charcoal);
}

.prayer-reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.prayer-reader-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 8px 0;
  color: var(--pine-900);
  font-size: 15px;
  font-weight: 700;
}

.prayer-reader-back:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.prayer-reader-brand {
  min-width: 0;
  color: var(--charcoal-soft);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.prayer-reader-main {
  flex: 1 0 auto;
  min-width: 0;
  padding: clamp(28px, 6vw, 52px) 0 clamp(32px, 7vw, 64px);
}

.prayer-reader-position {
  margin: 0 0 12px;
  color: var(--charcoal-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}

.prayer-reader #prayer-reader-title {
  margin: 0 0 26px;
  color: var(--pine-950);
  font-size: clamp(26px, 4.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.prayer-reader-body {
  margin: 0;
  color: var(--charcoal);
  font-size: clamp(22px, 3.4vw, 28px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.prayer-reader-footer {
  display: grid;
  gap: 18px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.prayer-reader-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.prayer-reader-nav .button,
.prayer-reader-nav > a,
.prayer-reader-nav > button {
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 16px;
  white-space: normal;
  text-align: center;
}

.prayer-reader-nav [aria-disabled="true"] {
  color: var(--charcoal-soft);
  opacity: 0.55;
  cursor: default;
}

.prayer-reader-count {
  color: var(--charcoal-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.prayer-reader-record {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-height: 44px;
  max-width: 100%;
  gap: 8px;
  padding: 10px 16px;
  color: var(--pine-900);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  white-space: normal;
}

.prayer-reader-record:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.prayer-reader-empty {
  margin: 0;
  padding: 28px 0;
  color: var(--charcoal-soft);
  font-size: 20px;
  line-height: 1.9;
}

@media (max-width: 480px) {
  .prayer-reader {
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
  }

  .prayer-reader-nav {
    gap: 8px;
  }

  .prayer-reader-nav .button,
  .prayer-reader-nav > a,
  .prayer-reader-nav > button {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 15px;
  }
}

@media print {
  .prayer-reader {
    min-height: 0;
    max-width: none;
    padding: 0;
  }

  .prayer-reader-back,
  .prayer-reader-footer {
    display: none;
  }
}
