:root {
  --bg: #fff8ef;
  --surface: #ffffff;
  --ink: #273126;
  --muted: #72796e;
  --line: #e7ddce;
  --primary: #2f8a68;
  --primary-ink: #ffffff;
  --coral: #e46f55;
  --sun: #f5c95d;
  --sky: #dfeefa;
  --mint: #e2f2e8;
  --peach: #ffe9dc;
  --rose: #fde7e5;
  --shadow: 0 12px 28px rgba(69, 50, 29, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: 0;
}

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

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 248, 239, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar,
.app-shell {
  width: min(100%, 860px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 16px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 900;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(69, 50, 29, 0.12);
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.logout-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  max-width: 82px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-shell {
  padding: 18px 16px 94px;
}

.login-wrap {
  display: grid;
  min-height: calc(100vh - 80px);
  place-items: center;
}

.login-panel,
.form-panel,
.delete-panel,
.text-panel,
.item-card,
.stats-grid div,
.settings-list a,
.week-day-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(100%, 430px);
  padding: 18px;
}

.login-mark {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(69, 50, 29, 0.12);
}

.login-illustration {
  width: 100%;
  max-height: 210px;
  object-fit: contain;
}

.section-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.section-heading p,
.page-title-row p,
.detail-header p,
.hero-copy p,
.schedule-hero p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.section-heading h1,
.page-title-row h1,
.detail-header h1,
.delete-panel h1,
.hero-copy h1,
.schedule-hero h1 {
  margin: 0;
  font-size: 1.74rem;
  font-weight: 900;
  line-height: 1.18;
}

.home-hero-card,
.schedule-hero {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  overflow: hidden;
  background: #fdf1df;
  border: 1px solid #ecd7bd;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-hero-card {
  grid-template-columns: minmax(0, 1fr);
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 8px;
}

.hero-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 10px 7px 7px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #efd7bb;
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 900;
}

.hero-brand-pill img {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.hero-copy span,
.schedule-hero span {
  color: var(--muted);
  line-height: 1.5;
}

.hero-filter {
  width: min(100%, 180px);
  margin-top: 4px;
}

.kid-illustration {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.schedule-hero {
  grid-template-columns: 1fr auto;
  align-items: center;
  background: var(--mint);
  border-color: #cbe4d4;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.form-panel {
  padding: 16px;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 138, 104, 0.16);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
}

.check-row input {
  width: 20px;
  min-height: 20px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

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

.ghost-button {
  min-height: 36px;
  padding: 0 12px;
  background: #fffdfa;
  border-color: var(--line);
  color: var(--ink);
}

.full-width {
  width: 100%;
}

.compact {
  min-height: 40px;
}

.quick-actions,
.button-row {
  display: flex;
  gap: 10px;
}

.quick-actions > *,
.button-row > * {
  flex: 1 1 0;
}

.page-title-row,
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

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

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 900;
}

.section-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.section-title-row a,
.item-actions a {
  color: var(--primary);
  font-weight: 900;
}

.item-list {
  display: grid;
  gap: 10px;
}

.item-card {
  padding: 14px;
}

.item-card h3 {
  margin: 6px 0;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.3;
}

.item-card p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.schedule-accent {
  border-left: 6px solid var(--primary);
}

.record-accent {
  border-left: 6px solid var(--sun);
}

.item-meta,
.item-footer,
.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.item-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.badge-kind-good {
  background: var(--mint);
  color: #1f6a48;
}

.badge-kind-care {
  background: var(--rose);
  color: #a04432;
}

.badge-kind-share-good {
  background: var(--sky);
  color: #345f91;
}

.badge-kind-share-care {
  background: #fff0c4;
  color: #7b5b16;
}

.badge-kind-default {
  background: #f1eee8;
  color: var(--muted);
}

.record-chart-card {
  display: grid;
  gap: 13px;
  padding: 15px;
  background: linear-gradient(135deg, #fffdfa 0%, #fff1df 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.comparison-chart {
  gap: 12px;
}

.chart-row {
  display: grid;
  gap: 7px;
}

.comparison-row {
  gap: 11px;
  padding: 12px;
  background: rgba(255, 253, 250, 0.76);
  border: 1px solid #efddc7;
  border-radius: 8px;
}

.chart-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chart-label strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.child-chart-list {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.child-chart-line {
  display: grid;
  grid-template-columns: minmax(48px, 70px) minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.child-chart-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-chart-line strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: right;
}

.chart-track {
  height: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #ead9c5;
  border-radius: 999px;
}

.chart-bar {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.chart-bar.badge-kind-good {
  background: #69b98c;
}

.chart-bar.badge-kind-care {
  background: #e46f55;
}

.chart-bar.badge-kind-share-good {
  background: #6fa8dc;
}

.chart-bar.badge-kind-share-care {
  background: #f2c34f;
}

.chart-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.filter-panel,
.week-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: #fff3e5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.week-toolbar label {
  display: grid;
  gap: 6px;
}

.week-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.week-nav a {
  display: grid;
  min-height: 40px;
  place-items: center;
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  font-weight: 900;
}

.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-color: #d9bfa0 transparent;
}

.home-week-board {
  margin-top: 2px;
}

.week-day-card {
  --day-color: var(--primary);
  --day-tint: #f0fbf5;
  --day-soft: #dff3ea;
  position: relative;
  display: grid;
  align-content: start;
  min-height: 142px;
  padding: 12px;
  overflow: hidden;
  border-top: 4px solid var(--day-color);
  background: linear-gradient(180deg, #ffffff 0%, var(--day-tint) 100%);
  scroll-snap-align: start;
}

.week-day-card::before {
  content: "";
  position: absolute;
  top: -24px;
  right: -22px;
  width: 70px;
  height: 70px;
  background: var(--day-soft);
  border-radius: 999px;
  opacity: 0.52;
  pointer-events: none;
}

.week-day-card.day-monday {
  --day-color: #2f8a68;
  --day-tint: #f0fbf5;
  --day-soft: #d7f0e2;
}

.week-day-card.day-tuesday {
  --day-color: #d96d52;
  --day-tint: #fff3ed;
  --day-soft: #ffd9cb;
}

.week-day-card.day-wednesday {
  --day-color: #3d87a8;
  --day-tint: #eef8fc;
  --day-soft: #d5edf7;
}

.week-day-card.day-thursday {
  --day-color: #7b70b8;
  --day-tint: #f5f3ff;
  --day-soft: #e4dffd;
}

.week-day-card.day-friday {
  --day-color: #b98222;
  --day-tint: #fff8e7;
  --day-soft: #f8e2ac;
}

.week-day-card.day-saturday {
  --day-color: #4c7fc1;
  --day-tint: #eef5ff;
  --day-soft: #d7e7fb;
}

.week-day-card.day-sunday {
  --day-color: #cc657e;
  --day-tint: #fff1f4;
  --day-soft: #f8d6df;
}

.week-day-card.today {
  border-color: var(--day-color);
  box-shadow: inset 0 0 0 1px var(--day-color), var(--shadow);
}

.week-day-card header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.day-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--day-color);
  font-weight: 900;
}

.day-icon,
.week-empty-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--day-color);
  background: var(--day-soft);
}

