/* ==========================================================================
   DESIGN TOKENS (CSS VARIABLES)
   ========================================================================== */

/* THEME: Heritage Slate (The classic, blocky 2021 default) */
:root,
.theme-heritage-slate {
  /* Colors - Core */
  --color-primary: #1e293b;
  --color-primary-dark: #0f172a;
  --color-secondary: #55647a;
  --color-secondary-opt: #4e5c70;

  
  /* Colors - Accents */
  --color-accent: #38bdf8;
  --color-accent-light: #7dd3fc;
  
  /* Colors - Surfaces & Backgrounds */
  --color-bg: #f1f5f9;
  --color-surface: #fff;
  --color-surface-alt: #f8fafc;
  
  /* Colors - Text */
  --color-text: #334155;
  --color-text-dark: #222;
  --color-text-muted: #94a3b8;
  --color-border: #cbd5e1;
  --color-border-light: #eee;

  /* Colors - Status / Semantic */
  --color-info: #0ea5e9;
  --color-info-hover: #0284c7;
  --color-success: #16a34a;
  --color-success-hover: #15803d;
  --color-success-bg: #d1fae5;
  --color-success-text: #065f46;
  --color-warning: #eab308;
  --color-warning-hover: #ca8a04;
  --color-warning-bg: #fef08a;
  --color-warning-text: #854d0e;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-danger-bg: #fee2e2;
  --color-danger-light: #fca5a5;
  --color-danger-text: #b91c1c;
  --color-neutral: #64748b;
  --color-neutral-hover: #475569;
  --color-link: #2a6496;
  --color-link-hover: #1a4a76;
  --color-focus: #38bdf8;
  --radius-md: 6px;
  --radius-lg: 8px;
  
  /* Shadows */
  --shadow-base: 0 0 10px rgba(0,0,0,0.1);
}

/* =========================================================================
   AI / DEVELOPER INSTRUCTIONS: STRICT OOCSS ARCHITECTURE
   =========================================================================
   Do NOT append new bespoke CSS classes to the bottom of this file. 
   1. Search for existing utility classes first (e.g., .btn, .btn--primary).
   2. Keep new classes modular, semantic, and reusable.
   3. Refrain from randomly tacking on styles for one-off elements unless absolutely necessary.
   ========================================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--color-surface-alt);
  color: var(--color-primary-dark);
}

.page {
  max-width: 900px;
  margin: 0 auto;
  background: var(--color-surface);
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  background: var(--color-primary-dark);
  color: var(--color-surface-alt);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.page-auth {
  background: transparent;
}
.topbar-auth {
  max-width: 420px;
  margin: 0 auto;
  border-bottom: 1px solid var(--color-border-light);
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  justify-content: center;
}
.site-banner {
  background: var(--color-primary-dark);
  text-align: center;
  padding: 6px 20px;
  border-bottom: 2px solid var(--color-accent);
}
.site-logo {
  max-width: 100%;
  height: auto;
  max-height: 70px; /* Keep it from taking over the whole screen on massive desktop monitors */
  display: block;
  margin: 0 auto;
  transition: filter 0.2s ease;
}
a:hover .site-logo {
  filter: brightness(1.25);
}

.home-link {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: var(--color-surface-alt);
  text-decoration: none;
}
.home-link:hover {
  color: var(--color-accent-light);
  text-decoration: none;
}

.topbar h1 {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: inherit;
}

.topbar-links a {
  color: var(--color-surface-alt);
  text-decoration: none;
  margin-left: 16px;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.topbar-links a:hover { color: var(--color-accent-light); opacity: 1; text-decoration: none; }

/* TOOLBAR STRUCTURAL BUCKETS (OOCSS) */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* BOARD ACTIONS THEME */
.console-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
}
.console-cell {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}
.console-cell--top {
  border-bottom: 1px solid var(--color-border);
}
.console-cell--right {
  justify-content: flex-end;
}
.action-group {
  display: flex;
  align-items: center;
  gap: 16px;
}
.action-checkbox {
  margin: 0;
  font-size: 14px;
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--color-text);
}

