/* decrypt.stream — a bold, functional archive, not a landing page. */
:root {
  color-scheme: light;
  --page: #f4f4f0;
  --paper: #fff;
  --paper-2: #e9e9e3;
  --ink: #181818;
  --muted: #565651;
  --muted-2: #676762;
  --border: #181818;
  --yellow: #ffda45;
  --blue: #344bdf;
  --blue-soft: #e8ecff;
  --success: #175b37;
  --success-soft: #ddf5dc;
  --danger: #9a2233;
  --danger-soft: #ffe3e7;
  --warning: #754500;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Helvetica Neue", Arial, ui-sans-serif, sans-serif;
  --shadow: 4px 4px 0 var(--ink);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; background: var(--page); color: var(--ink); font: 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
input:focus-visible { outline: 3px solid var(--blue); outline-offset: -5px; }
::selection { background: var(--ink); color: var(--yellow); }

.container { width: min(1224px, 100%); margin: auto; padding: 0 28px 72px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 108px; padding: 20px 0; border-bottom: 2px solid var(--ink); margin-bottom: 26px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 14px; }
.glyph { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border: 2px solid var(--ink); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.glyph img { display: block; width: 36px; height: 36px; filter: brightness(0); }
h1 { font-size: clamp(1.45rem, 2.7vw, 2rem); letter-spacing: -.065em; line-height: 1.05; font-weight: 900; }
.sub { margin-top: 6px; font: .75rem/1.3 var(--mono); color: var(--muted); }
.acct { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; font-size: .875rem; }
.acct .who { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.acct .quota, .acct .pend { font: .75rem/1.4 var(--mono); color: var(--muted); }
.open-badge { padding: 5px 8px; border: 1.5px solid var(--ink); background: var(--success-soft); font: 700 .75rem/1.3 var(--mono); }
.abtn, .btn, .load-more, .search-box button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 15px;
  border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink);
  font-size: .875rem; font-weight: 750; line-height: 1.2; text-decoration: none; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.abtn:hover, .btn:hover, .load-more:hover, .search-box button:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.abtn:active, .btn:active, .load-more:active, .search-box button:active { transform: translate(1px, 1px); box-shadow: none; }
.abtn.primary { background: var(--ink); color: var(--paper); }

.search-wrap { padding: 26px 28px 28px; margin-bottom: 32px; border: 2px solid var(--ink); background: var(--yellow); box-shadow: 6px 6px 0 var(--ink); }
.search-intro { margin-bottom: 24px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 .75rem/1.2 var(--mono); letter-spacing: .065em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--ink); }
.search-intro h2 { margin-top: 9px; font-size: clamp(1.85rem, 4vw, 2.65rem); line-height: 1.08; letter-spacing: -.055em; font-weight: 900; }
.search-intro p { margin-top: 9px; font-size: .875rem; color: #373321; }
.mode-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.seg { display: inline-flex; border: 2px solid var(--ink); background: var(--paper); }
.mode-btn { min-height: 38px; padding: 7px 15px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: .875rem; font-weight: 750; }
.mode-btn + .mode-btn { border-left: 2px solid var(--ink); }
.mode-btn:hover { background: #f0edd9; }
.mode-btn.active { background: var(--ink); color: var(--paper); }
#region { max-width: 160px; min-height: 42px; padding: 7px 10px; border: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font: 700 .75rem/1.3 var(--mono); }
.search-box { display: grid; grid-template-columns: minmax(0, 1fr) 142px; gap: 12px; }
.search-box input { min-width: 0; height: 54px; padding: 0 17px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font-size: 1rem; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box button { min-height: 54px; background: var(--ink); color: var(--paper); font-size: 1rem; }
.search-box button::after { content: "↗"; font-size: 1.2rem; }

#pauseBanner { margin-bottom: 24px; padding: 16px; border: 2px solid var(--ink); background: #fff0c2; color: var(--warning); font-size: .875rem; }
#featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 16px; margin-bottom: 32px; }
#featured:empty { display: none; }
#list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.feat-title, .section-heading, .load-more-wrap, .empty, .loading { grid-column: 1 / -1; }
.feat-title, .section-heading { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.feat-title > span:first-child, .section-title { font-size: 1.0625rem; line-height: 1.3; letter-spacing: -.025em; font-weight: 850; }
.section-heading { margin: 0 0 18px; }
.section-count { flex: 0 0 auto; padding: 3px 7px; border: 1.5px solid var(--ink); background: var(--paper); font: 700 .75rem/1.3 var(--mono); text-transform: uppercase; }

.app-card { position: relative; min-width: 0; align-self: start; border: 2px solid var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
.app-card:hover { box-shadow: 4px 4px 0 var(--ink); }
.app-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 18px; align-items: center; min-height: 108px; padding: 19px 22px; }
.app-icon { display: block; width: 58px; height: 58px; border: 1px solid #ddd; border-radius: 12px; background: var(--paper); object-fit: cover; }
.app-icon.fallback { object-fit: contain; padding: 8px; border-color: var(--ink); border-radius: 0; background: var(--yellow); filter: grayscale(1); }
.app-info { min-width: 0; }
.app-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.0625rem; font-weight: 800; line-height: 1.3; letter-spacing: -.025em; }
.app-meta { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: .875rem; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.app-bundle { margin-top: 4px; overflow: hidden; color: var(--muted-2); font: .75rem/1.4 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.meta-highlight { color: var(--warning); font-weight: 650; }
.app-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; max-width: 340px; }
.app-action .btn { white-space: nowrap; }
.btn-go { background: var(--yellow); }
.btn-cached, .btn-dl { background: var(--blue); color: var(--paper); }
.btn-bin { background: var(--paper-2); }
.btn-versions { background: var(--paper); }
.btn-working, .btn-working:disabled { background: var(--blue-soft); color: var(--blue); }
.btn-go:disabled { background: var(--paper-2); color: var(--muted); }
.btn:disabled { transform: none; box-shadow: none; }
.blocked-note { max-width: 220px; color: var(--danger); font-size: .875rem; line-height: 1.4; }
#featured .app-row { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px; }
#featured .app-icon { width: 44px; height: 44px; border-radius: 9px; }
#featured .app-name { font-size: .9375rem; }
#featured .app-meta { font-size: .75rem; }
#featured .app-bundle { display: none; }
#featured .app-action { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; max-width: none; padding-top: 2px; }
#featured .btn { min-height: 40px; padding: 8px 12px; }

.version-panel, .job-panel { border-top: 2px solid var(--ink); padding: 18px 22px; background: var(--blue-soft); }
.version-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.version-title { font-size: 1rem; font-weight: 850; }
.version-note { max-width: 680px; margin-top: 5px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.version-list { display: grid; gap: 10px; }
.version-row { display: flex; align-items: center; gap: 16px; padding: 12px 14px; border: 1.5px solid var(--ink); background: var(--paper); }
.version-info { min-width: 0; flex: 1; }
.version-number { font-size: .9375rem; font-weight: 800; }
.version-meta { margin-top: 4px; color: var(--muted); font: .75rem/1.5 var(--mono); overflow-wrap: anywhere; }
.version-latest { display: inline-block; vertical-align: 1px; margin-left: 8px; padding: 2px 5px; border: 1px solid var(--ink); background: var(--success-soft); color: var(--success); font: 700 .75rem/1.3 var(--mono); text-transform: uppercase; }
.version-job-error { margin-top: 5px; color: var(--danger); font-size: .875rem; overflow-wrap: anywhere; }
.version-more { margin-top: 14px; }
.version-loading, .version-error { padding: 14px; border: 1.5px dashed var(--ink); font-size: .875rem; }
.version-error { margin-bottom: 12px; background: var(--danger-soft); color: var(--danger); }
.job-panel { background: #f1f2fc; }
.job-panel-failed { background: var(--danger-soft); }
.job-panel-completed { background: var(--success-soft); }
.job-status-row { display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; }
.spinner { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; border: 2px solid #a5aed6; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-dot { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 5px; background: currentColor; }
.status-text { min-width: 0; }
.status-text.ok { color: var(--success); }
.status-text.err { color: var(--danger); }
.status-title { display: block; font-weight: 800; }
.job-error-message { display: block; max-width: 850px; margin-top: 3px; overflow-wrap: anywhere; }
.pbar { height: 10px; margin: 12px 0; border: 1.5px solid var(--ink); background: var(--paper); }
.pbar-fill { height: 100%; background: var(--blue); transition: width .3s ease; }
.job-details { margin-top: 10px; }
.job-details summary { width: fit-content; padding: 5px 0; color: var(--ink); font: 700 .75rem/1.5 var(--mono); cursor: pointer; }
.log-box { max-height: 220px; margin-top: 8px; padding: 14px; overflow: auto; border: 1.5px solid var(--ink); background: var(--ink); color: #deded9; font: .75rem/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.log-box .l-ok { color: #96e6a9; }
.log-box .l-err { color: #ffabb6; }
.log-box .l-t { color: #aaa; }

.queue-panel { padding: 18px 22px; margin-bottom: 24px; border: 2px solid var(--ink); background: var(--blue-soft); box-shadow: 3px 3px 0 var(--ink); }
.queue-title { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; font: 700 .75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.queue-title .dot { width: 9px; height: 9px; background: var(--blue); }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #a0a4b7; font-size: .875rem; }
.qi-pos { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border: 1.5px solid var(--ink); background: var(--paper); font: 700 .75rem/1 var(--mono); }
.qi-pos.active { background: var(--blue); color: #fff; }
.qi-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qi-status { font: .75rem/1.4 var(--mono); color: var(--muted); }
.qi-status.active { color: var(--blue); }
.qi-status.waiting { color: var(--warning); }
.load-more-wrap { display: flex; justify-content: center; padding-top: 14px; }
.load-more { min-width: 240px; background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.empty, .loading { padding: 40px 24px; border: 2px dashed var(--ink); background: var(--paper); color: var(--muted); font-size: 1rem; text-align: center; }
.empty code { color: var(--ink); font-size: .875rem; overflow-wrap: anywhere; }

#authWrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; visibility: hidden; opacity: 0; background: rgba(24,24,24,.65); }
#authWrap.show { visibility: visible; opacity: 1; }
.authcard { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 48px); overflow: auto; padding: 30px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 8px 8px 0 var(--yellow); }
.authcard h3 { padding-right: 40px; font-size: 1.75rem; line-height: 1.2; font-weight: 850; letter-spacing: -.045em; }
.authcard .sub2 { margin: 12px 0 18px; color: var(--muted); font-size: .875rem; }
.authcard input { width: 100%; height: 48px; margin-bottom: 12px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font-size: 1rem; }
.authcard #authGo { width: 100%; min-height: 46px; padding: 10px; margin-bottom: 18px; border: 2px solid var(--ink); background: var(--yellow); font-size: 1rem; font-weight: 800; box-shadow: 3px 3px 0 var(--ink); }
.authcard .tog { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: .875rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-align: center; }
.authcard .x { position: absolute; top: 15px; right: 15px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 2px solid var(--ink); background: var(--paper); font-size: 1rem; }
.authcard .aerr { color: var(--danger); font-size: .875rem; margin-bottom: 12px; }
.authcard .aerr:empty { display: none; }

@media (max-width: 1000px) {
  #featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-action { max-width: 280px; }
  .app-row { gap: 14px; padding: 18px; }
  .acct { gap: 8px; }
  .acct .who { max-width: 110px; }
}
@media (max-width: 700px) {
  .container { padding: 0 18px 48px; }
  header { flex-wrap: wrap; gap: 18px; padding: 22px 0 18px; margin-bottom: 22px; }
  .brand { flex: 1 0 auto; }
  .acct { justify-content: flex-start; }
  .search-wrap { padding: 22px; margin-bottom: 28px; box-shadow: 4px 4px 0 var(--ink); }
  .search-intro { margin-bottom: 20px; }
  .app-row { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; min-height: 0; padding: 16px; }
  .app-icon { width: 52px; height: 52px; }
  .app-action { grid-column: 1 / -1; justify-content: flex-start; max-width: none; padding-top: 3px; }
  .app-action .btn { flex: 1; min-height: 44px; }
  .app-name { font-size: 1rem; }
  .app-meta { font-size: .8125rem; }
  .version-panel, .job-panel { padding: 16px; }
  .version-head { position: relative; display: block; }
  .version-head > .btn { position: absolute; top: 0; right: 0; }
  .version-title { display: flex; align-items: center; min-height: 42px; padding-right: 85px; }
  .version-note { margin-top: 10px; }
  .version-row { flex-wrap: wrap; }
  .version-row > .btn { width: 100%; }
  .version-info { flex-basis: 100%; }
  .queue-panel { padding: 16px; }
}
@media (max-width: 480px) {
  .container { padding-inline: 14px; }
  .glyph { width: 42px; height: 42px; flex-basis: 42px; }
  .glyph img { width: 31px; height: 31px; }
  .brand { gap: 11px; }
  .sub { font-size: .75rem; }
  .acct { width: 100%; gap: 9px; }
  .abtn { min-height: 40px; }
  .search-wrap { padding: 20px 16px; }
  .search-intro h2 { font-size: 1.95rem; max-width: 290px; }
  .search-intro p { max-width: 290px; }
  .mode-toggle { gap: 8px; flex-wrap: wrap; }
  .mode-btn { padding-inline: 11px; font-size: .8125rem; }
  #region { max-width: 143px; padding-inline: 5px; font-size: .75rem; }
  .search-box { grid-template-columns: minmax(0, 1fr) 86px; gap: 8px; }
  .search-box button { padding-inline: 8px; font-size: .875rem; }
  .search-box button::after { display: none; }
  .search-box input { padding-inline: 11px; }
  #featured { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #featured .app-row { grid-template-columns: 44px minmax(0, 1fr); }
  #featured .app-action { grid-column: 2; display: flex; padding-top: 0; }
  #featured .app-action .btn { flex: 0 1 auto; padding-inline: 11px; }
  .feat-title, .section-heading { gap: 10px; }
  .feat-title > span:first-child, .section-title { font-size: 1rem; }
  .section-count { font-size: .75rem; }
  .authcard { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
