/* hjsc — UI aligned with designs/ (OSMO-style library). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --hjsc-bg: #f2f2f2;
  --hjsc-surface: #ffffff;
  --hjsc-text: #0a0a0a;
  --hjsc-muted: #737373;
  --hjsc-border: #e8e8e8;
  --hjsc-brand: #0d99ff;
  --hjsc-brand-soft: #f2f9ff;
  --hjsc-accent: #0d99ff;
  --hjsc-accent-hover: #007be5;
  --hjsc-live: #ef4444;
  --hjsc-danger: #dc2626;
  --hjsc-radius: 12px;
  --hjsc-radius-pill: 999px;
  --hjsc-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  --hjsc-font: "Inter", system-ui, -apple-system, sans-serif;
  font-family: var(--hjsc-font);
  line-height: 1.5;
  color: var(--hjsc-text);
  -webkit-font-smoothing: antialiased;
}

body.hjsc-body {
  margin: 0;
  min-height: 100vh;
  background: var(--hjsc-bg);
  font-family: var(--hjsc-font);
}

a {
  color: var(--hjsc-brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.container--narrow {
  max-width: 28rem;
}

.container--wide {
  max-width: 52rem;
}

.container.container--narrow {
  max-width: 28rem;
}

/* Top bar */
.topbar {
  background: var(--hjsc-surface);
  border-bottom: 1px solid var(--hjsc-border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 90rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--hjsc-text);
  text-decoration: none;
}

.topbar__mark {
  display: flex;
  color: var(--hjsc-brand);
}

.topbar__brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.topbar__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.topbar__nav a {
  color: var(--hjsc-text);
  font-weight: 500;
}
.topbar__nav a:hover {
  color: var(--hjsc-accent);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Library shell */
.library-layout {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .library-layout {
    flex-direction: column;
  }

  .sidebar {
    flex: none;
    width: 100%;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--hjsc-border);
  }

  .library-toolbar {
    padding: 0.85rem 1rem;
  }

  .library-content {
    padding: 0 1rem 2rem;
  }
}

.sidebar {
  flex: 0 0 260px;
  width: 260px;
  max-width: 100%;
  min-height: 100vh;
  background: var(--hjsc-surface);
  border-right: 1px solid var(--hjsc-border);
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.sidebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--hjsc-text);
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.sidebar__brand:hover {
  color: var(--hjsc-text);
  text-decoration: none;
  opacity: 0.85;
}

.sidebar__mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hjsc-muted);
  margin: 1rem 0 0.5rem;
}

.sidebar__nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar__nav li {
  margin: 0.125rem 0;
}

.sidebar__nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: var(--hjsc-text);
  text-decoration: none;
}
.sidebar__nav li.active a {
  background: var(--hjsc-brand-soft);
  color: var(--hjsc-brand);
  font-weight: 600;
}
.sidebar__nav a:hover {
  background: var(--hjsc-bg);
  text-decoration: none;
}

.sidebar__badge {
  font-size: 0.7rem;
  background: var(--hjsc-bg);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  color: var(--hjsc-muted);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hjsc-border);
  font-size: 0.8125rem;
}

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

.sidebar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hjsc-brand), #5eb8ff);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar__username {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.25;
  word-break: break-word;
}

.sidebar__links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.sidebar__links a {
  color: var(--hjsc-muted);
  font-weight: 500;
}

.sidebar__logout {
  margin: 0;
}

.library-main {
  flex: 1 1 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--hjsc-bg);
}

.library-content {
  flex: 1;
  padding: 0 1.75rem 3rem;
  max-width: 100%;
}

/* Library top toolbar (breadcrumbs + search) */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.75rem;
  background: var(--hjsc-bg);
  border-bottom: 1px solid transparent;
}

.library-toolbar__title {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
}

.library-toolbar__left {
  min-width: 0;
}

