* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  overflow-x: hidden;
}

body[data-view="idle"] {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body[data-view="idle"] .top {
  position: absolute;
  left: 0;
  right: 0;
}

body[data-view="work"] .tabs {
  display: none;
}

body {
  font: 15px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  color: #f5f5f7;
  background: #0c0c0e;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(ellipse 70% 55% at 18% 12%, rgba(246, 130, 31, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 45% at 88% 78%, rgba(246, 130, 31, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 40% at 70% 20%, rgba(255, 255, 255, 0.06), transparent 60%);
  pointer-events: none;
}

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 18px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1;
}

.brand svg {
  color: #f6821f;
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.brand-word {
  transform: translateY(0.5px);
}

.tabs {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 980px;
}

.tab {
  border: 0;
  background: transparent;
  color: #a1a1aa;
  padding: 6px 14px;
  border-radius: 980px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.tab.on {
  background: #27272a;
  color: #fff;
}

.engine {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.04);
  color: #a1a1aa;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: all 0.2s ease-in-out;
}

.engine:hover {
  color: #fff;
  border-color: rgba(246, 130, 31, 0.4);
}

.engine b {
  color: #f6821f;
  font-weight: 600;
}

.engine-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

.home {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, calc(100% - 40px));
  z-index: 1;
}

body[data-view="work"] .home { display: none; }
body[data-view="idle"] .workspace { display: none; }

.panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(20, 20, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.zone {
  position: relative;
  padding: 20px;
  cursor: pointer;
  min-height: 340px;
}

.zone-inner {
  height: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  text-align: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease-in-out, background 0.2s ease-in-out;
}

.zone:hover .zone-inner,
.zone:focus-visible .zone-inner {
  border-color: rgba(249, 115, 22, 0.45);
}

.zone.hot .zone-inner {
  border-style: solid;
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.05);
}

.plus {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #f6821f;
  color: #fff;
  font-size: 24px;
  line-height: 38px;
  font-weight: 400;
  box-shadow: 0 8px 24px rgba(246, 130, 31, 0.35);
}

.zone-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: #fff;
}

.zone-sub {
  font-size: 13px;
  color: #a1a1aa;
}

.go {
  margin-top: 16px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 980px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.go:hover {
  background: #27272a;
  border-color: rgba(255, 255, 255, 0.15);
}

.go:disabled {
  opacity: 0.55;
  cursor: default;
}

.home .copy {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.home .copy h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
  color: #fff;
}

.home .copy p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.5;
  max-width: 28em;
}

.workspace {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 8px auto 48px;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.card {
  background: rgba(20, 20, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 14px 14px 12px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.5);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

.card-head h2 svg {
  color: #a1a1aa;
}

.card-head .zoom,
.card-head .head-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.icon-btn,
.ghost,
.text-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  font: inherit;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
}

.ghost {
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.text-btn {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
  color: #f6821f;
  border-color: rgba(246, 130, 31, 0.28);
  background: rgba(246, 130, 31, 0.08);
}

.icon-btn:hover,
.ghost:hover,
.text-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: #27272a;
}

.icon-btn.danger {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.2);
}

.icon-btn.danger:hover {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.4);
}

.stage {
  position: relative;
  height: 168px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
}

.stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: filter 0.3s ease, transform 0.2s ease;
}

.stage-empty {
  color: #71717a;
  font-size: 13px;
}

.stage.blurred img {
  filter: blur(22px) saturate(0.7);
}

.unblur {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 980px;
  background: rgba(10, 10, 12, 0.6);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.stage.blurred .unblur {
  inset: 0;
  top: auto;
  right: auto;
  margin: auto;
  width: max-content;
  height: max-content;
  padding: 8px 16px;
  font-size: 12px;
  background: rgba(10, 10, 12, 0.82);
  color: #fff;
}

.filemeta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
}

.filemeta > div {
  padding: 9px 12px;
  background: #121214;
}

.filemeta dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #71717a;
  margin-bottom: 2px;
}

