:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #66736d;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #dde5df;
  --sage: #55786a;
  --mint: #d9eee4;
  --coral: #e56f51;
  --amber: #f3be5d;
  --blue: #4d7fa8;
  --shadow: 0 18px 44px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  letter-spacing: 0;
}

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

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

.hero {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  background: #dfe8e2;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(251, 250, 247, 0.96), rgba(251, 250, 247, 0.58) 46%, rgba(251, 250, 247, 0.08));
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0 96px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sage);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  max-width: 9ch;
  font-size: clamp(3.4rem, 10vw, 6.5rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.hero__copy {
  max-width: 22rem;
  margin-bottom: 0;
  color: #304039;
  font-size: 1.04rem;
  line-height: 1.7;
}

.workspace {
  width: min(1120px, calc(100% - 24px));
  margin: -54px auto 0;
  padding-bottom: 40px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 16px;
}

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

.metric,
.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(221, 229, 223, 0.9);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 86px;
  padding: 18px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric__label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.metric strong {
  margin-top: 4px;
  font-size: 1.85rem;
  line-height: 1;
}

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

.log-panel {
  grid-row: span 2;
}

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

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.status-pill {
  min-width: 76px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: #244d40;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.entry-form {
  display: grid;
  gap: 14px;
}

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

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

textarea {
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(85, 120, 106, 0.18);
}

.range-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.range-group legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 4px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--coral);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.scale-labels strong {
  color: var(--coral);
  font-size: 1.1rem;
}

.primary-action,
.ghost-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  background: var(--ink);
  color: #fff;
}

.ghost-action {
  padding: 0 12px;
  background: #edf3ef;
  color: #244d40;
  font-size: 0.8rem;
}

.ghost-action.danger {
  background: #fff0ea;
  color: #a3442d;
}

.routine-list,
.video-list,
.history-list {
  display: grid;
  gap: 10px;
}

.routine-item,
.video-item,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.routine-item {
  min-height: 84px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.routine-item h3 {
  margin-bottom: 5px;
  font-size: 0.95rem;
}

.routine-item p,
.history-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.84rem;
}

.routine-item span {
  min-width: 58px;
  color: var(--blue);
  font-weight: 900;
  text-align: right;
}

.video-panel {
  align-self: start;
}

.video-status {
  background: #eef0ff;
  color: #40528c;
}

.video-item {
  overflow: hidden;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
}

.video-item img {
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  background: #d9eee4;
}

.video-item__body {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.video-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.video-item__meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f3f0ea;
}

.video-item h3 {
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

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

.video-item a {
  width: fit-content;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--coral);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.history-item {
  padding: 12px;
}

.history-item__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 6px;
}

.history-item strong {
  font-size: 0.92rem;
}

.history-item button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f3f0ea;
  color: #7a4334;
  cursor: pointer;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .hero {
    min-height: 300px;
  }

  .hero__shade {
    background: linear-gradient(180deg, rgba(251, 250, 247, 0.92), rgba(251, 250, 247, 0.72) 55%, rgba(251, 250, 247, 0.18));
  }

  .hero__content {
    padding: 38px 0 82px;
  }

  h1 {
    font-size: 3.7rem;
  }

  .workspace {
    width: min(100% - 16px, 560px);
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .metric {
    min-height: 72px;
    padding: 12px 10px;
  }

  .metric strong {
    font-size: 1.35rem;
  }

  .panel {
    padding: 14px;
  }

  .video-item {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .video-item img {
    min-height: 118px;
  }
}

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

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

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .ghost-action {
    width: 100%;
  }

  .video-item {
    grid-template-columns: 1fr;
  }

  .video-item img {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }
}