.day-icon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
}

.day-icon svg,
.week-empty-icon svg,
.schedule-chip-time svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.week-day-card header strong {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
}

.week-empty,
.week-empty-state {
  color: var(--muted);
}

.week-empty {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  justify-items: center;
  margin: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed var(--day-soft);
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.week-empty-icon {
  width: 28px;
  height: 28px;
  border-radius: 11px;
}

.week-schedule-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.schedule-chip {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--day-soft);
  border-left: 5px solid var(--day-color);
  border-radius: 8px;
}

.schedule-chip::after {
  content: "";
  position: absolute;
  right: -16px;
  bottom: -20px;
  width: 52px;
  height: 52px;
  background: var(--day-soft);
  border-radius: 999px;
  opacity: 0.45;
  pointer-events: none;
}

.schedule-chip-time {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--day-color);
  font-size: 0.78rem;
  font-weight: 900;
}

.schedule-chip strong {
  position: relative;
  z-index: 1;
  font-size: 0.94rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.schedule-chip small {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-list {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 16px 0;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
}

.text-panel,
.delete-panel {
  padding: 16px;
  line-height: 1.6;
}

.delete-panel {
  display: grid;
  gap: 16px;
}

.delete-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stats-grid div {
  padding: 14px 10px;
  text-align: center;
}

.stats-grid span {
  display: block;
  font-size: 1.3rem;
  font-weight: 900;
}

.stats-grid p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 16px;
  font-weight: 900;
}

.settings-list strong {
  color: var(--muted);
  font-size: 1.4rem;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 10px 10px;
  background: rgba(255, 253, 250, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 24px rgba(69, 50, 29, 0.1);
  backdrop-filter: blur(12px);
}

.bottom-nav a {
  display: grid;
  gap: 2px;
  min-height: 48px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav a.active {
  background: var(--mint);
  color: var(--primary);
}

.status-message,
.empty-state,
.validation-summary {
  padding: 12px 14px;
  border-radius: 8px;
}

.status-message {
  margin-bottom: 16px;
  background: var(--mint);
  color: #1f6a48;
  font-weight: 900;
}

.empty-state {
  margin: 0;
  background: #f7f2eb;
  color: var(--muted);
}

.validation-summary {
  background: var(--rose);
  color: #9c3929;
}

.field-validation {
  color: #a04432;
  font-size: 0.84rem;
  font-weight: 800;
}

@media (min-width: 680px) {
  .content-shell {
    padding-top: 28px;
  }

  .home-hero-card {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: center;
    padding: 20px;
  }

  .filter-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
  }

  .records-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }

  .comparison-row {
    grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
    align-items: center;
  }

  .child-chart-line {
    grid-template-columns: minmax(64px, 86px) minmax(0, 1fr) 48px;
  }

  .week-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
  }

  .week-day-card {
    min-height: 220px;
  }

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