/* Refuge-inspired palette (dark slate + tan + orange accent) */
:root{
  --bg0: #0b121a;
  --bg1: #0f1a24;
  --panel: rgba(18, 33, 46, 0.72);
  --panel2: rgba(18, 33, 46, 0.50);
  --border: rgba(56, 86, 112, 0.35);

  --text: #e9ddc8;
  --muted: rgba(233, 221, 200, 0.75);

  --accent: #c97a2b;
  --accent2: #b86b22;

  --okBg: rgba(60, 179, 113, 0.18);
  --warnBg: rgba(255, 193, 7, 0.18);
  --errBg: rgba(255, 99, 99, 0.18);

  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius: 16px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: var(--bg0);
}

/* Center the whole app in the viewport */
.viewport{
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 22px;
}

/* App card */
.app{
  width: min(920px, 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, rgba(16,27,38,0.78), rgba(10,16,24,0.68));
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Header */
.header{
  padding: 18px 18px 6px;
}
.brand{
  display:flex;
  gap: 14px;
  align-items: flex-start;
}
.mark{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background:
    radial-gradient(16px 16px at 30% 30%, rgba(233,221,200,0.50), transparent 60%),
    linear-gradient(135deg, var(--accent), rgba(201,122,43,0.2));
  border: 1px solid rgba(201,122,43,0.55);
  box-shadow: 0 10px 24px rgba(201,122,43,0.18);
}
.title{
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.2px;
}
.subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
}

/* Panels */
.panel{
  margin: 12px 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border-radius: var(--radius);
  padding: 14px;
  backdrop-filter: blur(10px);
}
.panelHead{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.panelTitle{
  margin: 0;
  font-size: 16px;
}
.hint{
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Controls */
.controls{
  display:flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
.filepick{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(233,221,200,0.35);
  background: rgba(0,0,0,0.18);
  cursor:pointer;
}
.filepick input{
  display:none;
}
.filepick span{
  font-size: 13px;
  color: var(--text);
}

.buttons{
  display:flex;
  gap: 10px;
  align-items:center;
}
.btn{
  appearance: none;
  border: 1px solid rgba(233,221,200,0.22);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.btn:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.primary{
  border-color: rgba(201,122,43,0.6);
  background: linear-gradient(180deg, rgba(201,122,43,0.34), rgba(201,122,43,0.14));
}
.btn.primary:hover:not(:disabled){
  background: linear-gradient(180deg, rgba(201,122,43,0.42), rgba(201,122,43,0.18));
}
.btn.ghost:hover:not(:disabled){
  background: rgba(233,221,200,0.10);
}

/* Status */
.status{
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--muted);
}

/* Summary */
.summary{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}
.summary .row{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(233,221,200,0.12);
  background: rgba(0,0,0,0.14);
}
.summary dt{
  color: var(--muted);
  font-size: 13px;
}
.summary dd{
  margin: 0;
  font-weight: 700;
  font-size: 13px;
}

/* Result card */
.result{ color: var(--muted); font-size: 13px; }
.filecard{
  border: 1px solid rgba(233,221,200,0.12);
  border-radius: 16px;
  background: rgba(0,0,0,0.14);
  padding: 12px;
}
.filehead{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: baseline;
}
.meta{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
}
.tag{
  display:inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(233,221,200,0.18);
  background: rgba(0,0,0,0.12);
}
.tag.err{ background: var(--errBg); border-color: rgba(255,99,99,0.45); }
.tag.warn{ background: var(--warnBg); border-color: rgba(255,193,7,0.45); }
.tag.ok{ background: var(--okBg); border-color: rgba(60,179,113,0.45); }

.code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(233,221,200,0.16);
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

.list{
  margin: 10px 0 0 18px;
  color: var(--text);
}
.list li{ margin: 6px 0; }
.small{ font-size: 12px; color: var(--muted); }

.footer{
  padding: 8px 18px 18px;
  
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-row img {
  display: block;
}

/* Ko-fi visibility control */
.kofi-hidden {
  display: none;
}

.kofi-visible {
  display: block;
}

/* On very small screens, center the button */
@media (max-width: 520px) {
  .footer-row {
    justify-content: center;
    text-align: center;
  }
}
.fineprint{
  margin: 0;
  font-size: 12px;
  color: rgba(233,221,200,0.62);
}

/* Mobile tweaks */
@media (max-width: 520px){
  .buttons{ width: 100%; justify-content: flex-end; }
  .filepick{ width: 100%; justify-content: center; }
}