﻿
  :root{
    --paper: #f4f1ea;
    --paper-raised: #fffdf9;
    --paper-soft: #f0ece3;
    --ink: #141c1a;
    --ink-soft: #52605b;
    --ink-faint: #7a847f;
    --amber: #ffb25b;
    --amber-deep: #dd7d2f;
    --amber-soft: rgba(255, 178, 91, 0.14);
    --teal: #2d6c66;
    --teal-strong: #214e49;
    --line: rgba(20, 28, 26, 0.09);
    --line-strong: rgba(20, 28, 26, 0.14);
    --shadow: 0 20px 60px rgba(17, 24, 23, 0.12);
    --radius-sm: 12px;
    --radius: 24px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
    --measure: 62ch;
  }

  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --paper: #121814;
      --paper-raised: #1a211d;
      --paper-soft: #1e2925;
      --ink: #edf2ee;
      --ink-soft: #b8c1be;
      --ink-faint: #8a9692;
      --amber: #ffc77a;
      --amber-deep: #ffb15f;
      --amber-soft: rgba(255, 193, 122, 0.12);
      --teal: #7fd1c7;
      --teal-strong: #a7e3d9;
      --line: rgba(255,255,255,0.08);
      --line-strong: rgba(255,255,255,0.12);
      --shadow: 0 24px 80px rgba(0,0,0,0.34);
    }
  }
  :root[data-theme="dark"]{
    --paper: #121814;
    --paper-raised: #1a211d;
    --paper-soft: #1e2925;
    --ink: #edf2ee;
    --ink-soft: #b8c1be;
    --ink-faint: #8a9692;
    --amber: #ffc77a;
    --amber-deep: #ffb15f;
    --amber-soft: rgba(255, 193, 122, 0.12);
    --teal: #7fd1c7;
    --teal-strong: #a7e3d9;
    --line: rgba(255,255,255,0.08);
    --line-strong: rgba(255,255,255,0.12);
    --shadow: 0 24px 80px rgba(0,0,0,0.34);
  }

  *{ box-sizing: border-box; }
  html{ background: radial-gradient(circle at top, rgba(255,178,91,0.12), transparent 35%), var(--paper); }
  body{
    margin: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  img{ max-width: 100%; display:block; }
  a{ color: inherit; }

  ::selection{ background: var(--amber); color: var(--paper-raised); }

  :focus-visible{
    outline: 2px solid var(--amber);
    outline-offset: 3px;
  }

  .shell{
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
  }

  /* ---------- Masthead ---------- */
  .masthead{
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(244, 241, 234, 0.82);
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
    color: var(--ink);
  }
  :root[data-theme="dark"] .masthead{
    background: rgba(18, 24, 20, 0.72);
    color: var(--ink);
  }
  .masthead .shell{
    display:flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .wordmark{
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--ink);
  }
  .wordmark .dot{ color: var(--amber); }
  .masthead nav{
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13.5px;
    color: var(--ink-soft);
  }
  .masthead nav a{
    text-decoration: none;
    color: var(--ink-soft);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, color .2s ease;
  }
  .masthead nav a:hover,
  .masthead nav a:focus-visible{
    border-bottom-color: var(--ink-soft);
    color: var(--ink);
  }

  /* ---------- Hero ---------- */
  .hero{
    padding: 64px 0 36px;
  }
  .hero-inner{
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    align-items: center;
  }
  .hero-copy{ position: relative; }
  .eyebrow{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,0.35);
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    margin-bottom: 20px;
  }
  .eyebrow::before{
    content: "";
    width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft);
  }
  .hero h1{
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(40px, 5vw, 72px);
    line-height: 0.96;
    letter-spacing: -0.04em;
    margin: 0 0 18px;
    max-width: 12ch;
  }
  .hero .lede{
    font-size: 19px;
    color: var(--ink-soft);
    max-width: 46ch;
    margin: 0 0 26px;
  }
  .hero-actions{
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
  }
  .hero-badges,
  .dropzone .formats{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
  }
  .formats-label{
    margin-top: 18px;
    margin-bottom: 10px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    font-weight: 700;
    font-family: var(--font-mono);
  }
  .hero-badge,
  .format-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(20, 28, 26, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,241,234,0.72));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    color: rgba(20, 28, 26, 0.78);
    font-size: 9.8px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-mono);
  }
  .dropzone .formats{
    margin: 0 auto;
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(20, 28, 26, 0.015);
    border: 1px solid rgba(20, 28, 26, 0.04);
    width: fit-content;
    max-width: 100%;
  }
  .hero-badge:nth-child(1),
  .format-badge:nth-child(1){ background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,232,201,0.72)); }
  .hero-badge:nth-child(2),
  .format-badge:nth-child(2){ background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(217,236,233,0.72)); }
  .hero-badge:nth-child(3),
  .format-badge:nth-child(3){ background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(230,223,245,0.72)); }
  .hero-badge:nth-child(4),
  .format-badge:nth-child(4){ background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,214,168,0.7)); }
  .hero .facts{
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
  .hero .fact .n{
    font-family: var(--font-mono);
    font-size: 20px;
    color: var(--amber-deep);
  }
  .hero .fact .l{
    font-size: 12.5px;
    color: var(--ink-faint);
    margin-top: 2px;
  }

  .hero-card{
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.38));
    border-radius: 28px;
    padding: 22px;
    box-shadow: var(--shadow);
  }
  :root[data-theme="dark"] .hero-card{
    background: linear-gradient(135deg, rgba(26,33,29,0.95), rgba(30,41,37,0.88));
  }
  .mini-panel{
    background: var(--paper-soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
  }
  .mini-panel-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    color: var(--ink-soft);
    font-size: 12px;
    font-family: var(--font-mono);
  }
  .status-pill{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(45, 108, 102, 0.12);
    color: var(--teal-strong);
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 600;
  }
  .status-pill::before{
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); display: inline-block;
  }
  .mini-chart{
    display: grid;
    gap: 14px;
  }
  .bar-row{
    display: grid;
    grid-template-columns: 58px 1fr 52px;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: var(--ink-soft);
  }
  .bar-track{
    height: 12px;
    border-radius: 999px;
    background: rgba(20,28,26,0.06);
    overflow: hidden;
    border: 1px solid var(--line);
  }
  .bar-fill{
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--amber));
  }
  .bar-row:nth-child(1) .bar-fill{ width: 78%; }
  .bar-row:nth-child(2) .bar-fill{ width: 62%; }
  .bar-row:nth-child(3) .bar-fill{ width: 88%; }

  /* ---------- Ad slots ---------- */
  .ad-slot{
    margin: 36px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.45);
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .ad-slot ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-height: 90px;
    background: transparent;
  }

  /* ---------- Tool panel ---------- */
  .panel{
    background: #ffffff;
    border: 1px solid #e9e5df;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  :root[data-theme="dark"] .panel{
    background: #ffffff;
  }

  .dropzone{
    padding: 46px 24px;
    text-align: center;
    cursor: pointer;
    border-bottom: 1px solid #efeae2;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(20,28,26,0.02);
  }
  .dropzone:hover{ transform: translateY(-1px); }
  .dropzone.drag{ background: #fff9f2; border-color: #f0c28a; box-shadow: 0 0 0 3px rgba(255,178,91,0.08); }
  .dropzone .glyph{
    width: 46px; height: 46px;
    margin: 0 auto 14px;
    color: #4b4f4d;
    background: #f4f4f2;
    border: 1px solid #e9e9e7;
    border-radius: 14px;
    padding: 10px;
  }
  .dropzone strong{
    font-size: 18px;
    font-weight: 700;
    color: #2b2f2d;
  }
  .dropzone .sub{
    margin-top: 8px;
    font-size: 13px;
    color: #5f6662;
  }
  .dropzone .formats{
    margin-top: 10px;
    justify-content: center;
    gap: 10px;
    opacity: 1;
  }
  input[type=file]{ display: none; }

  .toolbar{
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
  }
  .quality-field{ flex: 1; min-width: 200px; }
  .quality-field .row{
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-bottom: 8px;
  }
  .quality-field .row b{
    font-family: var(--font-mono);
    color: var(--ink);
    font-weight: 500;
  }
  input[type=range]{
    width: 100%;
    accent-color: var(--amber);
    height: 2px;
  }

  .btn{
    font-family: var(--font-body);
    border: none;
    border-radius: 999px;
    padding: 11px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s ease, filter .15s ease;
  }
  .btn:hover:not(:disabled){ transform: translateY(-1px); filter: brightness(1.02); }
  .btn:disabled{ opacity: .5; cursor: not-allowed; transform: none; }
  .btn-fill{ background: linear-gradient(135deg, var(--amber-deep), var(--amber)); color: #fff; box-shadow: 0 12px 26px rgba(221,125,47,.22); }
  .btn-fill:hover:not(:disabled){ background: linear-gradient(135deg, var(--amber), var(--amber-deep)); }
  .btn-line{
    background: rgba(255,255,255,0.35);
    color: var(--ink-soft);
    border: 1px solid var(--line-strong);
  }
  .btn-line:hover{ color: var(--ink); border-color: var(--ink-soft); }

  /* ---------- Contact sheet (list) ---------- */
  .sheet-empty{
    padding: 34px 24px;
    text-align: center;
    color: var(--ink-faint);
    font-size: 13.5px;
  }
  .sheet{
    display: none;
  }
  .sheet.has-items{ display: block; }
  .frame{
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
  }
  .frame:last-child{ border-bottom: none; }
  .frame .thumb{
    width: 52px; height: 52px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--line);
    flex-shrink: 0;
  }
  .frame .meta{ flex: 1; min-width: 0; }
  .frame .name{
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .frame .sizes{
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-faint);
    margin-top: 3px;
  }
  .frame .sizes .saved{ color: var(--teal); }
  .frame .sizes .grew{ color: var(--ink-faint); }
  .frame .status{
    font-size: 12px;
    color: var(--ink-faint);
    font-style: italic;
  }
  .frame .status.err{ color: #B4523A; font-style: normal; }
  .frame .dl{
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .frame .dl:disabled{ opacity: .3; cursor: default; }
  .frame .dl:hover:not(:disabled){ border-color: var(--amber-deep); color: var(--amber-deep); }

  .summary{
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 24px;
  }
  .summary.show{ display: flex; }
  .summary .total{
    font-size: 13px;
    color: var(--ink-soft);
    font-family: var(--font-mono);
  }
  .summary .total b{ color: var(--teal); font-weight: 500; }

  /* ---------- Editorial section ---------- */
  .article{
    padding: 54px 0;
    border-top: 1px solid var(--line);
  }
  .article h2{
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 27px;
    margin: 0 0 26px;
  }
  .qa{
    max-width: var(--measure);
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }
  .qa:first-of-type{ padding-top: 0; }
  .qa h3{
    font-size: 15.5px;
    font-weight: 600;
    margin: 0 0 8px;
  }
  .qa p{
    font-size: 14.5px;
    color: var(--ink-soft);
    margin: 0;
  }

  /* ---------- Footer ---------- */
  footer{
    border-top: 1px solid var(--line);
    padding: 26px 0 60px;
  }
  footer .shell{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--ink-faint);
  }
  footer nav{ display:flex; gap:16px; align-items:center; }
  footer a{ text-decoration: underline; text-underline-offset: 2px; }

  .toast{
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--paper);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 20;
  }
  .toast.show{ opacity: 1; }

  @media (max-width: 560px){
    .toolbar{ flex-direction: column; align-items: stretch; }
    .hero{ padding: 40px 0 32px; }
  }

  @media (prefers-reduced-motion: reduce){
    *{ transition: none !important; animation: none !important; }
  }

