:root {
  --brand: #eb7c39;
  --brand-dark: #c5531d;
  --ink: #272727;
  --muted: #77706b;
  --subtle: #a69b93;
  --line: #eee2da;
  --paper: #ffffff;
  --soft: #fff1e8;
  --surface-primary: #fff3ea;
  --surface-video: #fff8f4;
  --surface-neutral: #f7f5f2;
  --surface-control: #ffffff;
  --card: var(--surface-neutral);
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: var(--ink);
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.prototype-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #ffffff;
}

.phone-frame {
  width: min(390px, 100vw);
  height: min(844px, calc(100vh - 36px));
  min-height: 720px;
  background: var(--paper);
  border: 1px solid rgba(58, 45, 37, 0.12);
  border-radius: 28px;
  overflow: hidden;
}

.app {
  position: relative;
  height: 100%;
  background: var(--paper);
  overflow: hidden;
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 104px;
  scrollbar-width: none;
}

.scroll-area::-webkit-scrollbar {
  display: none;
}

.app-header,
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 8px;
}

.app-bar {
  justify-content: flex-start;
  background: #ffffff;
  border-bottom: 1px solid rgba(238, 226, 218, 0.8);
}

.logo {
  width: 112px;
  height: auto;
  display: block;
}

.page-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.header-action,
.header-profile,
.icon-button,
.back-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.header-profile {
  border-radius: 50%;
  color: var(--brand-dark);
  background: var(--soft);
}

.header-profile i {
  font-size: 21px;
}

.back-button {
  flex: 0 0 auto;
}

.header-copy {
  margin: 10px 0 16px;
}

.home-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  align-items: start;
  gap: 12px;
  margin: 10px 0 16px;
}

.home-summary .header-copy {
  margin: 4px 0 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.headline {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.subcopy {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
}

.row {
  display: flex;
  align-items: center;
}

.between {
  justify-content: space-between;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 0;
  border-radius: 14px;
}

.flat-card {
  background: var(--card);
  border: 0;
  border-radius: 12px;
}

.points-card {
  background: var(--surface-primary);
  padding: 13px 14px;
  margin-bottom: 14px;
}

.home-points-card {
  width: 100%;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  text-align: left;
}

.home-points-card .metric-label {
  font-size: 10px;
}

.home-points-card .metric-value {
  font-size: 17px;
  white-space: nowrap;
}

.home-rank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

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

.metric-value {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.chip.light {
  background: var(--surface-control);
  color: var(--muted);
}

.chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.video-card {
  background: var(--surface-video);
  overflow: hidden;
  margin-bottom: 14px;
}

.video-card-body {
  padding: 14px;
}

.thumb {
  position: relative;
  overflow: hidden;
  background: #f2e6de;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.large {
  height: 190px;
}

.thumb.medium {
  width: 104px;
  height: 84px;
  flex: 0 0 auto;
  border-radius: 11px;
}

.thumb.small {
  width: 74px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 10px;
}

.play-badge {
  position: absolute;
  inset: auto 12px 12px auto;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(39, 39, 39, 0.78);
  color: #fff;
  font-size: 22px;
}

.video-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0;
}

.video-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:active {
  transform: translateY(1px);
}

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

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-card {
  background: var(--surface-neutral);
  min-height: 102px;
  padding: 13px;
  display: grid;
  align-content: space-between;
  text-align: left;
}

.action-card i {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--soft);
  color: var(--brand);
  font-size: 20px;
}

.action-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.action-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 8px 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--subtle);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.nav-item i {
  font-size: 23px;
}

.nav-item.active {
  color: var(--brand);
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  margin: 8px 0 14px;
  background: var(--surface-neutral);
  border-radius: 13px;
}

.segment button {
  min-height: 36px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segment button.active {
  background: var(--brand);
  color: #fff;
}

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

.video-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  text-align: left;
}

.video-row-text {
  min-width: 0;
  flex: 1;
}

.video-row-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.video-row-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.point-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.player-frame {
  background: var(--surface-video);
  overflow: hidden;
  margin: 8px 0 14px;
}

.player-media {
  position: relative;
  height: 218px;
  background: #1f1d1c;
}

.player-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0.86;
}

.player-control {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.player-control button {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand);
  font-size: 30px;
}

.player-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  margin-bottom: 7px;
}

.bar-fill {
  height: 100%;
  width: 32%;
  border-radius: inherit;
  background: var(--brand);
}

.tips {
  background: var(--surface-neutral);
  padding: 14px;
  margin: 12px 0;
}

.tip-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.tip-row + .tip-row {
  margin-top: 9px;
}

.tip-row i {
  color: var(--brand);
  font-size: 18px;
}

.chat-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.chat-screen .scroll-area {
  padding-bottom: 214px;
}

.message {
  max-width: 86%;
  padding: 11px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}

.message.coach {
  background: var(--surface-neutral);
}

.message.user {
  justify-self: end;
  background: var(--brand);
  color: #fff;
}

.chat-context,
.chat-input-card {
  background: var(--surface-neutral);
  padding: 12px;
}

.chat-composer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 94px;
  z-index: 2;
  background: var(--surface-neutral);
}

.quick-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0;
}

.quick-chips::-webkit-scrollbar {
  display: none;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.chat-input input {
  min-width: 0;
  flex: 1;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-control);
  padding: 0 12px;
  outline: none;
}

.send-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
}

.calendar-card,
.ranking-card {
  background: var(--surface-neutral);
  padding: 14px;
}

.ranking-card {
  background: var(--surface-primary);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.weekday,
.day {
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.weekday {
  height: 24px;
  color: var(--subtle);
}

.day {
  background: #fff;
  border: 1px solid transparent;
  color: var(--muted);
}

.day.done {
  color: var(--brand-dark);
  background: var(--soft);
}

.day.today,
.day.selected {
  color: #fff;
  background: var(--brand);
}

.day.blank {
  background: transparent;
}

.ranking-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
}

.ranking-row:first-child {
  border-top: 0;
}

.ranking-row.me {
  margin: 6px -6px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--soft);
  border-top-color: transparent;
}

.rank-num {
  color: var(--brand-dark);
}

.rank-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tabs {
  grid-template-columns: repeat(3, 1fr);
}

.section-title {
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 800;
}

.success-toast {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 94px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #2e2925;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.success-toast i {
  color: var(--brand);
  font-size: 19px;
}

@media (max-width: 420px) {
  .prototype-shell {
    padding: 0;
  }

  .phone-frame {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    border: 0;
  }
}