.library-toolbar__right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.crumbs--toolbar {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.crumbs--toolbar a {
  color: var(--hjsc-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.crumbs--toolbar a:hover {
  background: rgb(0 0 0 / 0.04);
  text-decoration: none;
}

.crumbs__sep {
  color: #d4d4d4;
  user-select: none;
}

.crumbs__current {
  color: var(--hjsc-text);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
}

.pill-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--hjsc-surface);
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius-pill);
  padding: 0.35rem 0.65rem 0.35rem 0.85rem;
  min-width: min(320px, 86vw);
}

.pill-search--compact {
  min-width: min(260px, 70vw);
  padding: 0.3rem 0.55rem 0.3rem 0.65rem;
}

.pill-search__icon {
  display: flex;
  color: var(--hjsc-muted);
  flex-shrink: 0;
}

.pill-search__input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 0.35rem 0 !important;
  font-size: 0.875rem !important;
  box-shadow: none !important;
}

.pill-search__input:focus {
  outline: none !important;
}

.pill-search:focus-within {
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgb(13 153 255 / 0.12);
}

.pill-search__kbd {
  font-size: 0.65rem;
  font-family: inherit;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--hjsc-border);
  background: var(--hjsc-bg);
  color: var(--hjsc-muted);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--hjsc-border);
  background: var(--hjsc-surface);
  color: var(--hjsc-muted);
  cursor: not-allowed;
  opacity: 0.55;
}

/* Vault home hero */
.vault-hero {
  text-align: center;
  padding: 0.5rem 0 2rem;
  max-width: 52rem;
  margin: 0 auto;
}

.vault-hero__hi {
  font-size: 0.9375rem;
  color: var(--hjsc-muted);
  margin: 0 0 0.35rem;
}

.vault-hero__title {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  line-height: 1.15;
}

.hero-pill {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
  background: var(--hjsc-surface);
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius-pill);
  padding: 0.35rem 0.5rem 0.35rem 1rem;
  max-width: 44rem;
  margin: 0 auto;
  box-shadow: var(--hjsc-shadow);
}

.hero-pill__icon {
  display: flex;
  align-items: center;
  color: var(--hjsc-muted);
  margin-right: 0.35rem;
}

.hero-pill__input {
  flex: 1 1 180px;
  border: 0 !important;
  background: transparent !important;
  padding: 0.65rem 0.5rem !important;
  font-size: 0.9375rem !important;
  min-width: 0;
}

.hero-pill__input:focus {
  outline: none !important;
}

.hero-pill:focus-within {
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgb(13 153 255 / 0.1);
}

.hero-pill__divider {
  width: 1px;
  align-self: stretch;
  background: var(--hjsc-border);
  margin: 0.35rem 0.25rem;
}

.hero-pill__sort {
  border: 0 !important;
  background: transparent !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.875rem !important;
  font-weight: 600;
  cursor: pointer;
  color: var(--hjsc-text);
}

.grid--vault {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

@media (min-width: 1100px) {
  .grid--vault {
    grid-template-columns: repeat(5, 1fr);
  }
}

.vault-card {
  display: block;
  border-radius: var(--hjsc-radius);
  overflow: hidden;
  background: var(--hjsc-surface);
  border: 1px solid var(--hjsc-border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.vault-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.07);
  text-decoration: none;
}

.vault-card__thumb {
  aspect-ratio: 16 / 11;
  min-height: 140px;
  background: linear-gradient(145deg, #1c1917 0%, #44403c 50%, #57534e 100%);
  color: #fafafa;
  display: flex;
  align-items: flex-end;
  padding: 0.85rem;
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.vault-card__thumb--sm {
  aspect-ratio: 16 / 9;
  min-height: 72px;
  font-size: 0.75rem;
  padding: 0.5rem;
}

.vault-card__meta {
  padding: 0.85rem 0.9rem 1rem;
  text-align: left;
}

.vault-card__title {
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.vault-card__sub {
  font-size: 0.75rem;
  color: var(--hjsc-muted);
  margin-top: 0.25rem;
}

.vault-card--sm .vault-card__meta {
  padding-top: 0.5rem;
}

.grid--vault.grid--small {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* Main column (marketing / auth / admin) */
.main-column {
  padding: 2rem 0 4rem;
}

/* Panels & hero */
.panel {
  background: var(--hjsc-surface);
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius);
  padding: 1.5rem;
  box-shadow: var(--hjsc-shadow);
}

.panel + .panel {
  margin-top: 1.25rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 1rem;
}

.hero__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hjsc-muted);
  margin: 0 0 0.5rem;
}

.hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.15;
}

.hero__lead {
  font-size: 1.125rem;
  color: var(--hjsc-muted);
  max-width: 40rem;
  margin: 0 auto 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--hjsc-bg);
  color: var(--hjsc-text);
  text-decoration: none;
  font-family: inherit;
}
.btn:hover {
  filter: brightness(0.97);
  text-decoration: none;
}

