/* ------------------------------------------------------------------
   WARNain Studio — Minimalist Modern SaaS UI
   ------------------------------------------------------------------ */

@font-face {
  font-family: 'Nunito Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('/assets/nunito-latin.woff2') format('woff2-variations');
}

:root {
  --font-sans: 'Nunito Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #94a3b8;
  --brand: #d4402c;
  --brand-hover: #b93725;
  --brand-soft: #fef2f2;
  --brand-border: #fecaca;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --green-border: #bbf7d0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 44px -12px rgba(15, 23, 42, 0.22);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Topbar Minimalis --- */
.topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  height: 28px;
  width: auto;
  aspect-ratio: 400 / 79;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
}

.brand-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.topbar-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-muted);
}

.status-pill.is-active {
  background: var(--green-soft);
  border-color: var(--green-border);
  color: var(--green);
}

.status-pill.is-active .status-dot {
  background: #22c55e;
}

.status-pill.is-alert {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
}

.status-pill.is-alert .status-dot {
  background: var(--brand);
}

/* --- Quota Pill & User Menu --- */
.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.quota-pill:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.quota-pill.is-low {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.quota-pill.is-full {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.user-chip:hover {
  border-color: var(--border-strong);
  background: var(--bg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 248px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 80;
}

.profile-dd-head {
  padding: 10px 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}

.profile-dd-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dd-email {
  font-size: 11.5px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.profile-dd-item:hover {
  background: var(--surface-subtle);
}

.profile-dd-item.danger {
  color: #dc2626;
}

.profile-dd-item.danger:hover {
  background: #fef2f2;
}

.profile-dd-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-dd-sep {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}

/* --- Profile Page Layout --- */
.profile-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
}

.profile-card h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.profile-card-sub {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12.5px;
}

.order-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Login Screen Minimalis --- */
.auth-wrap {
  max-width: 400px;
  margin: 48px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}

.auth-head {
  text-align: center;
  margin-bottom: 24px;
}

.auth-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-secondary);
}

.btn-google {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: var(--shadow-xs);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-account-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.google-account-btn:hover {
  border-color: var(--ink);
  background: var(--bg);
}

/* --- Quota Bar & Summary Box --- */
.quota-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
  margin: 10px 0;
}

.quota-bar-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.quota-bar-fill.is-warn {
  background: #d97706;
}

.quota-bar-fill.is-full {
  background: var(--brand);
}

.quota-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 14px;
  font-size: 12.5px;
}

.quota-banner.is-blocked {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: #991b1b;
}

.sim-reset-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.sim-reset-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* --- Footer Minimalis --- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 0;
  font-size: 12px;
  color: var(--ink-secondary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 700;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #1e293b;
}

.btn-accent {
  background: var(--brand);
  color: #ffffff;
}

.btn-accent:hover:not(:disabled) {
  background: var(--brand-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-subtle);
  color: var(--ink);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--ink-secondary);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: #fef2f2;
  color: #dc2626;
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
}

/* --- App Main --- */
.app-main {
  padding-top: 28px;
  padding-bottom: 96px;
}

.loading-state {
  padding: 64px 16px;
  text-align: center;
  color: var(--ink-secondary);
  font-weight: 600;
}

/* --- Alert Strip --- */
.notice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
}

/* --- Dashboard Header --- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--ink-secondary);
  font-size: 13.5px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Books Grid --- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.book-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.book-stage {
  background: #f1f5f9;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.book-sheet-thumb {
  width: 112px;
  aspect-ratio: 210 / 297;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.book-sheet-thumb::after {
  content: '';
  position: absolute;
  inset: 5px;
  pointer-events: none;
  border-radius: 2px;
}

.book-sheet-thumb.b-simple::after { border: 1.5px solid #0f172a; }
.book-sheet-thumb.b-double::after { border: 3px double #0f172a; }
.book-sheet-thumb.b-rounded::after { border: 1.5px solid #0f172a; border-radius: 10px; }
.book-sheet-thumb.b-dashed::after { border: 1.5px dashed #334155; }

.book-sheet-thumb-title {
  font-size: 7.5px;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  color: var(--ink);
  max-height: 20px;
  overflow: hidden;
}

.book-sheet-thumb img {
  width: 78%;
  height: 62%;
  object-fit: contain;
}

.book-sheet-thumb-owner {
  font-size: 6.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.book-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.book-card-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.meta-dot::before {
  content: '·';
  margin-right: 6px;
  color: var(--ink-muted);
}

.book-card-foot {
  padding: 10px 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.book-card-new {
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  cursor: pointer;
  color: var(--ink-secondary);
  gap: 10px;
  font-weight: 700;
}

.book-card-new:hover {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
}

/* --- Builder Workspace --- */
.builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.builder-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.builder-title-group h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.builder-sub {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.studio-tabs {
  display: inline-flex;
  background: var(--surface-subtle);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  gap: 2px;
}

.studio-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.studio-tab:hover {
  color: var(--ink);
}

.studio-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}

