/* ============================================================
   Colorify — shared interaction & polish layer
   Loaded AFTER each page's inline <style> so these win.
   Adds transitions, hover states, focus rings — no layout changes.
   Stays on-brand: hard (zero-blur) shadows only, no soft glows.
   ============================================================ */

/* Smooth transitions on everything interactive */
a,
button,
select,
input,
.fmt-btn,
.btn-primary,
.btn-secondary,
.btn-cta-red,
.btn-buy,
.btn-signout,
.btn-remove,
.ribbon-card,
.price-card,
.step,
.side-panel,
#dropzone,
#trial-badge,
#nav-links a {
  transition: background-color .15s ease,
              color .15s ease,
              border-color .15s ease,
              box-shadow .15s ease,
              transform .12s ease,
              opacity .15s ease;
}

a { text-underline-offset: 2px; }

/* ============================================================
   TYPOGRAPHY & LAYOUT REFINEMENTS
   Bigger, more legible nav; centered frame on wide screens so
   large displays don't show a stretched, empty layout.
   ============================================================ */

/* ============================================================
   FONT SIZE ENFORCEMENT — !important throughout.
   Every page uses hardcoded 10–12px in its inline <style>;
   these rules load last AND use !important so they always win.
   ============================================================ */

body                 { font-size: 15px !important; }

/* Body / ribbon copy */
.ribbon-body         { font-size: 14px !important; }
.ribbon-body p,
.ribbon-body li      { font-size: 14px !important; }

/* Left rail */
#nav-links a,
.rail-nav a          { font-size: 14px !important; }
.rail-cta p,
.rail-cta a,
.rail-cta a.btn-cta-red { font-size: 13px !important; }

/* Colorize page — form labels, hints, sidebar */
.field-label         { font-size: 13px !important; }
.field-hint          { font-size: 13px !important; }
.side-title          { font-size: 13px !important; }
.setting-row label   { font-size: 13px !important; }
.setting-note        { font-size: 13px !important; }
.tip-text            { font-size: 13px !important; }
.dz-sub              { font-size: 13px !important; }
#progress-label      { font-size: 13px !important; }
#progress-msg        { font-size: 13px !important; }
#download-row span   { font-size: 13px !important; }

/* Dashboard account grid */
.acct-label          { font-size: 13px !important; }
.acct-value          { font-size: 15px !important; }

/* Credits rail */
.credits-block .credits-label,
.cr-label            { font-size: 13px !important; }
.credits-block .free-uses,
.cr-sub              { font-size: 13px !important; }
.btn-buy             { font-size: 13px !important; }

/* Jobs history table */
.jobs-table          { font-size: 14px !important; }
.jobs-table th       { font-size: 13px !important; }
.status-done,
.status-running,
.status-failed,
.status-queued       { font-size: 13px !important; }
.dl-link             { font-size: 13px !important; }

/* User bar, ribbon titles, section headers */
#user-bar            { font-size: 13px !important; }
.ribbon-title        { font-size: 13px !important; }

/* Buttons */
.btn-primary,
.btn-signout,
.btn-cta-red         { font-size: 13px !important; }

/* Promo code */
.promo-input         { font-size: 14px !important; }
#promo-msg           { font-size: 13px !important; }

/* Footer */
#footer a            { font-size: 13px !important; }
#footer span         { font-size: 12px !important; }

/* Trial badge + top banner secondary text */
#trial-badge         { font-size: 12px !important; }

/* ============================================================
   LEFT RAIL — canonical layout.
   auth.js renderLeftRail() generates ALL content inside
   #left-rail. These are the only CSS rules needed — no page
   should define rail styles in its own inline <style>.
   ============================================================ */

