:root {
  --paper: #f8f7f3;
  --ink: #23251f;
  --muted: #666b5f;
  --line: #dddfd5;
  --orange: #c64723;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: wait; opacity: .65; }
a, button, input, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--orange); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.icon { width: 20px; height: 20px; flex: none; }
main, .site-header, .site-footer { max-width: 1200px; margin: auto; padding-left: 40px; padding-right: 40px; }
.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { display: flex; align-items: center; text-decoration: none; font-size: 28px; font-weight: 800; letter-spacing: -1.5px; gap: 9px; }
.brand-mark { background: var(--orange); width: 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; transform: rotate(-8deg); }
.brand-mark .icon { width: 25px; height: 25px; }
.brand-dot { color: var(--orange); margin-left: -9px; }
.no-account { font-size: 12px; color: var(--muted); }
.simple-heading { padding: 49px 0 30px; }
.simple-heading h1 { font-size: clamp(35px, 4.8vw, 58px); letter-spacing: -2.8px; line-height: 1.1; }
.start-toolbar { display: flex; align-items: center; gap: 16px; }
.search-form { display: flex; gap: 9px; flex: 1; min-width: 0; }
.search-field { border: 1px solid #cfd2c7; background: white; border-radius: 8px; display: flex; align-items: center; flex: 1; min-width: 0; padding-left: 15px; gap: 9px; }
.search-field input { border: 0; background: transparent; width: 100%; height: 50px; font-size: 14px; min-width: 0; padding: 0 10px; border-radius: 8px; }
.search-field .icon { opacity: .55; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 50px; padding: 0 23px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; border: 1px solid transparent; transition: background-color .15s; }
.dark { background: var(--ink); color: white; }
.dark:hover { background: #41453b; }
.orange { background: var(--orange); color: white; }
.orange:hover { background: #c94420; }
.orange .icon, .dark .icon { filter: invert(1); }
.toolbar-or { font-size: 12px; color: var(--muted); }
.upload-button { cursor: pointer; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.library:has(.file-input:focus-visible) .upload-button { outline: 2px solid var(--ink); outline-offset: 4px; }
.library { padding-bottom: 45px; border: 2px solid transparent; margin: -2px; border-radius: 10px; }
.library.dragging { border-color: var(--orange); background: #fce9df; }
.library-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 22px 0 16px; gap: 20px; }
.results-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 23px 16px; }
.image-result { min-width: 0; }
.image-choice { width: 100%; aspect-ratio: 1.25; border-radius: 8px; padding: 0; overflow: hidden; position: relative; background: #e9e9e2; display: block; }
.image-choice img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.image-choice:hover img { transform: scale(1.03); }
.choice-overlay { position: absolute; left: 8px; right: 8px; bottom: 8px; border-radius: 5px; background: rgba(255,255,255,.95); font-size: 11px; display: flex; justify-content: space-between; padding: 9px; opacity: 0; transition: opacity .15s; }
.image-choice:hover .choice-overlay, .image-choice:focus-visible .choice-overlay { opacity: 1; }
.image-caption { display: flex; font-size: 9px; color: var(--muted); gap: 7px; margin-top: 7px; justify-content: space-between; }
.image-caption > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.image-caption > a { white-space: nowrap; }
.source-note { font-size: 10px; color: var(--muted); line-height: 1.6; margin: 22px 0 0; }
.site-footer { border-top: 1px solid var(--line); min-height: 70px; display: flex; align-items: center; font-size: 11px; color: var(--muted); }
.empty-state { text-align: center; padding: 65px 25px; border: 1px dashed var(--line); border-radius: 9px; }
.empty-state h2 { font-size: 20px; margin-bottom: 10px; }
.empty-state p { font-size: 13px; line-height: 1.6; color: var(--muted); }
.flash { background: #fce9df; border: 1px solid #e8b6a7; padding: 17px 20px; border-radius: 8px; margin-top: 24px; font-size: 14px; }
.editor-top { padding: 26px 0 0; display: flex; justify-content: space-between; gap: 20px; align-items: center; font-size: 11px; color: var(--muted); }
.editor-top > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-link { text-decoration: none; white-space: nowrap; }
.editor-heading { padding: 27px 0 28px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 30px; padding-bottom: 45px; align-items: start; }
.canvas-panel { background: #eeefe7; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.crop-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.crop-toolbar > div { display: flex; gap: 4px; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; padding: 9px 10px; background: transparent; border-radius: 6px; color: var(--ink); min-height: 44px; min-width: 44px; }
.tool-button:hover { background: #e0e2d7; }
.tool-button.active { background: #fffefb; box-shadow: 0 1px 4px #23251f15; }
.tool-button .icon { width: 17px; height: 17px; }
.checkerboard { background-color: #fff; background-image: conic-gradient(#e5e6e0 25%, transparent 0 50%, #e5e6e0 0 75%, transparent 0); background-size: 20px 20px; }
.image-stage { aspect-ratio: 1.15; position: relative; overflow: hidden; border-radius: 5px; }
.image-stage > img { position: absolute; max-width: none; user-select: none; object-fit: contain; width: 100%; height: 100%; }
.crop-selection { position: absolute; border: 2px solid white; box-shadow: 0 0 0 1px #23251f77, 0 0 0 999px #161a1670; cursor: move; touch-action: none; }
.crop-selection::before { content: ""; position: absolute; top: 0; bottom: 0; left: 33.333%; right: 33.333%; border-left: 1px solid #ffffff55; border-right: 1px solid #ffffff55; pointer-events: none; }
.crop-selection::after { content: ""; position: absolute; top: 33.333%; bottom: 33.333%; left: 0; right: 0; border-top: 1px solid #ffffff55; border-bottom: 1px solid #ffffff55; pointer-events: none; }
.crop-handle { width: 15px; height: 15px; background: white; border: 2px solid var(--orange); position: absolute; border-radius: 2px; padding: 0; z-index: 1; }
.crop-handle::after { content: ""; position: absolute; inset: -14px; }
.crop-handle.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.crop-handle.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.crop-handle.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.crop-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.canvas-caption { display: flex; justify-content: space-between; gap: 10px; margin: 15px 3px 2px; color: var(--muted); font-size: 10px; }
.controls-panel { border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: #fffefb; }
.simple-options { display: flex; flex-direction: column; gap: 20px; }
.simple-options label { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }
.simple-options input { width: 17px; height: 17px; accent-color: var(--orange); margin: 0; }
.make-button { width: 100%; margin-top: 27px; }
.export-specs { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; font-size: 9px; color: var(--muted); margin: 13px 0 22px; }
.export-placeholder { border-top: 1px solid var(--line); padding-top: 22px; text-align: center; font-size: 11px; color: var(--muted); }
.export-result, .processing, .export-error { border-top: 1px solid var(--line); padding-top: 22px; }
.result-previews { display: flex; align-items: center; gap: 24px; margin: 0 0 22px; }
.result-previews > .checkerboard { width: 104px; height: 104px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; flex: none; }
.result-previews img { object-fit: contain; }
.slack-preview > span:first-child { font-size: 8px; color: var(--muted); letter-spacing: .7px; }
.slack-preview p { display: flex; align-items: center; gap: 5px; font-size: 13px; margin: 10px 0; }
.reaction { display: inline-flex; align-items: center; gap: 5px; background: #e8f2f7; border: 1px solid #b6d5e5; border-radius: 12px; padding: 3px 8px; font-size: 10px; }
.result-size { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 14px; gap: 8px; }
.result-size > span:last-child { color: #48745a; }
.download-button { width: 100%; }
.slack-help { font-size: 10px; color: var(--muted); line-height: 1.7; margin-top: 15px; text-align: center; }
.processing { display: flex; gap: 13px; align-items: center; }
.processing h3 { font-size: 13px; }
.processing p, .export-error p { font-size: 11px; line-height: 1.6; color: var(--muted); margin-top: 7px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 900px) {
  main, .site-header, .site-footer { padding-left: 24px; padding-right: 24px; }
  .results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-layout { gap: 20px; grid-template-columns: 1fr; }
  .controls-panel { padding: 20px; }
  .tool-button { padding: 9px 7px; }
}
@media (max-width: 640px) {
  main, .site-header, .site-footer { padding-left: 18px; padding-right: 18px; }
  .site-header { height: 72px; }
  .wordmark { font-size: 25px; }
  .no-account { font-size: 10px; }
  .simple-heading { padding: 32px 0 24px; }
  .simple-heading h1 { letter-spacing: -1.7px; }
  .start-toolbar { flex-wrap: wrap; gap: 10px; }
  .search-form { flex-basis: 100%; }
  .start-toolbar > form:last-child { flex: 1; }
  .upload-button { width: 100%; }
  .toolbar-or { display: none; }
  .search-field input { font-size: 13px; }
  .button { padding: 0 18px; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .library-meta { font-size: 10px; }
  .image-caption { font-size: 8px; }
  .editor-top { padding-top: 22px; }
  .editor-heading { padding-top: 23px; }
  .editor-layout { grid-template-columns: 1fr; }
  .canvas-panel { padding: 12px; }
  .controls-panel { padding: 22px; }
  .simple-options { gap: 22px; }
}