.filemeta dd {
  font-size: 13px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.thumb-box {
  min-height: 72px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.thumb-box img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.empty-note {
  padding: 16px;
  text-align: center;
}

.empty-note strong,
.callout strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-note span,
.callout span {
  color: #a1a1aa;
  font-size: 12.5px;
  line-height: 1.45;
}

.callout {
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.callout[data-tone="good"] {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.1);
}

.callout[data-tone="good"] strong { color: #6ee7b7; }

.callout[data-tone="warn"] {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
}

.callout[data-tone="warn"] strong { color: #fcd34d; }

.scrub {
  width: 100%;
  margin-top: 10px;
  padding: 10px 16px;
  border: 0;
  border-radius: 980px;
  background: #f6821f;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.scrub:hover:not(:disabled) {
  background: #ff9133;
}

.scrub:disabled {
  background: rgba(255, 255, 255, 0.06);
  color: #71717a;
  cursor: default;
}

.fold {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 8px;
  overflow: hidden;
}

.fold summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.fold summary::-webkit-details-marker { display: none; }

.fold summary::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #a1a1aa;
  border-bottom: 1.5px solid #a1a1aa;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.fold[open] summary::after {
  transform: rotate(-135deg);
}

.exif-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.9fr) minmax(0, 1.1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.exif-row .k {
  color: #a1a1aa;
  font-size: 13px;
}

.exif-row .v {
  color: #fff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.exif-row .v.na {
  color: #71717a;
}

.row-actions {
  display: flex;
  gap: 4px;
}

.export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 600;
}

.export div { display: flex; gap: 6px; }

.log {
  list-style: none;
  margin: 14px 0 0;
}

.log:empty { display: none; }

.log li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 6px;
  font-size: 13px;
}

.log .meta { color: #a1a1aa; white-space: nowrap; }
.log .err { color: #ff8a80; }

.dock {
  margin-top: 16px;
  background: rgba(20, 20, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 12px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dock.hot {
  border-color: #f97316;
}

.dock-tabs {
  display: flex;
  padding: 3px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 980px;
  width: max-content;
}

.dock-tab {
  border: 0;
  background: transparent;
  color: #a1a1aa;
  padding: 6px 14px;
  border-radius: 980px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.dock-tab.on {
  background: #27272a;
  color: #fff;
}

.dock-drop {
  width: 100%;
  min-height: 92px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dock-drop em {
  font-style: normal;
  font-size: 12px;
  color: #a1a1aa;
}

.dock-drop:hover,
.dock-drop.hot {
  border-color: rgba(249, 115, 22, 0.45);
}

.dock.hot .dock-drop {
  border-style: solid;
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.05);
}

.url-form {
  display: flex;
  gap: 8px;
}

.url-form input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
  font-size: 13px;
  padding: 10px 16px;
  outline: none;
}

.url-form input:focus {
  border-color: rgba(246, 130, 31, 0.5);
}

.url-form .scrub {
  width: auto;
  margin: 0;
  padding-inline: 22px;
}

body[data-view="idle"] .bottom {
  position: fixed;
  right: 28px;
  bottom: 18px;
  padding: 0;
}

.bottom {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 0 28px 22px;
}

.bottom a {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 12px;
}

.bottom a:hover { color: rgba(245, 245, 247, 0.8); }

.wrap {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 40px));
  margin: 40px auto 48px;
}

.copy h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.copy p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.5;
}

.copy code {
  font-size: 13px;
  color: #f6821f;
}

/* Header starts colliding with centered tabs before the board does. */
@media (max-width: 1100px) {
  .top {
    position: relative;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 10px;
    padding: 14px 18px;
  }

  body[data-view="idle"] .top {
    position: relative;
  }

  .tabs {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: stretch;
  }

  .tab {
    flex: 1;
    text-align: center;
  }

  .engine {
    margin-left: auto;
    max-width: min(240px, 55vw);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .home {
    position: static;
    transform: none;
    width: auto;
    margin: 12px auto 28px;
    max-width: min(860px, calc(100% - 36px));
  }

  .panel {
    grid-template-columns: 1fr;
  }

  body[data-view="idle"] {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  body[data-view="idle"] .bottom {
    position: static;
    justify-content: center;
    padding: 8px 18px 28px;
  }
}

@media (max-width: 740px) {
  .top {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .brand {
    font-size: 16px;
  }

  .tab {
    padding: 9px 14px;
  }

  .engine {
    display: none;
  }

  .home {
    margin: 8px 14px 24px;
    max-width: none;
  }

  .panel {
    grid-template-columns: 1fr;
  }

  .zone {
    min-height: 0;
    padding: 14px 14px 0;
  }

  .zone-inner {
    min-height: 0;
    padding: 30px 18px;
  }

  .go {
    padding: 10px 18px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .home .copy {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 22px 20px 26px;
  }

  .home .copy h1 {
    font-size: 22px;
  }

  .home .copy p {
    font-size: 14px;
  }

  .workspace {
    width: auto;
    margin: 0 14px 24px;
  }

  .card {
    border-radius: 18px;
    padding: 12px;
    min-width: 0;
  }

  .card-head {
    gap: 8px;
    margin-bottom: 10px;
  }

  .card-head h2 {
    min-width: 0;
    flex: 1;
  }

  .card-head .zoom,
  .card-head .head-actions {
    flex-shrink: 0;
  }

  .head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .stage {
    height: 180px;
  }

  .exif-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .exif-row .k {
    grid-column: 1;
    grid-row: 1;
  }

  .exif-row .row-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .exif-row .v {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
    word-break: break-word;
  }

  .export {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .export div {
    width: 100%;
  }

  .export .ghost {
    flex: 1;
    text-align: center;
  }

  .dock {
    border-radius: 18px;
    padding: 10px;
  }

  .dock-tabs {
    width: 100%;
  }

  .dock-tab {
    flex: 1;
    text-align: center;
  }

  .url-form {
    flex-direction: column;
  }

  .url-form .scrub {
    width: 100%;
  }

  body[data-view="idle"] .bottom,
  .bottom {
    position: static;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    padding: 6px 16px calc(28px + env(safe-area-inset-bottom));
  }

  .bottom a {
    font-size: 13px;
    padding: 4px 0;
  }

  .wrap {
    width: auto;
    margin: 24px 16px 40px;
  }

  .copy h1 {
    font-size: 24px;
  }

  .log li {
    flex-direction: column;
    gap: 2px;
  }

  .log .meta {
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .top {
    padding: 12px 12px;
  }

  .home,
  .workspace {
    margin-left: 10px;
    margin-right: 10px;
  }

  .zone-inner {
    min-height: 180px;
  }

  .home .copy {
    padding: 18px 16px 22px;
  }

  .home .copy h1 {
    font-size: 20px;
  }

  .card-head h2 {
    font-size: 12px;
  }

  .ghost {
    padding: 5px 8px;
    font-size: 11px;
  }

  .dock-drop {
    min-height: 80px;
    padding: 12px;
    font-size: 13px;
  }
}
