.teamhub-hwp-section {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.teamhub-hwp-section.hidden {
  display: none;
}

.teamhub-hwp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.teamhub-hwp-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.teamhub-hwp-title small {
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 600;
}

.teamhub-hwp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.teamhub-hwp-list {
  display: flex;
  flex-direction: column;
}

.teamhub-hwp-empty,
.teamhub-hwp-loading {
  padding: 16px 14px;
  color: var(--text-sub);
  font-size: 13px;
}

.teamhub-hwp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

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

.teamhub-hwp-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-main);
  font-weight: 800;
}

.teamhub-hwp-name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teamhub-hwp-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-sub);
  font-size: 11px;
}

.teamhub-hwp-lock {
  color: #fbbf24;
}

.teamhub-hwp-beta {
  color: #93c5fd;
}

.teamhub-hwp-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.teamhub-hwp-editor-modal {
  width: min(1280px, calc(100vw - 28px));
  height: min(88vh, 920px);
  max-width: none;
}

.teamhub-hwp-editor-modal .drawer-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.teamhub-hwp-editor-status {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 12px;
  background: rgba(15, 23, 42, 0.36);
}

.teamhub-hwp-editor-frame-wrap {
  flex: 1;
  min-height: 0;
  background: #e5e7eb;
}

.teamhub-hwp-editor-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

.teamhub-hwp-editor-page {
  min-height: 100vh;
  margin: 0;
  background: #0f172a;
  color: #e5e7eb;
  overflow: hidden;
}

.teamhub-hwp-editor-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.teamhub-hwp-editor-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.96);
}

.teamhub-hwp-editor-heading {
  min-width: 0;
}

.teamhub-hwp-editor-heading h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f8fafc;
  font-size: 16px;
  line-height: 1.35;
}

.teamhub-hwp-editor-meta {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #94a3b8;
  font-size: 12px;
}

.teamhub-hwp-editor-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.teamhub-hwp-editor-page .teamhub-hwp-editor-status {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(30, 41, 59, 0.95);
  color: #cbd5e1;
  max-width: min(50vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teamhub-hwp-editor-page .teamhub-hwp-editor-status.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.72);
}

.teamhub-hwp-editor-page .teamhub-hwp-editor-frame-wrap {
  min-height: 0;
  height: 100%;
}

.teamhub-hwp-editor-auth {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0f172a;
}

.teamhub-hwp-editor-auth.hidden {
  display: none;
}

.teamhub-hwp-editor-auth-card {
  width: min(420px, 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 22px;
  background: #111827;
  color: #e5e7eb;
}

.teamhub-hwp-editor-auth-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.teamhub-hwp-editor-auth-card p {
  margin: 0 0 16px;
  color: #94a3b8;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .teamhub-hwp-head,
  .teamhub-hwp-row {
    grid-template-columns: 1fr;
  }

  .teamhub-hwp-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .teamhub-hwp-actions,
  .teamhub-hwp-row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .teamhub-hwp-editor-modal {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .teamhub-hwp-editor-topbar {
    grid-template-columns: 1fr;
  }

  .teamhub-hwp-editor-top-actions {
    justify-content: flex-start;
  }

  .teamhub-hwp-editor-page .teamhub-hwp-editor-status {
    max-width: 100%;
    border-radius: 8px;
  }
}