.btn--primary {
  background: var(--hjsc-brand);
  color: #fff;
  border-color: var(--hjsc-brand);
}
.btn--primary:hover {
  background: var(--hjsc-accent-hover);
  border-color: var(--hjsc-accent-hover);
  color: #fff;
}

.btn--link {
  background: none;
  border: none;
  padding: 0;
  color: var(--hjsc-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.btn--link:hover {
  color: var(--hjsc-brand);
}

.btn--tiny {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn--live {
  position: relative;
  padding-left: 1.85rem;
}

.btn--live::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hjsc-live);
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.25);
}

.btn--ghost {
  background: transparent;
  border-color: var(--hjsc-border);
}

.btn--danger {
  background: #fef2f2;
  color: var(--hjsc-danger);
  border-color: #fecaca;
}
.btn--danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.btn--small {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}

.btn--large {
  padding: 0.7rem 1.35rem;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

/* Forms */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack label,
.field label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--hjsc-border);
  border-radius: 8px;
  background: var(--hjsc-surface);
  color: var(--hjsc-text);
  width: 100%;
  max-width: 100%;
}

select {
  width: auto;
  min-width: 8rem;
}

textarea {
  resize: vertical;
  min-height: 6rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgb(13 153 255 / 0.35);
  outline-offset: 1px;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.input--narrow {
  max-width: 7rem;
}

/* Banners */
.banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.banner--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.banner--ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.banner--warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* Library index */
.page-head {
  margin-bottom: 1.5rem;
}

.page-head__hi {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hjsc-muted);
  margin: 0 0 0.25rem;
}

.page-head__title {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.search-row__input {
  flex: 1 1 200px;
  min-width: 0;
}

.search-row__sort {
  flex: 0 0 auto;
}

/* Card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.grid--small {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.card {
  display: block;
  background: var(--hjsc-surface);
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius);
  overflow: hidden;
  box-shadow: var(--hjsc-shadow);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover {
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
  transform: translateY(-1px);
  text-decoration: none;
}

.card__thumb {
  min-height: 120px;
  background: linear-gradient(135deg, #18181b, #52525b);
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.card__thumb--sm {
  min-height: 64px;
  font-size: 0.8rem;
}

.card__meta {
  padding: 0.75rem;
}

.card__title {
  font-weight: 600;
  font-size: 0.95rem;
}

.card__sub {
  font-size: 0.8rem;
  color: var(--hjsc-muted);
  margin-top: 0.2rem;
}

/* Resource detail */
.detail__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.crumbs {
  font-size: 0.875rem;
  color: var(--hjsc-muted);
  margin: 0 0 1rem;
}
.crumbs a {
  color: var(--hjsc-muted);
}
.crumbs span {
  margin: 0 0.35rem;
}

.preview-frame iframe {
  width: 100%;
  height: min(520px, 70vh);
  border: 1px solid var(--hjsc-border);
  border-radius: 8px;
  background: #fff;
}

.detail__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .detail__cols {
    grid-template-columns: 1fr 240px;
  }
}