/* OOCSS COMPONENTS & UTILITIES */
.card-panel {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}
.mx-4 { margin-left: 16px; margin-right: 16px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.text-sm { font-size: 13px; }
.text-md { font-size: 15px; }
.filter-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-label {
  font-weight: normal;
  font-size: 14px;
  color: var(--color-text);
}
.filter-option {
  font-weight: normal;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-dark);
}

/* NOTICE BANNER */
.notice {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-hover);
  color: var(--color-success-text);
  padding: 8px 16px;
  font-size: 13px;
}

/* ==========================================================================
   GLOBAL NOTIFICATION BANNERS
   ========================================================================== */
.alert-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}
.alert-banner span {
  flex: 1;
}
.alert-banner hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 10px 0;
}

.alert-banner--welcome {
  background: var(--color-link);
  color: var(--color-surface);
  border: 1px solid var(--color-link-hover);
}
.alert-banner--welcome a {
  color: var(--color-surface);
  text-decoration: underline;
  font-weight: bold;
}
.alert-banner--welcome a:hover {
  color: var(--color-surface-alt);
}


.banner-dismiss {
  font-size: 24px;
  line-height: 1;
  font-weight: bold;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  transition: all 0.2s;
  flex-shrink: 0;
}
.banner-dismiss:hover {
  background: var(--color-danger);
  color: var(--color-surface);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* EMPTY STATE */
.empty-state {
  padding: 16px;
}

/* POST ROW (ROBUST FLEX COLUMNS) */
.post-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  background: transparent;
  column-gap: 16px;
  margin-bottom: 24px;
}
/* COLUMN CONTAINERS */
.post-left {
  display: flex;
  flex-direction: column;
  border-left: 8px solid transparent;
}
.post-right {
  display: flex;
  flex-direction: column;
}
/* STRETCH FILLERS */
.author-contact, .post-content-wrap {
  flex-grow: 1;
}

/* STATUS MODIFIERS (Applied to Left Column) */
.status-pinned .post-left { border-left-color: var(--color-warning); }
.status-sold .post-left { border-left-color: var(--color-neutral); }
.status-expired .post-left { border-left-color: var(--color-danger); }
.status-hot .post-left { border-left-color: var(--color-text-dark); }

.status-tag { font-weight: 800; margin-right: 8px; }
.status-pinned .status-tag { color: var(--color-warning); }
.status-sold .status-tag { color: var(--color-border); }
.status-expired .status-tag { color: var(--color-danger-light); }

