/* ---- Tend room + compact Study Desk rack ---- */
.dc-tend-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  color: var(--ink, #3f3730);
}

.dc-tend-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dc-tend-title,
.dc-tend-summary-title {
  margin: 0;
  font-family: "Jua", sans-serif;
  font-weight: 400;
}

.dc-tend-title {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
}

.dc-tend-subtitle {
  margin: 7px 0 0;
  color: var(--sub, #8a7566);
  font: 600 14px/1.55 "Quicksand", sans-serif;
}

.dc-tend-open-link,
.dc-tend-summary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
}

.dc-tend-open-link {
  flex: none;
  padding: 9px 14px;
  color: var(--desk-accent-ink, #7f304b);
  border: 1px solid var(--desk-border, #d9ccc1);
  border-radius: 999px;
  background: var(--card, #fff);
  font-size: 12px;
  box-shadow: 2px 2px 0 var(--shadow, rgba(63, 55, 48, 0.15));
}

.dc-tend-frame-card {
  padding: clamp(7px, 1.3vw, 13px);
  border: 1px solid var(--desk-border, #d9ccc1);
  border-radius: 24px;
  background: color-mix(in srgb, var(--card, #fff) 88%, #f3ddc7);
  box-shadow: var(--desk-shadow, 0 10px 30px rgba(91, 72, 59, 0.08));
}

.dc-tend-frame {
  position: relative;
  min-height: min(780px, calc(100dvh - 175px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--edge, #3f3730) 44%, transparent);
  border-radius: 17px;
  background: #faf5ec;
}

.dc-tend-embed,
.dc-tend-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.dc-tend-embed {
  z-index: 2;
  display: block;
  border: 0;
  background: #faf5ec;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.dc-tend-fallback {
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(rgba(160, 130, 105, 0.17) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(155deg, #fffaf2, #f4e8d8);
}

.dc-tend-fallback-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(360px, 100%);
  gap: 10px;
}

.dc-tend-rack {
  width: min(280px, 82vw);
  padding: 18px 16px;
  box-sizing: border-box;
  border: 2px solid #5f5146;
  border-radius: 10px;
  background: #d9c9b5;
  box-shadow: 4px 5px 0 rgba(80, 63, 50, 0.18);
  transform: rotate(-0.7deg);
}

.dc-tend-paper {
  display: block;
  height: 38px;
  margin: 7px 0;
  border: 1px solid rgba(92, 72, 58, 0.34);
  border-left: 7px solid #c46f5f;
  border-radius: 5px;
  background: linear-gradient(90deg, #f2dcd8, #fff8ef);
  box-shadow: 0 2px 0 rgba(92, 72, 58, 0.1);
}

.dc-tend-paper:nth-child(2) {
  border-left-color: #94794f;
  background: linear-gradient(90deg, #f1e9da, #fff9ef);
  transform: translateX(8px);
}

.dc-tend-paper:nth-child(3) {
  border-left-color: #6d7d58;
  background: linear-gradient(90deg, #e4e9dc, #f8f7e9);
  transform: translateX(-4px);
}

.dc-tend-fallback-title {
  margin: 5px 0 0;
  font: 400 22px/1.2 "Jua", sans-serif;
}

.dc-tend-fallback-note,
.dc-tend-status,
.dc-tend-summary-counts,
.dc-tend-summary-empty {
  color: var(--sub, #8a7566);
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  line-height: 1.5;
}

.dc-tend-fallback-note {
  margin: 0;
  font-size: 13px;
}

.dc-tend-status {
  min-height: 18px;
  margin: 10px 5px 0;
  font-size: 11px;
  text-align: center;
}

.dc-tend-summary-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.dc-tend-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dc-tend-summary-title {
  font-size: 19px;
}

.dc-tend-summary-counts,
.dc-tend-summary-empty {
  margin: 4px 0 0;
  font-size: 11px;
}

.dc-mini-strip-list {
  display: grid;
  gap: 6px;
}

.dc-mini-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 37px;
  padding: 6px 8px;
  box-sizing: border-box;
  color: #4a4038;
  border: 1px solid #d8c9ad;
  border-left: 5px solid #94794f;
  border-radius: 7px;
  background: #f1e9da;
  box-shadow: 0 2px 0 rgba(74, 64, 56, 0.08);
}

.dc-mini-strip--work {
  border-color: #ddb8b1;
  border-left-color: #a3675b;
  background: #f2dcd8;
}

.dc-mini-strip--ernd {
  border-color: #c2ccb2;
  border-left-color: #6d7d58;
  background: #e4e9dc;
}

.dc-mini-strip-code,
.dc-mini-strip-state {
  white-space: nowrap;
  font: 600 9px/1.2 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
}

.dc-mini-strip-title {
  overflow: hidden;
  font: 700 11px/1.3 "Quicksand", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-mini-strip-state {
  color: #8a7566;
  text-transform: uppercase;
}

.dc-tend-summary-button {
  align-self: flex-start;
  padding: 9px 14px;
  color: var(--desk-button-ink, #fff);
  border: 1px solid var(--desk-accent, #b05470);
  border-radius: 999px;
  background: var(--desk-accent, #b05470);
  font-size: 12px;
  cursor: pointer;
}

.dc-tend-summary-button:hover {
  border-color: var(--desk-accent-hover, #91435d);
  background: var(--desk-accent-hover, #91435d);
}

@media (max-width: 699px) {
  .dc-tend-header {
    align-items: flex-start;
  }

  .dc-tend-open-link {
    padding-inline: 11px;
  }

  .dc-tend-frame-card {
    padding: 5px;
    border-radius: 19px;
  }

  .dc-tend-frame {
    min-height: calc(100dvh - 178px);
    border-radius: 15px;
  }

  .dc-tend-fallback {
    padding: 20px;
  }
}

@media (prefers-color-scheme: dark) {
  .dc-tend-frame,
  .dc-tend-embed {
    background: #252522;
  }

  .dc-tend-fallback {
    color: #efece2;
    background:
      radial-gradient(rgba(240, 222, 196, 0.09) 1px, transparent 1px) 0 0 / 24px 24px,
      linear-gradient(155deg, #302c28, #242622);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dc-tend-embed {
    transition: none;
  }
}
