/* Full path: /assets/app.css
   Purpose: Site UI must match the program screenshot (Qt-like tabs + large white panel + bottom link).
   Mobile-first + PWA-safe. No frameworks. */

:root{
  --win-bg:#ffffff;
  --panel-bg:#ffffff;
  --panel-border:#d7d7d7;

  --tabsbar-bg:#f3f3f3;
  --tab-bg:#e9e9e9;
  --tab-border:#cfcfcf;
  --tab-active-bg:#ffffff;

  --text:#111;
  --muted:#666;

  --shadow:0 1px 2px rgba(0,0,0,.08);
  --radius:12px;

  --btn-bg:#f7f7f7;
  --btn-border:#cfcfcf;
  --btn-hover:#f1f1f1;
  --btn-active:#e9e9e9;

  --focus:rgba(0,0,0,.25);
}

*,
*::before,
*::after{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  height:100%;
  min-height:100%;
  overflow:hidden;
  background:#ffffff;
  color:var(--text);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

a{ color:inherit; }
a:active{ opacity:.92; }

:focus-visible{
  outline:2px solid var(--focus);
  outline-offset:2px;
}

/* Window shell */
.qt-window{
  height:calc(100dvh - 28px);
  min-height:0;
  display:flex;
  flex-direction:column;

  margin:14px;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 10px 30px rgba(0,0,0,.10);
  background:#f0f0f0;
}

/* Title bar */
.qt-titlebar{
  height:34px;
  padding:0 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:linear-gradient(#f8f8f8,#efefef);
  border-bottom:1px solid var(--panel-border);
}

.qt-app-title{
  font-size:.92rem;
  font-weight:600;
  line-height:1;
}

.qt-win-controls{
  display:flex;
  gap:6px;
  opacity:.6;
}
.qt-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  border:1px solid #bbb;
  background:#f7f7f7;
}

/* Tabs bar */
.qt-tabsbar{
  background:var(--tabsbar-bg);
  border-bottom:1px solid var(--panel-border);
  padding:6px 8px 0;
}

.qt-tabs{
  display:flex;
  gap:4px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  padding-bottom:6px;
}

/* Tabs (QTabWidget-like) */
.qt-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 12px;
  font-size:.86rem;
  text-decoration:none;
  white-space:nowrap;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;

  border:1px solid var(--tab-border);
  background:var(--tab-bg);
  border-bottom:none;
  border-top-left-radius:4px;
  border-top-right-radius:4px;
}