/* LEFT COLUMN BLOCKS */
.author-header {
  grid-area: author-header;
  background: var(--color-secondary-opt);
  color: var(--color-surface-alt);
  padding: 12px 10px 8px 10px;
}
.author-contact {
  grid-area: author-contact;
  background: var(--color-primary);
  color: var(--color-surface-alt);
  padding: 10px;
  font-size: 12px;
  line-height: 1.3;
}
.author-footer {
  grid-area: author-footer;
  background: var(--color-primary);
  color: var(--color-surface-alt);
  padding: 8px 10px 12px 10px;
  font-size: 12px;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.author-name { font-weight: bold; font-size: 14px; margin-bottom: 2px; }
.author-location { color: var(--color-surface-alt); }
.author-email { color: var(--color-surface-alt); word-break: break-all; }
.author-phone { color: var(--color-surface-alt); }
.post-id { font-weight: 600; color: var(--color-text-muted); }
.post-date { color: var(--color-border); font-size: 11px; }
.post-edited { font-size: 10px; color: var(--color-text-muted); }

/* RIGHT COLUMN BLOCKS */
.post-header {
  grid-area: post-header;
  background: var(--color-secondary);
  color: var(--color-surface-alt);
  padding: 8px 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.post-content-wrap {
  grid-area: post-content-wrap;
  background: var(--color-surface);
}

.post-subject {
  font-size: 15px;
  font-weight: bold;
  flex: 1;
}
.post-price {
  font-size: 14px;
  font-weight: bold;
  color: var(--color-surface-alt);
  white-space: nowrap;
}

.post-body {
  padding: 10px 12px;
  line-height: 1.6;
  color: var(--color-text);
  flex: 1;
  white-space: pre-wrap;
}

/* IMAGE THUMBNAILS */
.post-images {
  padding: 6px 12px 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dimmed-images {
  opacity: 0.5;
  filter: grayscale(70%);
  transition: opacity 0.2s, filter 0.2s;
}
.dimmed-images:hover {
  opacity: 0.9;
  filter: grayscale(0%);
}
.thumb {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  cursor: pointer;
  background: var(--color-border-light);
}
.thumb-placeholder {
  width: 72px;
  height: 56px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-text-muted);
  cursor: pointer;
}

/* POST FOOTER */
.post-footer {
  grid-area: post-footer;
  padding: 7px 12px;
  background: var(--color-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.action-group-sm {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
}
.btn:hover {
  text-decoration: none !important;
}
.cursor-default {
  cursor: default;
}

/* Modifiers (Theme Only) */
.btn--info { background: var(--color-info); color: var(--color-surface); border-color: var(--color-info); }
.btn--info:hover { background: var(--color-info-hover); }

.btn--danger { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: var(--color-danger); }
.btn--danger:hover { background: var(--color-danger-bg); }

.btn--success { background: var(--color-success); color: var(--color-surface); border-color: var(--color-success-hover); }
.btn--success:hover { background: var(--color-success-hover); }

.btn--success-light { background: var(--color-success-bg); color: var(--color-success-text); border-color: var(--color-success-hover); }
.btn--success-light:hover { background: var(--color-success); color: var(--color-surface); }

.btn--warning-light { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: var(--color-warning); }
.btn--warning-light:hover { background: var(--color-warning); }

.btn--warning-solid { background: var(--color-warning); color: var(--color-surface); border-color: var(--color-warning-hover); }
.btn--warning-solid:hover { background: var(--color-warning-hover); }

.btn--neutral-solid { background: var(--color-neutral); color: var(--color-surface); border-color: var(--color-neutral-hover); }
.btn--neutral-solid:hover { background: var(--color-neutral-hover); }

.btn--primary-light { background: var(--color-bg); color: var(--color-primary-dark); border-color: var(--color-primary); }
.btn--primary-light:hover { background: var(--color-primary); }

/* INTERESTED TOOLTIP */
.interested-wrap {
  position: relative;
  display: inline-block;
}
.interested-count {
  background: var(--color-primary-dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: filter var(--transition-fast);
}
.interested-count:hover { 
  filter: brightness(1.2); 
}
.interested-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--color-text-dark);
  color: var(--color-surface);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 10;
  margin-bottom: 4px;
  line-height: 1.8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.interested-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 12px;
  border: 6px solid transparent;
  border-top-color: var(--color-text-dark);
}
.interested-wrap:hover .interested-tooltip,
.interested-wrap:focus-within .interested-tooltip { display: block; }

/* PAGINATION */
.pagination {
  padding: 12px 16px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.pagination a {
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  text-decoration: none;
  color: var(--color-link);
  font-size: 13px;
}
.pagination strong {
  padding: 4px 9px;
  border: 1px solid var(--color-link);
  background: var(--color-link);
  color: var(--color-surface);
  border-radius: 3px;
  font-size: 13px;
}
.pg-sep { color: var(--color-border); font-size: 13px; }
.pg-showall { background: var(--color-surface-alt); border-color: var(--color-border); color: var(--color-text); }

/* MOBILE */
@media (max-width: 600px) {
  .post-left {
    width: 110px;
    min-width: 110px;
  }
  .post-subject { font-size: 13px; }
}



/* AUTH / FORM PAGES */
.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  background: var(--color-bg);
  min-height: 100vh;
}
.auth-header {
  background: var(--color-primary-dark);
  text-align: center;
  padding: 32px 32px 24px 32px;
}
.auth-header h1 {
  color: var(--color-surface);
  font-size: 1.3rem;
  margin: 0 0 4px;
}
.auth-header .subtext {
  color: var(--color-surface);
  opacity: 0.85;
  margin: 0;
}
.auth-logo { max-height: 60px; margin: 0 auto 16px auto; display: block; transition: filter 0.2s ease; }
a:hover .auth-logo { filter: brightness(1.25); }
.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  max-width: 420px;
  margin: 48px auto;
  overflow: hidden;
}
.auth-body {
  padding: 24px 32px 32px 32px;
}
.auth-card h1 { font-size: 1.3rem; margin: 0 0 4px; }
.auth-card h2 { font-size: 1.05rem; color: var(--color-text); margin: 0 0 12px; }

.form-group { margin-bottom: 16px; }
.form-group--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.inline-form { display: inline; }
.form-select-sm {
  padding: 4px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.form-label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
.checkbox-label { font-weight: normal; display: flex; align-items: center; gap: 8px; }

.form-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
}
.form-input--code {
  max-width: 100px;
  font-size: 1.3rem;
  font-family: monospace;
  font-weight: bold;
  padding: 6px 10px;
}
.form-input--code::placeholder {
  font-weight: normal;
}
.form-input--textarea { resize: vertical; }

.form-input:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: 0 0 0 3px rgba(42,100,150,0.15);
}

.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.form-actions--col { flex-direction: column; align-items: stretch; gap: 12px; }
.text-center { text-align: center; }
.mt-sm { margin-top: 16px; }
.mb-sm { margin-bottom: 16px; }
.mt-md { margin-top: 24px; }
.mb-md { margin-bottom: 24px; }

.btn--primary { background: var(--color-link); color: var(--color-surface); border-color: var(--color-link); }
.btn--primary:hover { background: var(--color-link-hover); border-color: var(--color-link-hover); }

/* Size Modifiers */
.btn--lg { padding: 9px 22px; font-size: 1rem; border-radius: var(--radius-sm); }
.btn--block { display: block; width: 100%; text-align: center; }
.btn--md { padding: 6px 14px; font-size: 13px; font-weight: bold; border-radius: 3px; }

/* Link Button Modifier */
.btn--link { background: transparent; border-color: transparent; color: var(--color-link); text-decoration: underline; }
.btn--link:hover { background: transparent; color: var(--color-link-hover); text-decoration: underline !important; }

.subtext { font-size: 0.88rem; color: var(--color-text-muted); margin: 0 0 16px; line-height: 1.5; }
.error { color: var(--color-danger); font-size: 0.92rem; margin: 0 0 12px; }
.small-link { font-size: 0.88rem; }
.link--lg { font-size: 1.1rem; text-decoration: underline; }

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

/* TOS / HELP content */
.content-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-base);
  padding: 32px;
  margin: 24px auto;
  max-width: 100%;
}
.card-actions {
  margin-top: 24px;
  display: flex;
  gap: 16px;
}
.content-card h2 {
  font-size: 1.5rem;
  color: var(--color-primary-dark);
  margin-bottom: 16px;
}
.content-card h3 {
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin: 24px 0 8px;
}
.content-card p, .content-card ul {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 16px;
}
.content-card ul {
  padding-left: 20px;
}
.content-card li {
  margin-bottom: 8px;
}
.text-muted {
  color: var(--color-text-muted) !important;
}