.code-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.code-block {
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius);
  background: var(--hjsc-surface);
  overflow: hidden;
}

.code-block__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--hjsc-border);
  font-size: 0.8rem;
  font-weight: 600;
}

.code-block__pre {
  margin: 0;
  padding: 0.75rem;
  max-height: 360px;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.45;
}

.aside-card {
  font-size: 0.9rem;
  padding: 1rem;
  background: var(--hjsc-surface);
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius);
}

.aside-card dt {
  font-size: 0.75rem;
  color: var(--hjsc-muted);
  margin-top: 0.65rem;
}
.aside-card dt:first-child {
  margin-top: 0;
}
.aside-card dd {
  margin: 0.15rem 0 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: var(--hjsc-bg);
  border-radius: 999px;
  color: var(--hjsc-muted);
}

.related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hjsc-border);
}

.related h2 {
  font-size: 1.125rem;
  margin: 0 0 1rem;
}

.rich img {
  max-width: 100%;
  height: auto;
}

/* Account split */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

/* Admin */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.stat {
  background: var(--hjsc-surface);
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--hjsc-shadow);
}

.stat__n {
  font-size: 1.75rem;
  font-weight: 700;
}

.stat__l {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hjsc-muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  border-bottom: 1px solid var(--hjsc-border);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hjsc-muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
}

.muted {
  color: var(--hjsc-muted);
}

.fine {
  font-size: 0.8rem;
  color: var(--hjsc-muted);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.price-card {
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius);
  padding: 1.25rem;
  background: var(--hjsc-surface);
  box-shadow: var(--hjsc-shadow);
}

.price-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.nested-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--hjsc-bg);
  border-radius: 8px;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.2rem;
  margin: 1.25rem 0 0.75rem;
}

h3,
.panel h2:first-child {
  margin-top: 0;
}

.danger-zone {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--hjsc-border);
}

/* Resource detail — vault styling */
.detail__title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
}

.detail__lede {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  max-width: 42rem;
}

.preview-frame--vault iframe {
  border-radius: var(--hjsc-radius);
  border: 1px solid var(--hjsc-border);
}

.doc-block {
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.doc-block h2,
.doc-block h3 {
  margin-top: 1.5rem;
}

.code-block--vault {
  border-radius: var(--hjsc-radius);
  box-shadow: var(--hjsc-shadow);
}

.aside-card--vault {
  padding: 1.1rem 1.15rem;
}

.aside-card__h {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.aside-dl dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hjsc-muted);
  margin-top: 0.75rem;
}

.aside-dl dt:first-child {
  margin-top: 0;
}

.aside-dl dd {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tag-pill {
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  background: var(--hjsc-bg);
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius-pill);
  color: var(--hjsc-muted);
}

.author-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hjsc-border);
}

.author-block__avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--hjsc-bg);
  border: 1px solid var(--hjsc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--hjsc-muted);
}

.author-block__name {
  font-weight: 600;
  font-size: 0.875rem;
}

.related--vault {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hjsc-border);
}

.related__h {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

/* --- Accessibility --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sidebar modal triggers (match link styling) */
.sidebar__modal-trigger {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--hjsc-muted);
  font-weight: 500;
}
.sidebar__modal-trigger:hover {
  color: var(--hjsc-text);
  text-decoration: underline;
}

body.hjsc-modal-open {
  overflow: hidden;
}

/* Admin iframe pages */
body.hjsc-embed {
  min-height: 100vh;
}
body.hjsc-embed .container {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

/* Admin two-column shell (left nav + content), mirrors account sheet-modal */
.admin-sheet-wrap {
  max-width: 90rem;
}

.container.container--wide.admin-sheet-wrap {
  max-width: 90rem;
}

.admin-sheet {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: min(70vh, 720px);
}

.admin-sheet__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.25rem 0.75rem 1rem 0;
  border-right: 1px solid var(--hjsc-border);
  min-width: 10.5rem;
  flex-shrink: 0;
}