/* --- Catalog Filters --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-wrap .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.input,
.select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-wrap .input {
  padding-left: 34px;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.cat-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  scrollbar-width: thin;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}

.pill-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.pill-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.pill-count {
  font-size: 11px;
  opacity: 0.7;
}

.subcat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  max-height: 118px;
  overflow-y: auto;
}

.sub-pill {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sub-pill:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

.sub-pill.active {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 800;
}

/* --- Image Grid --- */
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
}

.art-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.art-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.art-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.art-thumb {
  aspect-ratio: 3 / 4;
  background: #fafafa;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.art-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.art-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.art-zoom-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  box-shadow: var(--shadow-xs);
}

.art-card:hover .art-zoom-btn,
.art-zoom-btn:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .art-zoom-btn {
    opacity: 1;
  }
}

.art-zoom-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

/* --- Lightbox Preview Modal --- */
.lightbox-stage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: min(64vh, 560px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  cursor: zoom-in;
}

.lightbox-stage.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  cursor: zoom-out;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease;
}

.lightbox-stage.is-zoomed img {
  max-width: none;
  max-height: none;
  width: 165%;
  height: auto;
  margin: auto;
}

.lightbox-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.art-foot {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.art-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Custom Upload Tab --- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--ink);
  background: #f1f5f9;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.dropzone h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.dropzone p {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.custom-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.custom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.custom-row img {
  width: 46px;
  height: 60px;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
}

/* --- Border & Layout Settings Tab --- */
.settings-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}

.field-hint {
  font-size: 11.5px;
  color: var(--ink-secondary);
  margin-top: 4px;
}

.border-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
}

.border-choice {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  transition: all 0.15s;
}

.border-choice:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.border-choice.active {
  border-color: var(--ink);
  background: var(--bg);
  color: var(--ink);
}

.border-demo {
  width: 42px;
  height: 54px;
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
  position: relative;
}

.border-demo::after {
  content: '';
  position: absolute;
  inset: 5px;
}

.border-demo.d-none::after { border: 1px dotted #cbd5e1; }
.border-demo.d-simple::after { border: 1.5px solid #0f172a; }
.border-demo.d-double::after { border: 3px double #0f172a; }
.border-demo.d-rounded::after { border: 1.5px solid #0f172a; border-radius: 8px; }
.border-demo.d-dashed::after { border: 1.5px dashed #0f172a; }

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 2px;
  background: transparent;
}

.swatch-btn.active {
  border-color: var(--ink);
}

.swatch-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
}

.toggle-row input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
  cursor: pointer;
}

.mini-preview-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.mini-preview-box canvas {
  width: 100%;
  max-width: 240px;
  height: auto;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.2);
}

/* --- Right Panel: Susunan Halaman --- */
.drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.drawer-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 2px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.drawer-item.is-special {
  background: var(--bg);
}

.drawer-item img {
  width: 34px;
  height: 44px;
  object-fit: contain;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}

.drawer-thumb-badge {
  width: 34px;
  height: 44px;
  border-radius: 4px;
  background: var(--ink);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.drawer-meta {
  flex: 1;
  min-width: 0;
}

.drawer-kicker {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.tag-custom {
  color: var(--brand);
  font-weight: 800;
}

.drawer-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-ctrls {
  display: flex;
  gap: 2px;
}

.mini-icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-icon-btn:hover:not(:disabled) {
  background: var(--surface-subtle);
  color: var(--ink);
}

.mini-icon-btn.danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.mini-icon-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* --- Modals --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-secondary);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.plan-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.plan-card:hover {
  border-color: var(--border-strong);
}

.plan-card.selected {
  border-color: var(--ink);
  background: var(--bg);
}

.plan-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

.plan-card.selected .plan-tag {
  background: var(--ink);
  color: #ffffff;
}

.plan-price {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 6px 0 10px;
}

.plan-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* --- Preview PDF Sheets --- */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  padding: 16px;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  max-height: 60vh;
  overflow-y: auto;
}

.sheet-card {
  background: #ffffff;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.sheet-card canvas {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #f1f5f9;
}

.sheet-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Floating Prototype Dock (Minimalis di Pojok Bawah) --- */
.sim-dock {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  color: #e2e8f0;
  box-shadow: 0 10px 24px -6px rgba(15, 23, 42, 0.35);
}

.sim-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sim-seg {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 2px;
}

.sim-seg-btn {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.sim-seg-btn:hover {
  color: #ffffff;
}

.sim-seg-btn.active {
  background: #ffffff;
  color: #0f172a;
}