/* DIALOGS / MODALS */
.modal-dialog {
  margin: auto;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.modal-title {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
  color: var(--color-primary-dark);
}
.modal-message {
  margin-bottom: 24px;
  color: var(--color-text);
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* LIGHTBOX */
.lightbox {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: var(--color-surface);
  font-size: 40px;
  cursor: pointer;
  user-select: none;
}
.lightbox-download {
  position: absolute;
  bottom: 20px;
  right: 30px;
  color: var(--color-surface);
  text-decoration: underline;
  font-size: 16px;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-surface);
  font-size: 60px;
  cursor: pointer;
  user-select: none;
  padding: 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
/* FOOTER */
.site-footer {
  text-align: center;
  padding: 8px 16px;
  margin-top: 16px;
  border-top: 1px solid var(--color-border-light);
  color: var(--color-text-muted);
  font-size: 13px;
}
.site-footer a {
  color: var(--color-link);
  text-decoration: underline;
}
.site-footer a:hover {
  color: var(--color-link-hover);
}
.site-footer span {
  margin: 0 8px;
  color: var(--color-border);
}


/* MOBILE RESPONSIVENESS */
@media (max-width: 650px) {
  .post-row {
    flex-direction: column;
  }
  .post-left {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 4px solid var(--color-surface-alt);
  }
  .board-actions {
    flex-wrap: wrap;
  }
  .topbar {
    flex-wrap: wrap;
  }
}

/* FORM VIEWS */
.page-wrapper {
  padding: 16px;
}
.page-title {
  margin-bottom: 12px;
}
.optional-text {
  font-weight: normal;
  color: var(--color-text-muted);
}
.input-narrow {
  max-width: 200px;
}
.section-label,
.file-input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-primary-dark);
}
.help-text,
.file-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.photo-grid {
  display: flex;
  gap: 8px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}