.admin-sheet__link {
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hjsc-muted);
  text-decoration: none;
}

.admin-sheet__link:hover {
  color: var(--hjsc-text);
  background: var(--hjsc-bg);
  text-decoration: none;
}

.admin-sheet__link.is-active {
  color: var(--hjsc-text);
  background: var(--hjsc-brand-soft);
  box-shadow: inset 0 0 0 1px rgb(13 153 255 / 0.15);
}

.admin-sheet__link--export {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hjsc-border);
  font-weight: 600;
}

.admin-sheet__main {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 1.25rem;
}

.admin-sheet__main .panel {
  margin: 0;
}

@media (max-width: 720px) {
  .admin-sheet {
    flex-direction: column;
  }
  .admin-sheet__nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--hjsc-border);
    padding: 0 0 0.75rem;
    min-width: 0;
  }
  .admin-sheet__link--export {
    margin-top: 0;
    padding-top: 0.45rem;
    border-top: 0;
    border-left: 1px solid var(--hjsc-border);
    padding-left: 0.75rem;
    margin-left: 0.25rem;
  }
  .admin-sheet__main {
    padding-left: 0;
    padding-top: 1rem;
  }
}

/* Account + Admin overlays */
.hjsc-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.hjsc-modal-root[aria-hidden="false"] {
  pointer-events: auto;
}

.hjsc-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.hjsc-modal[hidden] {
  display: none !important;
}

.hjsc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  cursor: pointer;
}

.hjsc-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: min(90vh, 900px);
  background: var(--hjsc-surface);
  border-radius: var(--hjsc-radius);
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.12), 0 0 0 1px var(--hjsc-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hjsc-modal__dialog--sheet {
  max-width: 52rem;
}

.hjsc-modal__dialog--wide {
  max-width: min(96vw, 72rem);
  max-height: min(92vh, 960px);
}

.hjsc-modal__chrome {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5rem 0.65rem 0;
}

.hjsc-modal__chrome--row {
  justify-content: space-between;
  padding-left: 1rem;
  padding-right: 0.65rem;
  padding-top: 0.75rem;
}

.hjsc-modal__heading {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.hjsc-modal__close {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hjsc-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.hjsc-modal__close:hover {
  background: var(--hjsc-bg);
  color: var(--hjsc-text);
}

.hjsc-modal__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 1.25rem 1.25rem;
}

.hjsc-modal__iframe {
  display: block;
  width: 100%;
  flex: 1;
  min-height: min(70vh, 640px);
  border: 0;
  background: var(--hjsc-bg);
}

.hjsc-modal__dialog--wide .hjsc-modal__chrome + .hjsc-modal__iframe {
  margin-top: 0;
}

/* Account sheet (modal fragment + full page) */
.account-sheet--fragment {
  max-width: none;
}

.sheet-modal {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 280px;
}

.sheet-modal__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.25rem 0.75rem 1rem 0;
  border-right: 1px solid var(--hjsc-border);
  min-width: 9.5rem;
  flex-shrink: 0;
}

.sheet-modal__tab {
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hjsc-muted);
  cursor: pointer;
}

.sheet-modal__tab:hover {
  color: var(--hjsc-text);
  background: var(--hjsc-bg);
}

.sheet-modal__tab.is-active {
  color: var(--hjsc-text);
  background: var(--hjsc-brand-soft);
  box-shadow: inset 0 0 0 1px rgb(13 153 255 / 0.15);
}

.sheet-modal__body {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 1.25rem;
}

