* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.daily-app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.daily-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, auto) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 760;
}

.brand h1 a {
  color: inherit;
  text-decoration: none;
}

.brand h1 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.brand .powered-by {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.brand .range {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-picker {
  display: grid;
  grid-template-columns: 38px minmax(150px, 210px) 38px;
  gap: 8px;
  align-items: center;
}

.day-picker button,
.day-picker input,
.nav-links a {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.day-picker button {
  width: 38px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.day-picker button:disabled {
  color: var(--disabled);
  cursor: default;
}

.day-picker input {
  width: 100%;
  padding: 0 10px;
}

.nav-links {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 650;
}

.day-picker button:not(:disabled):hover,
.day-picker input:hover,
.nav-links a:hover {
  border-color: var(--accent);
}

.summary {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
}

.metric {
  min-width: 92px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
}

.daily-content {
  min-width: 0;
  height: calc(100vh - 63px);
  padding: 16px;
}

.daily-board {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.15fr) minmax(360px, 1.05fr);
  grid-template-rows: minmax(280px, 0.95fr) minmax(280px, 1.05fr);
  gap: 14px;
}

.hero-panel {
  grid-column: 1 / 3;
  grid-row: 1;
}

.overview-panel {
  grid-column: 1;
  grid-row: 2;
}

.images-panel {
  grid-column: 2;
  grid-row: 2;
}

.comments-panel {
  grid-column: 3;
  grid-row: 1 / 3;
}

.panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}

.panel-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.hero-panel-body,
.overview-panel .panel-body,
.comments-panel .panel-body {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.hero-panel-body {
  display: grid;
  grid-template-columns: minmax(360px, 1.55fr) minmax(280px, 0.85fr);
  align-items: start;
  gap: 12px;
}

.overview-text {
  margin: 0;
  line-height: 1.65;
}

.infographic {
  display: block;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-inner);
  border-radius: 8px;
  overflow: hidden;
  background: var(--img-bg);
}

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

.infographic-portrait {
  width: min(100%, 420px);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
}

.infographic-portrait img {
  object-fit: contain;
  background: var(--img-bg);
}

.daily-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-inner);
  border-radius: 8px;
  background: var(--bg);
  object-fit: cover;
}

.infographic-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.team-digest {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.team-digest-item {
  padding: 10px;
  border: 1px solid var(--border-inner);
  border-radius: 8px;
  background: var(--panel-alt);
}

.team-digest-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.team-digest-head strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-digest-item p {
  margin: 7px 0 0;
  color: var(--text-2);
  line-height: 1.5;
}

.team-info-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border-inner);
  font-size: 12px;
}

.team-info-name {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.team-info-idea {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-info-links {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.team-info-links a {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}

.team-info-links a:hover {
  background: var(--panel-2);
  border-color: var(--accent);
}

.team-info-detail {
  margin-top: 6px;
  font-size: 12px;
}

.team-info-detail > summary {
  cursor: pointer;
  color: var(--muted);
  padding: 3px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.team-info-detail > summary::before {
  content: "▸";
  font-size: 10px;
  transition: transform 0.15s;
}

.team-info-detail[open] > summary::before {
  transform: rotate(90deg);
}

.team-info-detail-body {
  padding-top: 8px;
}

.team-overview-text {
  margin: 0 0 8px;
  color: var(--text-2);
  line-height: 1.55;
}

.team-members {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.team-leader,
.team-member {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.team-leader {
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--accent-border);
}

.team-member {
  background: var(--panel-2);
  color: var(--text-2);
  border: 1px solid var(--border-inner);
}

.images-panel-body {
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.radio-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-inner);
  border-radius: 8px;
  background: var(--panel-alt);
}

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

.radio-title {
  font-weight: 760;
}

.radio-meta,
.radio-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.radio-box audio {
  width: 100%;
}

.radio-box details {
  color: var(--text-2);
}

.radio-box summary {
  cursor: pointer;
  font-weight: 650;
}

.radio-box pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
  font-family: inherit;
  font-size: 13px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  grid-auto-rows: 116px;
  gap: 8px;
}

.media-item {
  display: block;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--img-bg);
  border: 1px solid var(--border-inner);
}

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

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

.team-comments {
  display: grid;
  gap: 8px;
}

.team-comments h3 {
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 13px;
}

.comment {
  padding: 9px;
  border: 1px solid var(--border-inner);
  border-radius: 8px;
  background: var(--panel);
}

.comment-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}

.author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 720;
}

.time {
  color: var(--muted);
  font-size: 12px;
}

.text {
  margin-top: 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.empty-state {
  margin: 32px auto;
  max-width: 460px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1160px) {
  .daily-topbar {
    grid-template-columns: 1fr;
  }

  .day-picker {
    grid-template-columns: 38px 1fr 38px;
  }

  .summary {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .daily-content {
    height: auto;
  }

  .daily-board {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .hero-panel,
  .overview-panel,
  .images-panel,
  .comments-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .hero-panel-body {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 280px;
  }
}

@media (max-width: 620px) {
  .daily-topbar,
  .daily-content {
    padding-left: 10px;
    padding-right: 10px;
  }

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

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

  .nav-links {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-links a {
    min-width: 0;
    padding: 0 6px;
    font-size: 12px;
  }

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