.photo-item {
  position: relative;
  display: inline-block;
}
.photo-thumb-edit {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  display: block;
}
/* UTILITY CLASSES */
.fw-bold { font-weight: bold !important; }
.text-dark { color: var(--color-primary-dark) !important; }
.rounded-none { border-radius: 0 !important; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.p-0 { padding: 0 !important; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.ml-shift { margin-left: 6px; margin-right: -2px; }
.border-b { border-bottom: 1px solid var(--color-border); }
.m-0 { margin: 0 !important; }
.text-underline { text-decoration: underline; }
.icon-lg { font-size: 1.3em; vertical-align: middle; }
.pos-abs { position: absolute; }
.pos-top-right { top: 2px; right: 2px; }
.text-danger { color: var(--color-danger) !important; }
.opacity-muted { opacity: 0.35; transition: opacity 0.2s; }

/* STRUCTURAL MODIFIERS */
.divider-vertical {
  width: 1px;
  height: 24px;
  background: var(--color-border);
}
.btn--icon-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  padding: 0;
  line-height: 18px;
  text-align: center;
  font-size: 13px;
}
.btn--text-only {
  background: transparent;
  border: none;
  padding: 0 4px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.photo-input-field {
  display: block;
  margin-bottom: 6px;
}
.file-list {
  margin: 0 0 4px;
  padding: 0 0 0 4px;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 16px;
}

/* DIALOGS / MODALS */
.modal-dialog {
  margin: auto;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.modal-title {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
  color: var(--color-primary-dark);
}
.modal-message {
  margin-bottom: 24px;
  color: var(--color-text);
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* LIGHTBOX */
.lightbox {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: var(--color-surface);
  font-size: 40px;
  cursor: pointer;
  user-select: none;
}
.lightbox-download {
  position: absolute;
  bottom: 20px;
  right: 30px;
  color: var(--color-surface);
  text-decoration: underline;
  font-size: 16px;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-surface);
  font-size: 60px;
  cursor: pointer;
  user-select: none;
  padding: 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
/* FOOTER */
.site-footer {
  text-align: center;
  padding: 8px 16px;
  margin-top: 16px;
  border-top: 1px solid var(--color-border-light);
  color: var(--color-text-muted);
  font-size: 13px;
}
.site-footer a {
  color: var(--color-link);
  text-decoration: underline;
}
.site-footer a:hover {
  color: var(--color-link-hover);
}
.site-footer span {
  margin: 0 8px;
  color: var(--color-border);
}


/* MOBILE RESPONSIVENESS */
@media (max-width: 650px) {
  .post-row {
    flex-direction: column;
  }
  .post-left {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 4px solid var(--color-surface-alt);
  }
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .topbar {
    flex-wrap: wrap;
  }
}

/* FORM VIEWS */
.page-wrapper {
  padding: 16px;
}
.page-title {
  margin-bottom: 12px;
}
.optional-text {
  font-weight: normal;
  color: var(--color-text-muted);
}
.input-narrow {
  max-width: 200px;
}
.section-label,
.file-input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-primary-dark);
}
.help-text,
.file-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.photo-grid {
  display: flex;
  gap: 8px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}
.photo-item {
  position: relative;
  display: inline-block;
}
.photo-thumb-edit {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  display: block;
}
.btn--remove-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-danger);
  color: var(--color-surface);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}
