.ggc-shelf-app {
  --ggc-primary: #ff8a00;
  --ggc-dark: #101827;
  --ggc-accent: #00a878;
  --ggc-border: #dde5ef;
  --ggc-muted: #64748b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px;
}

.ggc-shelf-app * {
  box-sizing: border-box;
}

.ggc-shelf-loading,
.ggc-empty,
.ggc-error {
  padding: 24px;
  border: 1px solid var(--ggc-border);
  border-radius: 16px;
  background: #fff;
}

.ggc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.ggc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ggc-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ggc-primary);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.ggc-logo::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 3px solid #334155;
  border-radius: 8px;
}

.ggc-brand strong,
.ggc-brand span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ggc-brand span {
  color: var(--ggc-muted);
  font-size: .9rem;
}

.ggc-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ggc-btn {
  min-height: 44px;
  border: 1px solid var(--ggc-border);
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.ggc-btn.primary {
  background: var(--ggc-primary);
  border-color: var(--ggc-primary);
  color: #07111f;
}

.ggc-btn.accent {
  background: var(--ggc-accent);
  border-color: var(--ggc-accent);
  color: #fff;
}

.ggc-hero {
  border-radius: 22px;
  background: var(--ggc-dark);
  color: #fff;
  padding: clamp(24px, 5vw, 56px);
  margin-bottom: 22px;
}

.ggc-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 1;
  color: var(--ggc-primary);
}

.ggc-hero h2 {
  margin: 0 0 18px;
  color: var(--ggc-accent);
  font-size: clamp(1.25rem, 4vw, 2rem);
}

.ggc-hero p {
  max-width: 760px;
  line-height: 1.65;
  font-size: 1.05rem;
}

.ggc-panel {
  border: 1px solid var(--ggc-border);
  border-radius: 20px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
}

.ggc-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.ggc-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 240px);
  gap: 12px;
  margin: 20px 0;
}

.ggc-input,
.ggc-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ggc-border);
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
}

.ggc-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.ggc-card {
  border: 1px solid var(--ggc-border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}

.ggc-cover {
  min-height: 190px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
}

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

.ggc-card-body {
  padding: 16px;
}

.ggc-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ggc-badge {
  border: 1px solid #fed7aa;
  color: #c2410c;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .82rem;
  font-weight: 900;
}

.ggc-badge.neutral {
  border-color: #cbd5e1;
  color: #334155;
}

.ggc-card h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.15;
}

.ggc-card p,
.ggc-detail p {
  color: #334155;
  line-height: 1.55;
}

.ggc-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.ggc-detail-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 22px;
}

.ggc-detail-cover {
  border: 1px solid var(--ggc-border);
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafc;
}

.ggc-detail-cover img {
  width: 100%;
  display: block;
}

.ggc-reader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #e5e7eb;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ggc-reader-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--ggc-border);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.ggc-reader-title {
  min-width: 0;
}

.ggc-reader-title strong,
.ggc-reader-title span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ggc-reader-title span {
  font-size: .8rem;
  color: var(--ggc-muted);
}

.ggc-reader-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.ggc-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: 1px solid var(--ggc-border);
  border-radius: 12px;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.ggc-page-input {
  width: 56px;
  height: 40px;
  border: 1px solid var(--ggc-border);
  border-radius: 12px;
  text-align: center;
  font-weight: 900;
}

.ggc-reader-stage {
  overflow: auto;
  touch-action: none;
  -ms-touch-action: none;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}

.ggc-reader-stage.is-panning {
  cursor: grabbing;
}

.ggc-pages {
  width: max-content;
  min-width: 100%;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 18px;
}

.ggc-page {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .16);
  overflow: hidden;
}

.ggc-page canvas {
  display: block;
  max-width: none;
}

.ggc-more-wrap {
  position: relative;
}

.ggc-more-menu {
  position: fixed;
  display: none;
  width: min(300px, calc(100vw - 20px));
  max-height: calc(100dvh - 90px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--ggc-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(15,23,42,.22);
  z-index: 1000000;
}

.ggc-more-menu.open {
  display: grid;
  gap: 6px;
}

.ggc-more-menu button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ggc-more-menu button:hover {
  background: #f1f5f9;
}

.ggc-reader.dark {
  background: #0f172a;
}

.ggc-reader.dark .ggc-reader-toolbar,
.ggc-reader.dark .ggc-more-menu {
  background: #111827;
  color: #f8fafc;
  border-color: #334155;
}

@media (max-width: 720px) {
  .ggc-shelf-app {
    padding: 12px;
  }

  .ggc-topbar {
    align-items: flex-start;
  }

  .ggc-logo {
    width: 44px;
    height: 44px;
  }

  .ggc-brand strong {
    max-width: calc(100vw - 110px);
  }

  .ggc-toolbar,
  .ggc-detail-layout {
    grid-template-columns: 1fr;
  }

  .ggc-card-actions {
    grid-template-columns: 1fr;
  }

  .ggc-reader-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ggc-reader-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(112px, 1fr) 44px;
    width: 100%;
  }

  .ggc-fit-btn {
    display: none;
  }

  .ggc-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .ggc-reader-stage {
    min-height: calc(100dvh - 112px);
  }

  .ggc-pages {
    padding: 12px 8px 64px;
  }
}

@media (max-width: 380px) {
  .ggc-reader-controls {
    grid-template-columns: minmax(84px, auto) minmax(104px, 1fr) 42px;
    gap: 3px;
  }

  .ggc-page-input {
    width: 38px;
  }
}

