/* Per-guide page width presets (override .page-wrap{max-width:1200px} via higher specificity). */
.page-wrap.guide-width--normal { max-width: 1200px; }
.page-wrap.guide-width--wide   { max-width: min(1320px, 100%); }
.page-wrap.guide-width--full   { max-width: min(1600px, 100%); }
.guide-content-wrap { max-width: 100%; }
.guide-width--normal .guide-content-wrap { max-width: 80ch; }

.guide-category { margin-bottom: 2rem; }
.guide-category__title { margin-bottom: .75rem; }
.guide-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.guide-card { display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; transition: border-color .15s; }
.guide-card:hover { border-color: rgba(255,255,255,.35); }
.guide-card__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.guide-card__body { padding: .75rem 1rem; }
.guide-card__title { margin: 0 0 .25rem; font-size: 1.05rem; }
.guide-card__excerpt { margin: 0; font-size: .85rem; opacity: .75; }
.guide-category-tag { text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; opacity: .7; }
.guide-content :is(img) { max-width: 100%; height: auto; border-radius: 8px; }
.guide-content details { border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: .5rem .75rem; margin: 1rem 0; }
.guide-content summary { cursor: pointer; font-weight: 600; }
.guide-content table { border-collapse: collapse; width: 100%; }
.guide-content th, .guide-content td { border: 1px solid rgba(255,255,255,.15); padding: .4rem .6rem; }
.guides-empty { opacity: .7; }

/* Manage */
.guides-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.guides-table th, .guides-table td { text-align: left; padding: .5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.guides-dialog { width: min(820px, 92vw); border: 1px solid var(--panel-border, rgba(255,255,255,.12)); border-radius: 12px; padding: 1.5rem; transition: width .15s ease; background: var(--surface-1, #16191e); color: var(--text, #e8ebf0); }
.guides-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.guides-dialog input[type=text], .guides-dialog input[type=number], .guides-dialog textarea, .guides-dialog select {
  background: var(--bg-1, #0e131a); color: var(--text, #e8ebf0);
  border: 1px solid var(--hairline-strong, rgba(255,255,255,.10)); border-radius: 6px; padding: .4rem .5rem;
}
/* Dialog grows toward the viewport to match the chosen page-width preset, so the live preview is true-to-size. */
.guides-dialog.gm-width--wide { width: min(1320px, 95vw); }
.guides-dialog.gm-width--full { width: min(1600px, 95vw); }
.guides-dialog label { display: block; margin: .6rem 0; }
.guides-dialog input[type=text], .guides-dialog textarea, .guides-dialog select { width: 100%; }
.guides-preview { border: 1px dashed rgba(255,255,255,.2); padding: 1rem; border-radius: 8px; min-height: 80px; }
/* Mirror the real page's reading measure: 'normal' caps the preview content the same way .guide-width--normal does. */
.guides-dialog.gm-width--normal .guides-preview { max-width: 80ch; margin-inline: auto; }
.gm-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.gm-upload-row { display: flex; gap: .5rem; align-items: center; margin: .6rem 0; }
.gm-upload-result-row { display: flex; gap: .5rem; align-items: center; margin: .4rem 0 .6rem; }
.gm-upload-result-row #gm-upload-url { flex: 1; font-family: ui-monospace, monospace; font-size: .8rem; }
.gm-upload-copy, #gm-upload-copy { white-space: nowrap; }
.gm-error { color: #e0564b; }
.button.danger { color: #e0564b; }