.photo-input-field {
  display: block;
  margin-bottom: 6px;
}
.file-list {
  margin: 0 0 4px;
  padding: 0 0 0 4px;
  list-style: none;
  font-size: 13px;
}
.file-list-item {
  margin-bottom: 4px;
}

/* ACTION VIEWS */
.notice--success {
  background: var(--color-success-bg);
  color: var(--color-success);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 12px;
}
.subtext--lg {
  margin-bottom: 24px;
}
.text-separator {
  margin: 0 8px;
  color: var(--color-border);
}
.checkbox-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
  margin-left: 24px;
}
.text-spaced {
  margin: 8px 0;
}
.details-list {
  margin: 8px 0 8px 20px;
  line-height: 1.9;
}
.help-text--spaced {
  margin-top: 8px;
}
.timer-expired {
  color: var(--color-danger) !important;
}

/* STATIC VIEWS */
.static-card {
  max-width: 520px;
  margin: 32px auto;
}
.static-title {
  font-size: 18px;
  color: var(--color-primary-dark);
  margin-bottom: 16px;
}
.static-subtitle {
  font-size: 14px;
  color: var(--color-primary-dark);
  margin: 20px 0 8px;
}
.static-text {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 10px;
}
.static-text--muted {
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.static-text--spaced {
  margin-bottom: 20px;
}
.static-list {
  font-size: 13px;
  color: var(--color-text);
  padding-left: 12px;
  margin-bottom: 12px;
  line-height: 2;
}
.static-actions {
  margin-top: 24px;
}

/* Action Menu Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 140px;
  z-index: 50;
  padding: 4px 0;
  margin-top: 6px;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu .inline-form { display: block; width: 100%; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--color-bg); text-decoration: none; }
.dropdown-item--danger { color: var(--color-danger); }
.dropdown-item--danger:hover { background: #fee2e2; }
.dropdown-item--warning { color: #d97706; }
.dropdown-item--warning:hover { background: #fef3c7; }

/* ------------------------------------------------------------------
   GATE 6C: OOCSS UTILITIES & COMPONENT MODIFIERS
   ------------------------------------------------------------------ */
.d-none { display: none !important; }
.text-center { text-align: center; }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--color-text-muted); }

.error-container {
  max-width: 600px;
  margin-top: 50px;
  margin-left: auto;
  margin-right: auto;
}

.error-title {
  font-size: 4rem;
  margin-bottom: 10px;
}

.error-subtitle {
  margin-bottom: 20px;
}

.error-text {
  margin-bottom: 30px;
}

/* ------------------------------------------------------------------
   GATE 7: UI LOADING STATES (Anti-Double-Click)
   ------------------------------------------------------------------ */

/* Spinner Animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 1. Premium Buttons (Zero-shift spinner) */
.btn.is-loading {
  -webkit-text-fill-color: transparent; 
  pointer-events: none;
  position: relative;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 1em; height: 1em;
  margin-top: -0.5em; margin-left: -0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 2. Minor Controls (Dimmed out, no spinner) */
.is-loading:not(.btn) {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