.sheet-modal__title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.sheet-modal__subtitle {
  margin: 1.25rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.sheet-modal__form {
  margin-top: 0.5rem;
}

.sheet-modal__divider {
  margin: 1.75rem 0 1rem;
  border: 0;
  border-top: 1px solid var(--hjsc-border);
}

.sheet-modal__panel.is-active {
  display: block;
}

@media (max-width: 640px) {
  .sheet-modal {
    flex-direction: column;
  }
  .sheet-modal__nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--hjsc-border);
    padding: 0 0 0.75rem;
    min-width: 0;
  }
  .sheet-modal__body {
    padding-left: 0;
    padding-top: 1rem;
  }
}

/* Admin — resources list header */
.admin-resources-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.table__narrow {
  width: 4.25rem;
}

/* Admin — resource editor */
.resource-edit__intro {
  margin-bottom: 1.5rem;
}

.resource-edit__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.resource-edit__permalink {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.resource-edit__permalink-link {
  font-size: 0.875rem;
  word-break: break-all;
}

.resource-edit__hint {
  margin: 0;
}

.resource-edit__form.stack {
  gap: 0;
}

.resource-edit__section {
  border: 1px solid var(--hjsc-border);
  border-radius: var(--hjsc-radius);
  padding: 1.15rem 1.25rem 1.35rem;
  margin: 0 0 1.25rem;
  background: var(--hjsc-surface);
  box-shadow: var(--hjsc-shadow);
}

.resource-edit__legend {
  padding: 0 0.4rem;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hjsc-muted);
}

.resource-edit__section-lede {
  margin: -0.25rem 0 1rem;
}

.resource-edit__grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.resource-edit__grid:last-child {
  margin-bottom: 0;
}

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

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

@media (max-width: 768px) {
  .resource-edit__grid--2,
  .resource-edit__grid--3 {
    grid-template-columns: 1fr;
  }
}

.resource-edit select.input {
  width: 100%;
  min-width: 0;
}

.resource-edit .input--code {
  font-size: 0.8125rem;
  line-height: 1.5;
  min-height: 8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.resource-edit__code-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 960px) {
  .resource-edit__code-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.resource-edit__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0 0.75rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--hjsc-border);
  background: var(--hjsc-surface);
  position: sticky;
  bottom: 0;
  z-index: 3;
}

.resource-edit__save {
  min-width: 10rem;
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}

.resource-edit__danger {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
}

.resource-edit__back {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
}

/* Admin iframe — overlay dialogs (categories / users) */
body.admin-dialog-open {
  overflow: hidden;
}

.admin-dialog {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.admin-dialog[hidden] {
  display: none !important;
}

.admin-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  cursor: pointer;
}

.admin-dialog__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  max-height: min(90vh, 640px);
  overflow: auto;
  background: var(--hjsc-surface);
  border-radius: var(--hjsc-radius);
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.14), 0 0 0 1px var(--hjsc-border);
  padding: 1.25rem 1.35rem 1.35rem;
}

.admin-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-dialog__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-dialog__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hjsc-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.admin-dialog__close:hover {
  background: var(--hjsc-bg);
  color: var(--hjsc-text);
}

.admin-dialog__form.stack {
  gap: 1rem;
}

.admin-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.admin-dialog select.input {
  width: 100%;
  min-width: 0;
}

.admin-categories__hint {
  margin: 0 0 1.25rem;
}

.admin-table__actions {
  white-space: nowrap;
}

.admin-table__actions--wrap {
  white-space: normal;
  vertical-align: top;
}

.admin-table__actions .btn--small {
  padding: 0.35rem 0.65rem;
}

.admin-table__inline-form {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}

.admin-table__title {
  font-weight: 600;
}

.admin-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--hjsc-bg);
  border: 1px solid var(--hjsc-border);
  color: var(--hjsc-muted);
}

.admin-grant-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-right: 0.35rem;
  margin-bottom: 0.25rem;
}

.admin-grant-form__days {
  width: 4.5rem;
  min-width: 0;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.field-label .fine {
  font-weight: 400;
}