#left-rail {
  width: 200px !important;
  min-width: 200px !important;
  flex-shrink: 0;
  border-right: 1px solid var(--frame-ink, #000);
  padding: 12px 10px !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

/* ── Red CTA panel (logged-out) ──────────────────────────── */
.rail-cta {
  background: var(--primary, #e91d2a);
  padding: 10px 8px;
  text-align: center;
}
.rail-sticker {
  display: inline-block;
  background: #fcc20f;
  font-family: 'Arial Black', Gadget, sans-serif;
  font-size: 14px !important;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.2;
  color: #000;
  padding: 5px 10px;
  margin-bottom: 8px;
  transform: rotate(-2deg);
  border-top: 1px solid rgba(255,255,255,.55);
  border-left: 1px solid rgba(255,255,255,.55);
  border-bottom: 2px solid rgba(0,0,0,.22);
  border-right: 2px solid rgba(0,0,0,.22);
}
.rail-sticker .stk-mid { color: #6a26a4; }
.rail-cta > p {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px !important;
  line-height: 1.45;
  color: #fff;
  margin: 4px 0 8px;
}
.rail-cta .btn-cta-red {
  display: block;
  background: #fff;
  color: var(--primary, #e91d2a);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px !important;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  padding: 5px 4px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.7);
}
.rail-cta .btn-cta-red:hover { background: #f5f5f5; }

/* ── Nav links ───────────────────────────────────────────── */
#nav-links, .rail-nav {
  border: 1px solid var(--frame-ink, #000);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#nav-links a, .rail-nav a {
  display: block;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px !important;
  color: var(--link, #0000ee);
  text-decoration: underline;
  padding: 4px 6px;
  margin: 0 -6px;
  line-height: 1.3;
  letter-spacing: .01em;
}
#nav-links a:hover, .rail-nav a:hover {
  background: var(--frame-ink, #000);
  color: #fff !important;
  text-decoration: none;
}

/* ── Free trial info (logged-out) ────────────────────────── */
.rail-trial {
  border: 1px solid var(--frame-ink, #000);
  padding: 8px 10px;
  background: var(--canvas, #fff);
}
.rail-trial .trial-title {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #555;
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid #ddd;
}
.rail-trial p {
  font-family: 'Times New Roman', Times, serif;
  font-size: 13px !important;
  line-height: 1.5;
  color: #333;
}

/* fun block relies on the rail gap for spacing */
.fun-block { margin-bottom: 0; }

/* ============================================================
   FUN BLOCK — animated "Color Lab" panel in the left rail.
   Injected by auth.js into the top of #left-rail on every page.
   Pure CSS animation (no assets); honours reduced-motion below.
   ============================================================ */
.fun-block {
  border: 1px solid var(--frame-ink);
  background: var(--canvas);
  overflow: hidden;
  margin-bottom: 8px;
}
.fun-block .fb-title {
  background: var(--frame-ink); color: var(--canvas);
  font-family: Helvetica, Arial, sans-serif; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; padding: 4px 8px;
}
.fun-block .fb-swatches { display: flex; height: 36px; }
.fun-block .fb-swatches i { flex: 1; display: block; animation: fb-cycle 7.5s infinite linear; }
.fun-block .fb-swatches i:nth-child(1) { animation-delay: 0s; }
.fun-block .fb-swatches i:nth-child(2) { animation-delay: .5s; }
.fun-block .fb-swatches i:nth-child(3) { animation-delay: 1s; }
.fun-block .fb-swatches i:nth-child(4) { animation-delay: 1.5s; }
.fun-block .fb-swatches i:nth-child(5) { animation-delay: 2s; }
.fun-block .fb-swatches i:nth-child(6) { animation-delay: 2.5s; }
@keyframes fb-cycle {
  0%   { background: var(--tint-olive); }
  16%  { background: var(--tint-salmon); }
  33%  { background: var(--tint-peach); }
  50%  { background: var(--tint-sky); }
  66%  { background: var(--tint-periwinkle); }
  83%  { background: var(--tint-sage); }
  100% { background: var(--tint-olive); }
}
.fun-block .fb-tip {
  font-size: 11px; line-height: 1.45; color: #333;
  padding: 8px; min-height: 52px;
  transition: opacity .25s ease;
}

/* Footer legal links injected by auth.js */
#footer a.footer-legal { opacity: .9; }

/* Left-rail nav: hover highlight */
#nav-links a {
  display: block;
  padding: 3px 6px;
  margin: 1px -6px;
}
#nav-links a:hover {
  background: var(--frame-ink);
  color: #fff !important;
}

/* Buttons: subtle lift on hover, press down on click */
.btn-primary:hover:not(:disabled),
.btn-cta-red:hover,
.btn-buy:hover,
.price-card a:hover,
.btn-primary-large:hover {
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled),
.btn-cta-red:active,
.btn-buy:active,
.price-card a:active,
.btn-primary-large:active {
  transform: translateY(0);
}

/* Ribbon / content cards: hard offset shadow on hover (period-correct) */
.ribbon-card:hover {
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .14);
}

/* Format buttons */
.fmt-btn:hover:not(.active) { background: #efe9da; }

/* Side panels in the workspace */
.side-panel:hover { box-shadow: 3px 3px 0 rgba(0, 0, 0, .10); }

/* Pricing cards lift slightly as a group */
.price-card:hover { background: rgba(0, 0, 0, .045); }

/* Trial badge feels clickable */
#trial-badge:hover { filter: brightness(1.08); }

/* Inputs & selects: clear focus ring */
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* Tables: row hover */
.jobs-table tbody tr:hover td,
.fmt-table tbody tr:hover td {
  background: rgba(0, 0, 0, .06);
}

/* Shared credits block in the left rail (all pages, signed in only) */
.credits-rail {
  border: 1px solid var(--frame-ink);
  background: var(--canvas);
  padding: 10px;
}
.credits-rail .cr-num {
  font-family: 'Arial Black', Gadget, sans-serif;
  font-size: 26px; font-weight: 900; line-height: 1; color: var(--frame-ink);
}
.credits-rail .cr-label {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 10px; font-weight: 700; text-transform: uppercase; color: #444; margin-top: 2px;
}
.credits-rail .cr-sub {
  font-size: 10px; color: #777; margin-top: 5px;
  border-top: 1px solid #ddd; padding-top: 5px; line-height: 1.4;
}
.credits-rail .cr-buy {
  display: block; margin-top: 8px;
  background: var(--frame-ink); color: var(--canvas);
  font-family: Helvetica, Arial, sans-serif; font-size: 10px; font-weight: 700;
  text-transform: uppercase; text-align: center; padding: 5px; text-decoration: none;
  border: 1px solid var(--frame-ink); border-top-color: #555; border-left-color: #555;
}

/* Gentle entrance for result/gallery content */
@keyframes cf-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
#result-section[style*="block"],
.page-card {
  animation: cf-fade-up .35s ease both;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   RESPONSIVE — tablet & phone
   The pages share a fixed left rail + content row. These rules
   collapse that to a single column on small screens.
   Containers differ per page: colorize uses #body / #right-col,
   the others use #body-row / #main — both are handled.
   ============================================================ */

/* Tablet & down: the colorize workspace becomes one column */
@media (max-width: 980px) {
  .work-grid { grid-template-columns: 1fr !important; }
}

/* Phones & small tablets: stack the sidebar above the content */
@media (max-width: 640px) {
  #body, #body-row { flex-direction: column; }

  #left-rail {
    width: 100% !important;
    min-width: 0 !important;
    border-right: none;
    border-bottom: 2px solid var(--frame-ink);
    flex-direction: column;
    gap: 8px;
  }

  /* Promo / CTA box: keep but tighten */
  #cta-panel, .rail-cta { padding: 8px 10px; }

  /* Nav turns into a horizontal wrapping bar */
  #nav-links, .rail-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 14px;
    border: none;
    padding: 0;
  }
  #nav-links a, .rail-nav a { padding: 4px 0; margin: 0; }
  /* Don't invert nav links on tap on mobile — keep them as plain links */
  #nav-links a:hover { background: transparent; color: var(--link) !important; text-decoration: underline; }

  /* Banner shrinks so the name + badge fit narrow screens */
  #banner-left, .site-name { font-size: 11px !important; }
  #banner-right, #trial-badge { font-size: 9px !important; padding: 3px 6px !important; }

  /* Wide tables scroll horizontally instead of breaking the layout */
  .jobs-table, .fmt-table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Account grid: single column */
  .account-grid { grid-template-columns: 1fr; }
  .account-grid .acct-field { border-right: none; }

  /* Landing-page hero + steps stack */
  .hero-body { flex-direction: column; }
  .steps-grid { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px solid var(--frame-ink); }
  .step:last-child { border-bottom: none; }

  /* Closing CTA: full-width button */
  .closing-cta .btn-primary-large { display: block; text-align: center; }
}
