/* =========================================================
   DCC // DOS ARCHIVE (DESKTOP-ONLY STABLE CSS)
   - Always 2-column grid
   - Fixed terminal height
   - Left list scrolls; right viewer fills
   ========================================================= */

:root{
  --app-h: 100vh;
  --bg: #050805;
  --fg: rgba(180,255,210,0.92);
  --dim: rgba(180,255,210,0.62);
  --line: rgba(64,255,106,0.22);
  --warn: rgba(255,120,120,0.90);
  --pad: 12px;
  color-scheme: dark;
}

@supports (height: 100dvh){
  :root{ --app-h: 100dvh; }
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
}

body{
  height: var(--app-h);
  overflow: hidden;
}

.hidden{ display:none !important; }
.mono{ font-family: inherit; }
.dim{ opacity: 0.72; }
.warn{ color: var(--warn); }

/* CRT shell */
.crt{
  height: var(--app-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* scanline vibe */
.crt::before{
  content:"";
  pointer-events:none;
  position:fixed;
  inset:0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.05),
    rgba(0,0,0,0.05) 1px,
    rgba(0,0,0,0.00) 2px);
  background-size: 100% 3px;
  opacity: 0.22;
  mix-blend-mode: multiply;
}

/* bars */
.bar{
  flex: 0 0 auto;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.65);
}

footer.bar{
  border-top: 1px solid var(--line);
  border-bottom: 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

/* main grid (desktop only) */
.wrap{
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 380px 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: var(--pad);
  padding: var(--pad);
}

/* panes */
.left, .right{
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.55);
  box-shadow: 0 0 18px rgba(0,0,0,0.55);
  border-radius: 8px;
  padding: 10px;
  min-height: 0;
}

/* Left: fixed shell; only list scrolls */
.left{
  display:flex;
  flex-direction: column;
  overflow: hidden;
}

.panelTitle{
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
}

/* List scroller */
.list{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.42);
  padding: 6px;
  border-radius: 6px;
}

.item{
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  display:flex;
  justify-content: space-between;
  gap: 10px;
}

.item:hover{ background: rgba(64,255,106,0.08); }

.item.selected{
  outline: 1px solid rgba(64,255,106,0.45);
  background: rgba(64,255,106,0.10);
}

.tag{ opacity: 0.75; }

.hint{
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0,0,0,0.35);
}

/* Right: viewer shell; PDF fills */
.right{
  display:flex;
  flex-direction: column;
  overflow: hidden;
}

/* viewer states */
.idle, .locked{
  flex: 1 1 auto;
  min-height: 0;
  display:grid;
  place-items: center;
  padding: 14px;
  text-align:center;
}

.big{
  font-size: 20px;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

/* input/button */
.pw{
  width: min(420px, 90%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.55);
  color: var(--fg);
  outline: none;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 16px;
}

.btn{
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(64,255,106,0.10);
  color: var(--fg);
  border-radius: 6px;
  cursor:pointer;
  min-height: 44px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.btn:active{ transform: translateY(1px); }

/* PDF iframe fills remaining space */
.pdf{
  flex: 1 1 auto;
  min-height: 0;
  width: 100% !important;
  height: 100% !important;
  border: 1px solid var(--line);
  background:#000;
  border-radius: 6px;
}

/* help modal */
.help{
  position: fixed;
  inset: 0;
  display:grid;
  place-items:center;
  background: rgba(0,0,0,0.70);
  z-index: 9999;
}

.helpBox{
  width: min(740px, 92vw);
  max-height: 85dvh;
  overflow:auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0,0,0,0.88);
  box-shadow: 0 0 30px rgba(0,0,0,0.85);
}

.helpFooter{
  margin-top: 10px;
}

/* footer link */
.cmdlink{
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(180,255,210,0.45);
}

.cmdlink:hover{
  border-bottom-color: rgba(180,255,210,0.80);
}
