.cd-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cd-hero img {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  flex: none;
}

.cd-hero h1 {
  margin: 0 0 0.2rem;
}

.cd-hero p {
  margin: 0;
  color: var(--muted);
}

.cd-section {
  display: none;
  scroll-margin-top: 5.75rem;
  margin-bottom: 2.5rem;
}

html:not([data-section]) #today,
html[data-section="today"] #today,
html[data-section="bosses"] #bosses,
html[data-section="tools"] #tools,
html[data-section="clan"] #clan,
html[data-section="planner"] #planner,
html[data-section="notices"] #notices,
html[data-section="settings"] #settings,
html[data-section="feedback"] #feedback {
  display: block;
}

html[data-section]:not([data-section="today"]) .faq {
  display: none;
}

.cd-section > h2 {
  margin-top: 0;
}

.cd-stack {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  max-width: 100%;
}

.cd-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.cd-card.is-hot {
  border-color: rgba(252, 129, 32, 0.7);
}

.cd-card h2,
.cd-card h3,
.cd-sub h3,
.cd-sub h4 {
  margin: 0 0 0.35rem;
}

.cd-next-name {
  margin: 0.15rem 0;
  font-size: 1.7rem;
}

.cd-kicker {
  margin: 0;
  color: var(--orange);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.cd-count {
  margin: 0.2rem 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.cd-count-sm {
  color: var(--teal);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cd-fine,
.cd-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.cd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.cd-spread {
  justify-content: space-between;
}

.cd-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.cd-line span,
.cd-line div {
  display: grid;
}

.cd-grid-2 {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.cd-grid-2 > *,
.cd-stack > *,
.cd-card,
.cd-sub,
.cd-section .wrap {
  min-width: 0;
  max-width: 100%;
}

.cd-field {
  display: grid;
  gap: 0.3rem;
  font-weight: 700;
}

.cd-field span {
  color: var(--muted);
  font-size: 0.88rem;
}

.cd-field input,
.cd-field select,
.cd-field textarea,
.cd-card input,
.cd-card select,
.cd-card textarea,
#boss-search,
#member-form input,
#member-form select {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #071312;
  color: var(--text);
  font: inherit;
}

.cd-btn,
.cd-chip,
.cd-icon-btn {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--orange);
  color: #071312;
  font: inherit;
  font-weight: 800;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cd-btn-quiet,
.cd-chip,
.cd-icon-btn {
  background: transparent;
  color: var(--teal);
  border-color: rgba(0, 229, 212, 0.45);
}

.cd-chip.is-on,
.cd-icon-btn.is-on {
  background: var(--teal);
  color: #071312;
  border-color: var(--teal);
}

.cd-btn.is-disabled,
.cd-chip.is-disabled,
.cd-btn:disabled,
.cd-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cd-check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.35rem 0;
}

.cd-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.3rem;
  accent-color: var(--teal);
}

.cd-section-title {
  margin: 1.1rem 0 0.4rem;
}

.cd-section-title.is-hot {
  color: var(--orange);
}

.cd-sub {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.cd-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.cd-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 22rem;
}

.cd-table th,
.cd-table td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  vertical-align: top;
}

.cd-table .is-higher {
  color: var(--teal);
  font-weight: 800;
}

.is-ok { color: var(--teal); }
.is-bad { color: #ff8d8d; }

.cd-week {
  display: grid;
  gap: 0.8rem;
}

.cd-status {
  min-height: 1.4em;
  color: var(--orange);
  font-weight: 700;
}

.cd-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cd-dialog {
  width: min(32rem, calc(100% - 2rem));
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.cd-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.cd-dialog p {
  white-space: pre-wrap;
}

#boss-search {
  margin-bottom: 0.2rem;
}

@media (min-width: 1024px) {
  .cd-section { scroll-margin-top: 1.25rem; }
}

@media (min-width: 800px) {
  .cd-grid-2,
  .cd-week {
    grid-template-columns: 1fr 1fr;
  }

  .cd-grid-2 .cd-field,
  #member-form .cd-field,
  #member-form .cd-btn {
    align-self: end;
  }
}

@media (max-width: 720px) {
  .cd-count { font-size: 1.6rem; }
  .cd-hero img { width: 64px; height: 64px; }
}

.cd-drawer {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  background: #0a1c1a;
  border-right: 1px solid var(--line);
}

.cd-drawer.is-open {
  display: flex;
}

.cd-drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.35rem 0.4rem 0.85rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.cd-drawer-brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex: none;
}

.cd-drawer-brand p {
  margin: 0;
}

.cd-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cd-drawer nav a,
.cd-home-link {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
}

.cd-drawer nav a:hover,
.cd-home-link:hover {
  color: var(--teal);
  background: rgba(0, 229, 212, 0.1);
}

.cd-drawer nav a[aria-current="true"] {
  background: rgba(0, 229, 212, 0.16);
  color: var(--teal);
}

.cd-home-link {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.cd-app-bar-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  min-width: 0;
}

@media (max-width: 1023px) {
  .cd-drawer {
    position: fixed;
    z-index: 19;
    top: calc(var(--header) + 3px);
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    padding: 0.85rem 0.75rem 1.25rem;
    background: #0c2421;
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.35);
    overflow: auto;
  }
}

@media (min-width: 1024px) {
  .cd-drawer {
    display: flex;
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    padding: 1.1rem 0.85rem 1.25rem;
    overflow: auto;
  }

  .cd-drawer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--orange), var(--teal));
  }
}