.qt-tab:hover{ background:#e3e3e3; }

.qt-tab.is-active{
  background:var(--tab-active-bg);
  position:relative;
  top:1px;
  font-weight:600;
}

/* Body padding matches screenshot margins */
.qt-body{
  flex:1;
  min-height:0;
  padding:10px;
  display:flex;
}

/* Main white area panel */
.qt-panel{
  background:var(--panel-bg);
  border:1px solid var(--panel-border);
  border-radius:16px;
  padding:16px;

  flex:1;
  min-height:0;
  overflow:auto;
}

/* HOME: centered button + big link, like screenshot */
.open-center{
  flex:1;
  min-height:0;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  padding-top:clamp(2.0rem, 8vh, 4.0rem);
  gap:2.0rem;
}

.qt-btn{
  appearance:none;
  border:1px solid var(--btn-border);
  background:var(--btn-bg);
  border-radius:6px;
  padding:8px 14px;
  font-size:.92rem;
  cursor:pointer;
  box-shadow:var(--shadow);
}

.qt-btn:hover{ background:var(--btn-hover); }
.qt-btn:active{
  background:var(--btn-active);
  transform:translateY(1px);
}

.qt-btn-big{
  width:min(420px, 92vw);
  height:64px;
  font-size:1.0rem;
  font-weight:600;
  background:#fafafa;
}

.open-link{
  font-size:1.35rem;
  font-weight:600;
  letter-spacing:.02em;
  text-align:center;
}

.qt-link-strong{
  text-decoration:none;
}
.qt-link-strong:hover{
  text-decoration:underline;
}

.home-sub{
  width:min(760px, 92vw);
  text-align:center;
  color:var(--muted);
  font-size:.92rem;
  line-height:1.5;
}

/* Generic typography */
.page{ max-width:920px; }

.qt-h1{
  margin:0 0 10px 0;
  font-size:1.05rem;
  font-weight:600;
}

.qt-h2{
  margin:16px 0 8px 0;
  font-size:.98rem;
  font-weight:600;
}

.qt-p{
  margin:0 0 10px 0;
  font-size:.92rem;
  line-height:1.55;
}

.muted{ color:var(--muted); }

.qt-ul{
  margin:8px 0 0 18px;
  padding:0;
  font-size:.92rem;
  line-height:1.55;
}

.qt-divider{
  height:1px;
  background:var(--panel-border);
  margin:16px 0;
}

/* Download UI */
.dl-box{
  border:1px solid var(--panel-border);
  border-radius:6px;
  overflow:hidden;
}

.dl-row{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  padding:12px;
  border-top:1px solid var(--panel-border);
}
.dl-row:first-child{ border-top:none; }

.dl-name{ font-weight:600; font-size:.92rem; }
.dl-meta{ color:var(--muted); font-size:.82rem; margin-top:2px; }

.dl-actions{ display:flex; gap:8px; flex-wrap:wrap; }

.qt-btn-link{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.dl-sha{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.dl-sha-label{
  color:var(--muted);
  font-size:.78rem;
}
.dl-sha-code{
  display:block;
  background:#f6f6f6;
  border:1px solid var(--panel-border);
  border-radius:6px;
  padding:8px;
  overflow:auto;
  font-size:.80rem;
}

.qt-code{
  border:1px solid var(--panel-border);
  border-radius:6px;
  background:#f6f6f6;
  padding:10px;
}
.qt-code-line{ margin:0 0 6px 0; }
.qt-code-line:last-child{ margin:0; }
.qt-code-k{ font-weight:600; font-size:.82rem; color:#333; }

/* Docs accordion */
.doc-box{
  border:1px solid var(--panel-border);
  border-radius:6px;
  overflow:hidden;
}

.doc-item{
  border-top:1px solid var(--panel-border);
  background:#fff;
}
.doc-item:first-child{ border-top:none; }

.doc-sum{
  list-style:none;
  cursor:pointer;
  padding:12px;
  font-weight:600;
  font-size:.92rem;
  background:#fafafa;
}
.doc-sum::-webkit-details-marker{ display:none; }

.doc-body{
  padding:12px;
  border-top:1px solid var(--panel-border);
  background:#fff;
}

.doc-list{
  margin:0;
  padding-left:18px;
  font-size:.92rem;
  line-height:1.55;
}

/* Donate */
.don-box{
  border:1px solid var(--panel-border);
  border-radius:6px;
  overflow:hidden;
}
.don-row{
  padding:12px;
  border-top:1px solid var(--panel-border);
}
.don-row:first-child{ border-top:none; }
.don-name{ font-weight:600; }
.don-note{ color:var(--muted); font-size:.84rem; margin-top:2px; }
.don-val code{
  display:block;
  margin-top:8px;
  background:#f6f6f6;
  border:1px solid var(--panel-border);
  border-radius:6px;
  padding:8px;
  overflow:auto;
  font-size:.82rem;
}

/* Note block */
.qt-note{
  border:1px solid var(--panel-border);
  background:#f6f6f6;
  border-radius:6px;
  padding:12px;
  color:#333;
  font-size:.92rem;
  line-height:1.55;
}

.qt-link{ text-decoration:underline; }

/* Footer strip */
.qt-footer{
  border-top:1px solid var(--panel-border);
  background:#ffffff;
  padding:10px 10px;
  text-align:center;
  font-size:.85rem;
}
.qt-footer-link{
  text-decoration:underline;
}

/* Desktop refinement */
@media (min-width: 768px){
  .qt-body{ padding:20px; }
  .qt-panel{ padding:24px; }
  .dl-row{
    grid-template-columns: 1fr auto;
    align-items:center;
  }
  .dl-sha{
    grid-column: 1 / -1;
  }
}