:root {
  --pik-orange: #ff6a00;
  --pik-orange-deep: #e55f00;
  --pik-orange-soft: #fff1e6;
  --pik-orange-glow: rgba(255, 106, 0, 0.18);
  --bg: #fffaf6;
  --bg-accent: #fff4eb;
  --panel: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --accent: var(--pik-orange);
  --error: #c2410c;
  --ok: #b45309;
  --line: #f0e4d8;
  --input-bg: #fffdfb;
  --summary-bg: #fff7f0;
  --font: "Onest", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 45% at 100% -10%, var(--pik-orange-glow), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(255, 160, 80, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 40%, #ffffff 100%);
}

.top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.85rem 1rem;
  padding: 0.55rem 1.15rem;
  min-height: 3.1rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 30;
}

.brand {
  color: var(--pik-orange);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 0.01em;
  font-size: 1.1rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.brand:hover { color: var(--pik-orange-deep); }

.top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
}
.top-nav-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.75rem;
  border-radius: 9px;
  border: 1px solid #ffd0a8;
  background: #fff;
  color: var(--pik-orange-deep);
  text-decoration: none;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: none;
}
.top-nav-link:hover {
  background: #fff7ed;
  border-color: var(--pik-orange);
  color: var(--pik-orange-deep);
}
.top-menu { display: none; }
.top-menu-btn { display: none; }
.account-login-full {
  display: none;
  flex: 1 1 100%;
  font-weight: 700;
}
.ssh-top {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.ssh-top-label {
  color: var(--pik-orange-deep);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}
.ssh-pop {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 70;
  width: 16rem;
  background: #fff;
  border: 1px solid #ffd0a8;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(28, 25, 23, 0.14);
  padding: 0.75rem;
}
.ssh-pop .field { margin: 0 0 0.55rem; }
.ssh-pop button { width: 100%; }
.ssh-info-btn {
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #ffd0a8;
  background: #fff;
  color: var(--pik-orange-deep);
  font-size: 0.68rem;
  font-weight: 750;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}
.ssh-info-btn:hover {
  background: #fff7ed;
  border-color: var(--pik-orange);
}
.ssh-info {
  width: 13.5rem;
  padding: 0.65rem 0.75rem;
}
.ssh-info p {
  margin: 0;
  color: var(--ink, #1c1917);
  font-size: 0.9rem;
  font-weight: 650;
}
.ssh-info p + p { margin-top: 0.45rem; }
.ssh-info span {
  display: block;
  margin-bottom: 0.08rem;
  color: #8a7568;
  font-size: 0.72rem;
  font-weight: 550;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  flex: 0 0 auto;
}
.meta-date { white-space: nowrap; }

.account {
  position: relative;
  z-index: 40;
  flex: 0 0 auto;
}
.account-toggle {
  appearance: none;
  border: 0;
  background: var(--pik-orange);
  color: #fff;
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  padding: 0.38rem 0.7rem 0.38rem 0.4rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.28);
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  white-space: nowrap;
  min-width: 11.5rem;
  justify-content: flex-start;
}
.account-toggle:hover {
  background: var(--pik-orange-deep);
}
.account.open .account-toggle {
  border-radius: 10px 10px 0 0;
  box-shadow: none;
  position: relative;
  z-index: 42;
}
.account-ver {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
}
.account-ver:hover {
  background: rgba(255, 255, 255, 0.28);
}
.account-login {
  flex: 1 1 auto;
  text-align: left;
}
.account-chevron {
  font-size: 0.7rem;
  opacity: 0.9;
  transition: transform 0.15s ease;
  margin-left: auto;
}
.account.open .account-chevron { transform: rotate(180deg); }
.account-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  min-width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem 0.65rem;
  background: var(--pik-orange);
  color: #fff;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 14px 28px rgba(255, 106, 0, 0.28);
  z-index: 41;
}
.account-panel[hidden] {
  display: none !important;
}
.account-panel-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0.1rem 0.55rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.92);
}
.account-role {
  font-weight: 700;
  text-transform: lowercase;
}
.account-date {
  opacity: 0.9;
  white-space: nowrap;
}
.account-logout {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}
.account-logout:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: #fff;
}
a.account-history {
  display: block;
  box-sizing: border-box;
  margin: 0 0 0.4rem;
  text-decoration: none;
}
.account-changelog { display: none; }
#theme-btn { margin: 0 0 0.4rem; }

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}
main.layout-wide {
  max-width: min(92rem, calc(100vw - 2rem));
}
main.layout-preview {
  max-width: min(110rem, calc(100vw - 1.25rem));
  padding-left: 1rem;
  padding-right: 1rem;
}
main.layout-home {
  max-width: min(88rem, calc(100vw - 2rem));
}
html.report-open { overflow: hidden; }
html.in-frame {
  height: 100%;
  overflow: hidden;
}
html.in-frame header.top { display: none; }
html.in-frame body {
  height: 100%;
  min-height: 0;
  margin: 0;
  background: #fff;
  overflow: auto;
  overscroll-behavior: contain;
}
html.in-frame main {
  max-width: none;
  padding: 1rem 1.1rem 1.25rem;
}

.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17.5rem, 22rem);
  gap: 1.15rem;
  align-items: start;
}
.home-main { min-width: 0; }
.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.home-head .lead { margin: 0.35rem 0 0; }

.job-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0.28rem 0.15rem 0.28rem 0.55rem;
  max-width: min(22rem, 70vw);
  min-width: 0;
  border-radius: 14px;
  background: #fff1e6;
  color: #1c1917;
  border: 1px solid #ffd0a8;
}
.job-chip[hidden] { display: none; }
.job-chip-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.job-chip.is-done { background: #ecfdf3; border-color: #86efac; }
.job-chip.is-error, .job-chip.is-choice { background: #fff7f4; border-color: #ffd4c2; }
.job-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6a00;
  flex: none;
}
.job-chip.is-running .job-chip-dot, .job-chip.is-queued .job-chip-dot {
  box-shadow: 0 0 0 0 rgba(255, 106, 0, 0.7);
  animation: job-pulse 1.4s ease-out infinite;
}
.job-chip.is-done .job-chip-dot { background: #16a34a; animation: none; }
.job-chip-text {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-width: 0;
  flex: 1;
  gap: 0;
}
.job-chip strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
  font-size: 0.8rem;
  line-height: 1.25;
}
.job-chip-time {
  display: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #78716c;
  font-size: 0.74rem;
  line-height: 1.25;
  white-space: nowrap;
}
.job-chip-time:not(:empty) { display: block; }
button.job-chip-x {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #78716c;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
  min-height: 0;
  padding: 0 0.35rem;
  cursor: pointer;
  flex: none;
}
button.job-chip-x:hover {
  background: transparent;
  box-shadow: none;
  color: #1c1917;
}
button.job-chip-x[hidden] { display: none; }
button.job-chip-stop {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 1.6rem;
  min-height: 0;
  margin: 0;
  padding: 0 0.55rem;
  border: 1px solid #ffd0a8;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #c2410c;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}
button.job-chip-stop:hover { background: #fff7f4; box-shadow: none; color: #c2410c; }
button.job-chip-stop[hidden] { display: none; }
.job-chip-menu[hidden] { display: none; }
.job-chip-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: min(22rem, 70vw);
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ffd0a8;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.12);
}
.job-chip-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.job-chip-open {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #1c1917;
  text-align: left;
  padding: 0.45rem 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-chip-open:hover { background: #fff1e6; }
.check-list[hidden] { display: none; }
@keyframes job-pulse {
  70% { box-shadow: 0 0 0 8px rgba(255, 106, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 106, 0, 0); }
}
.home-count {
  margin: 0.35rem 0 0;
  white-space: nowrap;
}
.whats-new {
  margin: 0.85rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid #ffd4c2;
  background: linear-gradient(180deg, #fff8f4 0%, #fff 100%);
  border-radius: 10px;
}
.whats-new-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: #9a3412;
}
.whats-new-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text, #1c1917);
  line-height: 1.45;
}
.whats-new-list li + li { margin-top: 0.3rem; }
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.menu-grid li {
  height: 100%;
}
.menu-grid .menu-tile {
  height: 100%;
  align-content: start;
}
.menu-grid .menu-tile strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.badge-dev {
  background: #fff1eb;
  color: #c2410c;
  border: 1px solid #ffd4c2;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
}
.menu-grid li.is-dev {
  border-style: dashed;
}
.home-side {
  display: grid;
  gap: 0.85rem;
  position: sticky;
  top: 1rem;
}
.side-panel {
  padding: 1.1rem 1.15rem;
}
.side-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.side-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  gap: 0.5rem;
}
.side-stats .stat-card {
  padding: 0.7rem 0.45rem;
  min-width: 0;
}
.side-stats .stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-stats .stat-value { font-size: 1.2rem; }
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.side-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.side-list li:last-child { border-bottom: 0; }
.side-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.9rem;
}
.side-list a:hover { color: var(--pik-orange-deep); }
.side-num {
  font-weight: 750;
  color: var(--pik-orange-deep);
  font-variant-numeric: tabular-nums;
}
.side-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.side-feed li {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.side-feed li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.feed-top, .feed-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.feed-bot {
  margin-top: 0.3rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.feed-user, .feed-report {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-time {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.side-tips {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  display: grid;
  gap: 0.55rem;
}
@media (min-width: 1200px) {
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .home { grid-template-columns: 1fr; }
  .home-side { position: static; }
  .menu-grid { grid-template-columns: 1fr; }
  .top-nav-link {
    padding: 0.32rem 0.55rem;
    font-size: 0.8rem;
  }
  .account-toggle { min-width: 0; }
}
@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
    row-gap: 0.45rem;
    padding: 0.5rem 0.7rem 0.6rem;
  }
  .brand { flex: 0 1 auto; }
  .top > .top-nav-link,
  .top-vpn { display: none; }
  .account-login { display: none; }
  .account-login-full { display: block; }
  .account-toggle {
    min-width: 0;
    gap: 0.28rem;
    padding: 0.32rem 0.45rem 0.32rem 0.32rem;
  }
  .account-panel { left: auto; right: 0; min-width: 12.5rem; }
  .account-ver { pointer-events: none; cursor: inherit; }
  .account-changelog { display: block; }
  .account.open .account-toggle {
    margin: 0;
    box-sizing: border-box;
    max-width: calc(100vw - 1.4rem);
  }
  .account.open .account-panel {
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    width: max-content;
    max-width: calc(100vw - 1.4rem);
    box-sizing: border-box;
  }
  .top > .ssh-top { display: none; }
  .top-menu[open] ~ .ssh-top {
    display: inline-flex;
    order: 4;
    flex: 1 1 100%;
    box-sizing: border-box;
    margin-top: 0.15rem;
    padding: 0.45rem 0.75rem;
    width: 100%;
    justify-content: space-between;
    border: 1px solid #ffd0a8;
    border-radius: 10px;
    background: #fff;
  }
  .meta { margin-left: auto; min-width: 0; }
  .account { min-width: 0; }
  .account-login { overflow: hidden; text-overflow: ellipsis; }
  .top > .top-nav { display: none; }
  .top-menu {
    order: 3;
    flex: 1 1 100%;
    display: block;
  }
  .top-menu-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    list-style: none;
    cursor: pointer;
    padding: 0.48rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #ffd0a8;
    background: #fff;
    color: var(--pik-orange-deep);
    font-weight: 650;
    font-size: 0.9rem;
  }
  .top-menu-btn::-webkit-details-marker { display: none; }
  .top-menu-btn::marker { content: ""; }
  .top-menu-btn::after {
    content: "▾";
    font-size: 0.75rem;
    opacity: 0.85;
  }
  .top-menu[open] .top-menu-btn {
    border-color: var(--pik-orange);
    background: var(--pik-orange-soft);
  }
  .top-menu[open] .top-menu-btn::after { transform: rotate(180deg); }
  .top-menu .top-nav { display: none; }
  .top-menu[open] .top-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 0.4rem;
    gap: 0.35rem;
  }
  .top-menu[open] .top-nav-link { width: 100%; }
  .account-toggle {
    min-width: 0;
    max-width: 100%;
  }
  main,
  main.layout-wide,
  main.layout-home,
  main.layout-preview {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem 1.5rem;
  box-shadow: 0 10px 30px rgba(255, 106, 0, 0.06);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.lead, .hint { color: var(--muted); line-height: 1.45; }
.hint { font-size: 0.85rem; margin-top: 1.25rem; }

.conn-status {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.conn-status p { margin: 0; color: inherit; }
.conn-status-title { margin-bottom: 0.35rem !important; }
.conn-status.ok {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.conn-status.warn {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
}
.field-needed span { color: #9a3412; }
.field-needed input[type="file"] {
  border-color: #fdba74;
  background: #fffaf5;
}

.file-hints {
  margin: 1rem 0 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fff8f2);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.file-hints p { margin: 0 0 0.55rem; color: var(--muted); }
.file-hints p:last-child { margin-bottom: 0; }
.file-hints ul {
  margin: 0.35rem 0 0.65rem;
  padding-left: 1.15rem;
  color: var(--muted);
}
.file-hints li { margin: 0.25rem 0; }
.file-hints strong { color: var(--text); font-weight: 650; }

.error {
  color: var(--error);
  background: #fff1eb;
  border: 1px solid #ffd4c2;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  white-space: pre-wrap;
}

.notice {
  color: #9a3412;
  background: var(--pik-orange-soft);
  border: 1px solid #ffd8b8;
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.generated {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px dashed var(--pik-orange);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.form { display: grid; gap: 1.15rem; margin-top: 1.25rem; }

.field { display: grid; gap: 0.4rem; }
.field span { font-size: 0.9rem; color: var(--muted); }

input[type="file"] {
  color: var(--text);
  font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--pik-orange);
}

.period {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.5rem;
  background: var(--input-bg);
}

.period legend { padding: 0 0.35rem; color: var(--muted); }

button, .btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--pik-orange);
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 14px rgba(255, 106, 0, 0.28);
}

button:hover, .btn:hover {
  background: var(--pik-orange-deep);
  filter: none;
}

button.secondary, .btn.secondary {
  background: #fff;
  color: var(--pik-orange-deep);
  border: 1px solid #ffd0a8;
  box-shadow: none;
}
button.secondary:hover:not(:disabled),
.btn.secondary:hover:not(:disabled) {
  background: #ffedd5;
  border-color: var(--pik-orange);
  color: var(--pik-orange-deep);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.18);
}

button.danger, .btn.danger {
  background: #fff;
  color: #c2410c;
  border: 1px solid #ffd4c2;
  box-shadow: none;
}
button.danger:hover:not(:disabled),
.btn.danger:hover:not(:disabled) {
  background: #ffedd5;
  border-color: #ea580c;
  color: #9a3412;
  box-shadow: 0 0 0 2px rgba(194, 65, 12, 0.16);
}

.field-inline {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}
.field-inline input[type="time"],
.field-inline input[type="text"],
.field-inline input[type="number"],
.field-inline input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 14rem;
}
.field-inline button,
.field-inline .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.notice-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.notice-list .notice {
  margin: 0;
}

.result-lead {
  margin: 0.65rem 0 0;
}

.file-results {
  margin-top: 0.85rem;
}
.file-results-toolbar {
  margin-top: 0.35rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.file-select-bar {
  margin-bottom: 0.55rem;
}
.file-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.file-result-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.file-result-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
}
.file-check {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.file-check input,
.file-select-all input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--pik-orange);
  cursor: pointer;
}
.file-result-name {
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}
.file-result-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  justify-self: end;
}
.btn-sm {
  font-size: 0.86rem;
  padding: 0.45rem 0.85rem;
  box-shadow: none;
  white-space: nowrap;
}
.btn.secondary.btn-sm {
  box-shadow: none;
}
button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
@media (max-width: 560px) {
  .file-result-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .file-result-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.preview-bundle .preview-item {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.preview-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.55rem;
}
.preview-item-head .sub {
  margin: 0;
}
.preview-frame {
  width: 100%;
  height: min(92vh, 1400px);
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #525659;
}

.summary-wrap { margin-top: 0.75rem; }

.summary-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.btn-copy {
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
}

.copy-status {
  color: var(--ok);
  font-size: 0.9rem;
}

.summary {
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--summary-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  overflow-x: auto;
  color: #292524;
}
.summary-html {
  font-family: "Onest", system-ui, sans-serif;
  font-size: 0.95rem;
  white-space: pre-wrap;
}
.summary-html b,
.summary-html strong {
  font-weight: 750;
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}
.actions-stack {
  flex-direction: column;
  align-items: stretch;
}
.actions-stack button {
  width: 100%;
  text-align: left;
}

.link { color: var(--muted); text-decoration: none; }
.link:hover { color: var(--pik-orange); }

.menu {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.65rem;
}
.menu li {
  display: block;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.menu li:hover {
  border-color: #ffc089;
  box-shadow: 0 6px 18px rgba(255, 106, 0, 0.08);
}
.menu-tile {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1.05rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
}
.menu-tile strong {
  font-weight: 650;
  color: var(--text);
}
.menu-tile:hover,
.menu-tile:hover strong {
  color: var(--pik-orange-deep);
}
.menu-tile span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.sub {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
}

textarea, select, input[type="text"], input[type="url"], input[type="number"], input[type="password"], input[type="date"], input[type="time"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
}

textarea:focus, select:focus, input:focus {
  outline: 2px solid rgba(255, 106, 0, 0.35);
  border-color: #ffc089;
}

.form-status {
  margin-top: 0.75rem;
  color: var(--ok);
  font-size: 0.95rem;
}
.actions > .form-status,
.actions > .progress,
.actions > .progress-meta {
  flex: 1 0 100%;
}

button[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.92rem;
}

.users-table th,
.users-table td {
  text-align: left;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.users-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  background: var(--pik-orange-soft);
  color: var(--pik-orange-deep);
}

.badge.admin {
  background: #ff6a00;
  color: #fff;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
}

.inline-form input[type="password"],
.inline-form input[type="text"] {
  width: auto;
  min-width: 8rem;
  flex: 1;
  padding: 0.4rem 0.55rem;
}

.inline-form button {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  box-shadow: none;
}

.nav-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
}
.stat-card {
  background: linear-gradient(180deg, #ffffff, #fff7f0);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  margin-top: 0.25rem;
  font-size: 1.6rem;
  font-weight: 750;
  color: var(--pik-orange-deep);
}
.muted-mini {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.bar {
  display: flex;
  height: 0.55rem;
  border-radius: 999px;
  overflow: hidden;
  background: #f5ebe3;
  min-width: 5rem;
}
.bar-web { background: var(--pik-orange); }
.bar-tg { background: #fdba74; }
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.period-form { margin-top: 1rem; }
.period-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}
@media (max-width: 640px) {
  .period-row { grid-template-columns: 1fr; }
}



button.ver, .ver {
  display: inline-block;
  margin-right: 0;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #ffd0a8;
  background: #fff7ed;
  color: var(--pik-orange-deep);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  vertical-align: 0.05em;
  cursor: pointer;
  box-shadow: none;
}
button.ver:hover {
  border-color: var(--pik-orange);
  background: #ffedd5;
}
.ver-static {
  cursor: default;
  pointer-events: none;
}
/* analytics-period-v3 */
.period-box {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #fff8f2);
  display: grid;
  gap: 1.15rem;
}
.chart-user-filter {
  margin: 0 0 0.85rem;
}
.chart-user-field {
  max-width: 48rem;
}
.chart-user-field select {
  width: 100%;
}
.user-ms {
  position: relative;
  max-width: 28rem;
  margin: 0.2rem 0 0.55rem;
}
.user-ms-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #ffd0a8;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-weight: 650;
  color: var(--pik-orange-deep);
  cursor: pointer;
  user-select: none;
  text-align: left;
  box-shadow: none;
}
.user-ms-summary:hover,
.user-ms-summary:focus,
.user-ms-summary:focus-visible {
  background: #fff7ed;
  border-color: #fb923c;
  color: var(--pik-orange-deep);
  filter: none;
  box-shadow: none;
}
.user-ms-summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
  flex: 0 0 auto;
  margin-top: -0.2rem;
}
.user-ms.is-open .user-ms-summary,
.user-ms.is-open .user-ms-summary:hover,
.user-ms.is-open .user-ms-summary:focus {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: #fb923c;
  background: #fff;
  color: var(--pik-orange-deep);
}
.user-ms.is-open .user-ms-summary::after {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}
.user-ms-panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow: auto;
  display: grid;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem 0.55rem;
  border: 1px solid #fb923c;
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(154, 52, 18, 0.12);
}
.user-ms-panel[hidden] {
  display: none;
}
.user-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
}
.user-check:hover {
  background: #fff7ed;
}
.user-check input {
  width: 1rem;
  height: 1rem;
}
.chart-user-actions {
  margin: 0.25rem 0 0;
  gap: 0.5rem;
}
.period-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.period-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.period-custom {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.period-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.85rem;
  align-items: end;
}
.period-custom .field span {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.period-custom input[type="date"] {
  width: 100%;
  min-height: 2.65rem;
  font: inherit;
  font-weight: 650;
  color: var(--pik-orange-deep);
  background: #fff;
  border: 1px solid #ffd0a8;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  box-shadow: none;
  color-scheme: light;
}
.period-custom input[type="date"]:focus {
  outline: 2px solid rgba(255, 106, 0, 0.35);
  border-color: #ffc089;
}
.period-submit {
  margin: 0;
  min-height: 2.65rem;
  white-space: nowrap;
  box-shadow: none;
}
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1.15rem 1.15rem;
  overflow: hidden;
}
.chart-card canvas {
  display: block;
  width: 100% !important;
  max-width: 100%;
}
.chart-wide { grid-column: 1 / -1; }
.chart-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 650;
}
.channel-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: -0.2rem 0 0.7rem;
  color: var(--muted, #78716c);
  font-size: 0.92rem;
}
.channel-share strong {
  color: var(--text, #1c1917);
  font-weight: 650;
}
.channel-share .is-web strong { color: #ff6a00; }
.channel-share .is-tg strong { color: #c2410c; }
.donut-row {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.donut-wrap {
  flex: 0 0 220px;
  max-width: 220px;
  margin: 0;
}
.donut-legend {
  list-style: none;
  flex: 1;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1.75rem;
}
.donut-legend li {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--muted, #78716c);
}
.donut-legend i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  flex: 0 0 auto;
}
.donut-legend span {
  min-width: 0;
}
.donut-legend b {
  margin-left: auto;
  color: var(--text, #1c1917);
  font-weight: 650;
}
@media (max-width: 720px) {
  .period-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .period-submit {
    width: 100%;
    margin-top: 0.35rem;
  }
  .charts-grid { grid-template-columns: 1fr; }
  .donut-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .donut-wrap {
    flex-basis: auto;
    margin: 0 auto;
  }
  .donut-legend { grid-template-columns: 1fr; }
}

.badge.blocked {
  background: #fff1eb;
  color: #c2410c;
  border: 1px solid #ffd4c2;
}
.badge.ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.badge.idle {
  background: #f5f5f4;
  color: #57534e;
  border: 1px solid #e7e5e4;
}
.row-blocked td { opacity: 0.72; }
.users-admin tbody tr.row-blocked { display: none; }
.users-admin.show-blocked tbody tr.row-blocked { display: table-row; }
.users-admin.show-blocked tr.row-none-active { display: none; }
.blocked-filter.switch {
  gap: 0.55rem;
  margin: 0.15rem 0 0.9rem;
}
.blocked-filter .switch-caption {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--pik-orange-deep);
}


.table-scroll {
  overflow-x: visible;
  margin-top: 0.5rem;
}
.panel-wide .form {
  max-width: 28rem;
}
.users-admin {
  width: 100%;
  table-layout: auto;
}
.users-admin th,
.users-admin td {
  padding: 0.45rem 0.55rem;
  vertical-align: middle;
}
.users-admin .col-id {
  width: 2.5rem;
  white-space: nowrap;
}
.users-admin .col-login {
  white-space: nowrap;
}
.users-admin .col-role,
.users-admin .col-status {
  white-space: nowrap;
}
.users-admin .col-ts,
.users-admin .ts-cell {
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--muted);
}
.users-admin .col-morning {
  white-space: nowrap;
}
.users-admin .col-morning .switch-form,
.morning-extra .switch-form {
  margin: 0;
}
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  vertical-align: middle;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.switch-ui {
  width: 2.7rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #efe4da;
  border: 1px solid #e4d3c6;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.2);
  transition: transform 0.18s ease;
}
.switch input:checked + .switch-ui {
  background: var(--pik-orange);
  border-color: var(--pik-orange-deep);
}
.switch input:checked + .switch-ui::after {
  transform: translateX(1.15rem);
}
.switch input:focus-visible + .switch-ui {
  box-shadow: 0 0 0 3px var(--pik-orange-glow);
}
.ssh-line {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
}
.ssh-confirm { margin-top: 0.85rem; }
.toast {
  position: fixed;
  top: 4.4rem;
  right: 0.8rem;
  z-index: 60;
  width: min(22rem, calc(100vw - 1.4rem));
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--pik-orange);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(28, 25, 23, 0.14);
  padding: 0.7rem 2rem 0.75rem 0.85rem;
}
.toast-error { border-left-color: var(--error); }
.toast-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text);
}
.toast-x {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  box-shadow: none;
}
.morning-time {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.morning-time .field { margin: 0; min-width: 8rem; }
.morning-extra {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 1rem;
}
.morning-extra li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.25rem 0;
}
.morning-extra .inline-form { margin: 0; }
.users-admin .col-actions {
  width: 100%;
}

.user-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem 0.85rem;
  align-items: stretch;
  min-width: 0;
}
.user-actions-main {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.user-actions .inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0;
  gap: 0.35rem;
}
.user-actions select {
  width: 7.2rem;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.82rem;
}
.link-now {
  flex: 1 0 100%;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text);
}
.act-link,
.user-actions .act-tg {
  flex-wrap: wrap;
}
.act-link select,
.user-actions .act-tg select {
  width: auto;
  min-width: 14rem;
  flex: 1 1 14rem;
}
.user-actions input[type="password"],
.user-actions input[type="text"] {
  width: 9rem;
  min-width: 0;
  flex: 0 1 auto;
  padding: 0.35rem 0.45rem;
  font-size: 0.82rem;
}
.user-actions .act-login input[type="text"] {
  width: 12rem;
}
.user-actions button {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.user-actions button.secondary:hover:not(:disabled) {
  background: #ffedd5 !important;
  border-color: var(--pik-orange) !important;
  color: var(--pik-orange-deep) !important;
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2);
}
.user-actions button.danger:hover:not(:disabled) {
  background: #ffedd5 !important;
  border-color: #ea580c !important;
  color: #9a3412 !important;
  box-shadow: 0 0 0 2px rgba(194, 65, 12, 0.18);
}
.user-actions .act-block {
  display: flex;
  margin: 0;
}
.user-actions .block-btn {
  height: 100%;
  min-height: 4.75rem;
  min-width: 8.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 650;
}
.user-actions .block-btn:hover:not(:disabled) {
  filter: none;
}
.panel-wide button[type="submit"]:hover:not(:disabled) {
  background: var(--pik-orange-deep);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2);
}
.report-modal,
.changelog-dialog {
  box-sizing: border-box;
  border: none;
  margin: auto;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.report-modal {
  padding: 0 3.4rem 0 0;
  width: min(43.4rem, calc(100vw - 1.25rem));
  height: calc(100vh - 2.5rem);
  max-height: calc(100vh - 2.5rem);
}
.report-modal[open],
.changelog-dialog[open] {
  display: flex;
  flex-direction: column;
}
.report-modal.is-open,
.changelog-dialog.is-open {
  opacity: 1;
  transform: none;
}
.report-modal.is-closing,
.changelog-dialog.is-closing {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}
.report-modal::backdrop,
.changelog-dialog::backdrop {
  background: rgba(28, 25, 23, 0.22);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.report-modal.is-open::backdrop,
.changelog-dialog.is-open::backdrop {
  opacity: 1;
}
.report-modal.is-closing::backdrop,
.changelog-dialog.is-closing::backdrop {
  opacity: 0;
}
.sheet-x {
  position: absolute;
  z-index: 3;
  top: 0.7rem;
  right: 0.4rem;
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  cursor: pointer;
  color: rgba(28, 25, 23, 0.9);
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(28, 25, 23, 0.16);
}
.sheet-x:hover { background: rgba(255, 255, 255, 0.62); }
.sheet-x:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.report-modal-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(28, 25, 23, 0.22);
  overflow: hidden;
}
.report-modal-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.report-modal-loading[hidden] { display: none; }
.report-spinner {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 3px solid #efe4da;
  border-top-color: var(--pik-orange);
  animation: report-spin 0.7s linear infinite;
}
@keyframes report-spin { to { transform: rotate(360deg); } }
.report-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  overscroll-behavior: contain;
}
@media (prefers-reduced-motion: reduce) {
  .report-modal,
  .changelog-dialog,
  .report-modal::backdrop,
  .changelog-dialog::backdrop { transition: none; }
  .report-spinner { animation: none; }
}
.changelog-dialog {
  padding: 0 3.4rem 0 0;
  width: min(51.4rem, calc(100vw - 1.25rem));
  max-width: none;
  max-height: calc(100vh - 2.5rem);
}
.changelog-card {
  margin: 0;
  min-height: 0;
  max-height: calc(100vh - 2.5rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(28, 25, 23, 0.22);
  overflow: hidden;
}
.changelog-title {
  margin: 0;
  padding: 1rem 1.15rem 0.85rem;
  font-size: 1.05rem;
}
.changelog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 0 0.35rem;
  overflow: auto;
}
@media (max-width: 720px) {
  .changelog-dialog {
    padding: 3.4rem 0 0;
    width: min(48rem, calc(100vw - 1.25rem));
  }
}
.changelog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.changelog-table th,
.changelog-table td {
  text-align: left;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.changelog-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chg-tag {
  white-space: nowrap;
  font-weight: 700;
  color: var(--pik-orange-deep);
  font-family: var(--mono);
  font-size: 0.82rem;
}
@media (max-width: 720px) {
  .changelog-page .changelog-table thead { display: none; }
  .changelog-page .changelog-table,
  .changelog-page .changelog-table tbody,
  .changelog-page .changelog-table tr,
  .changelog-page .changelog-table td {
    display: block;
    width: auto;
  }
  .changelog-page .changelog-table tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }
  .changelog-page .changelog-table td {
    border: 0;
    padding: 0.12rem 0;
  }
  .changelog-page .chg-when { color: var(--muted); font-size: 0.82rem; }
}
.chg-when {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.chg-text {
  color: var(--text);
  line-height: 1.4;
}
@media (max-width: 1100px) {
  main.layout-wide {
    max-width: 44rem;
  }
  .user-actions {
    grid-template-columns: 1fr;
  }
  .user-actions .block-btn {
    min-height: 0;
    width: 100%;
  }
  .table-scroll {
    overflow-x: auto;
  }
}

/* --- Dropzone file picker --- */
.dropzone {
  position: relative;
  border: 1.5px dashed #ffc58a;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdfb 0%, var(--pik-orange-soft) 140%);
  padding: 1.05rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--pik-orange);
  box-shadow: 0 0 0 3px var(--pik-orange-glow);
  background: #fff8f1;
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font-size: 0;
}
.dropzone-ui {
  pointer-events: none;
  display: grid;
  gap: 0.35rem;
  text-align: center;
}
.dropzone-title {
  margin: 0;
  color: var(--pik-orange-deep);
  font-weight: 650;
  font-size: 0.95rem;
}
.dropzone-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.dropzone-files {
  margin: 0.15rem 0 0;
  color: var(--text);
  font-size: 0.86rem;
  font-family: var(--mono);
  word-break: break-word;
}
.dropzone.has-files {
  border-style: solid;
  border-color: #ffb06a;
}
.dropzone.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
}

/* collect-progress */
.progress {
  height: 0.55rem;
  background: #f0e4d8;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.85rem;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pik-orange), var(--pik-orange-deep));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-bar.indeterminate {
  width: 35%;
  animation: progress-indet 1.2s ease-in-out infinite;
}
@keyframes progress-indet {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.progress-meta {
  color: var(--muted);
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
}

/* reno-checklist */
.check-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  counter-reset: reno-step;
}
.check-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.42rem 0;
  color: var(--muted);
  counter-increment: reno-step;
}
.check-body { min-width: 0; }
.check-title::before { content: counter(reno-step) ". "; }
.check-mark {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.12rem;
  border-radius: 999px;
  border: 2px solid #e7d5c8;
  flex: 0 0 auto;
  position: relative;
  background: #fff;
}
.check-item.is-run { color: var(--text); }
.check-item.is-run .check-mark {
  border-color: var(--pik-orange);
  box-shadow: 0 0 0 3px var(--pik-orange-soft);
}
.check-item.is-done .check-title { color: #17803d; }
.check-item.is-done .check-mark {
  border-color: #17803d;
  background: #17803d;
}
.check-item.is-done .check-mark::after {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.1rem;
  width: 0.28rem;
  height: 0.52rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check-detail {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.vpn-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.8rem 0 1rem;
}
.vpn-tabs a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
}
.vpn-tabs a.is-on {
  color: var(--text);
  background: var(--pik-orange-soft);
}
.vpn-get {
  display: flex;
  align-items: center;
  margin: 0 0 0.9rem;
}
.vpn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.28rem 0.7rem 0.28rem 0.45rem;
  border-radius: 999px;
  background: #fff;
  color: var(--pik-orange-deep);
  border: 1px solid #ffd0a8;
  text-decoration: none;
  font-weight: 650;
}
.vpn-download svg {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--pik-orange);
}
.vpn-download:hover { background: var(--pik-orange-soft); }
.vpn-version { color: var(--muted); font-weight: 500; }
.vpn-rule {
  display: grid;
  grid-template-columns: 12rem 1fr auto;
  gap: 0.6rem;
  align-items: end;
  margin-bottom: 0.6rem;
}
.vpn-actions, .vpn-manage, .vpn-name {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}
.vpn-name input { min-width: 8rem; flex: 1; }
.vpn-name button[hidden] { display: none; }
#vpn-save[hidden] { display: none; }
main.layout-vpn { max-width: min(72rem, calc(100vw - 2rem)); }
.vpn-devices { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.vpn-devices tr { border-bottom: 1px solid var(--line); }
.vpn-devices th, .vpn-devices td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: 0;
  vertical-align: middle;
}
.vpn-devices th.vpn-ver-col,
.vpn-devices td.vpn-ver-col {
  text-align: center;
}
.vpn-ver {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.35;
}
.vpn-ver.is-current { background: #ecfdf5; color: #047857; }
.vpn-ver.is-old { background: #fff1e6; color: #c2410c; }
.vpn-devices .badge { white-space: nowrap; line-height: 1.35; }
.vpn-manage button {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  box-shadow: none;
}
.vpn-traffic {
  display: block;
  margin-top: 0.28rem;
  color: var(--pik-orange-deep);
  font-size: 0.82rem;
  font-weight: 650;
}
.vpn-traffic[hidden] { display: none; }
.vpn-panel h2 { margin: 1.3rem 0 0.4rem; font-size: 1.05rem; }
.history-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.history-list a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.history-list a:hover { border-color: #ffd0a8; background: var(--pik-orange-soft); }
.history-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.history-when { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.history-snippet {
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.muted { color: var(--muted); }
@media (max-width: 1100px) {
  main.layout-vpn { max-width: min(72rem, calc(100vw - 1.4rem)); }
}
@media (max-width: 720px) {
  .vpn-rule { grid-template-columns: 1fr; }
  .vpn-devices thead { display: none; }
  .vpn-devices,
  .vpn-devices tbody,
  .vpn-devices tr,
  .vpn-devices td { display: block; width: auto; }
  .vpn-devices tr {
    margin: 0 0 0.7rem;
    padding: 0.75rem 0.85rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }
  .vpn-devices td { border: 0; padding: 0.22rem 0; }
  .vpn-devices td:nth-child(2),
  .vpn-devices td:nth-child(3),
  .vpn-devices td.vpn-ver-col {
    display: inline-block;
    width: auto;
    margin: 0.35rem 0.35rem 0 0;
    text-align: left;
    vertical-align: middle;
  }
  .vpn-devices .badge { white-space: normal; }
  .vpn-manage { margin-top: 0.45rem; }
  .vpn-manage form { flex: 1; }
  .vpn-manage button { width: 100%; }
}

html.theme-dark {
  --bg: #000;
  --bg-accent: #000;
  --panel: #111;
  --pik-orange-soft: #1c1c1c;
  --text: #f4f4f4;
  --muted: #a3a3a3;
  --line: #2a2a2a;
  --input-bg: #1a1a1a;
  --summary-bg: #161616;
  color-scheme: dark;
}
html.theme-dark body {
  background: #000;
  color: #f4f4f4;
}
html.theme-dark .top {
  background: rgba(0, 0, 0, 0.94);
  border-bottom-color: #2a2a2a;
}
html.theme-dark .brand,
html.theme-dark .brand:hover,
html.theme-dark .ssh-top-label,
html.theme-dark .side-list a:hover,
html.theme-dark .side-num,
html.theme-dark .stat-value,
html.theme-dark .menu-tile:hover,
html.theme-dark .menu-tile:hover strong,
html.theme-dark .link:hover,
html.theme-dark .chg-tag,
html.theme-dark .vpn-traffic,
html.theme-dark .dropzone-title {
  color: #f4f4f4;
}
html.theme-dark .top-nav-link,
html.theme-dark .top-menu-btn,
html.theme-dark .top-menu[open] ~ .ssh-top,
html.theme-dark .ssh-pop,
html.theme-dark .ssh-info-btn,
html.theme-dark .menu li,
html.theme-dark .stat-card,
html.theme-dark .period-box,
html.theme-dark .file-hints,
html.theme-dark .whats-new,
html.theme-dark .history-list a,
html.theme-dark .toast,
html.theme-dark .dropzone,
html.theme-dark .vpn-download,
html.theme-dark button.ver,
html.theme-dark .ver,
html.theme-dark .report-modal-body,
html.theme-dark .report-modal-loading,
html.theme-dark .report-frame,
html.theme-dark .changelog-card,
html.theme-dark .job-chip-menu {
  background: #111;
  color: #f4f4f4;
  border-color: #333;
}
html.theme-dark .top-nav-link:hover,
html.theme-dark .top-menu-btn:hover,
html.theme-dark .ssh-info-btn:hover,
html.theme-dark .history-list a:hover,
html.theme-dark .dropzone:hover,
html.theme-dark .vpn-download:hover,
html.theme-dark button.ver:hover,
html.theme-dark .job-chip-open:hover {
  background: #1c1c1c;
  color: #fff;
  border-color: #666;
}
html.theme-dark button,
html.theme-dark .btn,
html.theme-dark .account-toggle {
  background: #111;
  color: #f4f4f4;
  border: 1px solid #f4f4f4;
  box-shadow: none;
}
html.theme-dark button:hover,
html.theme-dark .btn:hover,
html.theme-dark .account-toggle:hover {
  background: #2a2a2a;
  color: #fff;
  border-color: #fff;
}
html.theme-dark button.secondary,
html.theme-dark .btn.secondary,
html.theme-dark button.danger,
html.theme-dark .btn.danger,
html.theme-dark button.job-chip-x,
html.theme-dark button.job-chip-stop {
  background: #1c1c1c;
  color: #f4f4f4;
  border-color: #555;
  box-shadow: none;
}
html.theme-dark button.secondary:hover:not(:disabled),
html.theme-dark .btn.secondary:hover:not(:disabled),
html.theme-dark button.job-chip-stop:hover,
html.theme-dark button.job-chip-x:hover {
  background: #2a2a2a;
  color: #fff;
  border-color: #888;
  box-shadow: none;
}
html.theme-dark button.danger,
html.theme-dark .btn.danger,
html.theme-dark button.danger:hover:not(:disabled),
html.theme-dark .btn.danger:hover:not(:disabled) {
  color: #fecaca;
  border-color: #7f1d1d;
}
html.theme-dark .account-ver {
  background: #111;
  color: #f4f4f4;
  border-color: #888;
}
html.theme-dark .account-panel {
  background: #111;
  color: #f4f4f4;
  border: 1px solid #333;
  border-top: 0;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5);
}
html.theme-dark .account-panel-meta {
  color: #d4d4d4;
  border-bottom-color: #333;
}
html.theme-dark button.account-logout,
html.theme-dark a.account-logout {
  background: #1c1c1c;
  color: #f4f4f4;
  border-color: #444;
}
html.theme-dark button.account-logout:hover,
html.theme-dark a.account-logout:hover {
  background: #2a2a2a;
  color: #fff;
  border-color: #888;
}
html.theme-dark textarea:focus,
html.theme-dark select:focus,
html.theme-dark input:focus {
  outline-color: #888;
  border-color: #888;
}
html.theme-dark input[type="checkbox"],
html.theme-dark input[type="radio"] { accent-color: #f4f4f4; }
html.theme-dark .badge { background: #262626; color: #f4f4f4; }
html.theme-dark .badge.admin { background: #f4f4f4; color: #111; }
html.theme-dark .badge.ok,
html.theme-dark .vpn-ver.is-current,
html.theme-dark .conn-status.ok {
  background: #052e1a;
  color: #86efac;
  border-color: #166534;
}
html.theme-dark .badge.blocked,
html.theme-dark .badge-dev,
html.theme-dark .error {
  background: #3f1d1d;
  color: #fecaca;
  border-color: #7f1d1d;
}
html.theme-dark .badge.idle,
html.theme-dark .vpn-ver.is-old,
html.theme-dark .notice,
html.theme-dark .conn-status.warn {
  background: #3b2a14;
  color: #fdba74;
  border-color: #9a3412;
}
html.theme-dark .badge.idle {
  background: #262626;
  color: #d4d4d4;
  border-color: #444;
}
html.theme-dark .job-chip { background: #1c1c1c; color: #f4f4f4; border-color: #444; }
html.theme-dark .job-chip.is-done { background: #052e1a; color: #86efac; border-color: #166534; }
html.theme-dark .job-chip.is-error,
html.theme-dark .job-chip.is-choice { background: #3f1d1d; color: #fecaca; border-color: #7f1d1d; }
html.theme-dark .job-chip.is-running .job-chip-dot,
html.theme-dark .job-chip.is-queued .job-chip-dot { background: #f4f4f4; }
html.theme-dark .whats-new-title { color: #fdba74; }
html.theme-dark .generated { background: #161616; color: #f4f4f4; border-color: #555; }
html.theme-dark .field-needed span { color: #fdba74; }
html.theme-dark .check-item.is-done .check-title { color: #86efac; }
html.theme-dark .check-mark { background: #111; border-color: #555; }
html.theme-dark .bar { background: #262626; }
html.theme-dark .bar-web { background: #f4f4f4; }
html.theme-dark .bar-tg { background: #737373; }
html.theme-dark .progress { background: #262626; }
html.theme-dark .progress-bar { background: #f4f4f4; }
html.theme-dark .ssh-info p { color: #f4f4f4; }
html.theme-dark .ssh-info span { color: #a3a3a3; }
html.theme-dark .sheet-x,
html.theme-dark .toast-x,
html.theme-dark .ssh-info-btn {
  color: #f4f4f4;
  background: #111;
  border-color: #888;
}
html.theme-dark .chart-card,
html.theme-dark .user-ms-summary,
html.theme-dark .user-ms-panel,
html.theme-dark .period-custom input[type="date"],
html.theme-dark .users-table,
html.theme-dark code {
  background: #111;
  color: #f4f4f4;
  border-color: #444;
}
html.theme-dark .user-ms-summary:hover,
html.theme-dark .user-ms-summary:focus,
html.theme-dark .user-ms.is-open .user-ms-summary {
  background: #1c1c1c;
  color: #fff;
  border-color: #888;
}
html.theme-dark .user-actions button.secondary:hover:not(:disabled),
html.theme-dark .panel-wide button.secondary:hover:not(:disabled) {
  background: #2a2a2a !important;
  color: #fff !important;
  border-color: #888 !important;
  box-shadow: none !important;
}
html.theme-dark .user-actions button.danger:hover:not(:disabled),
html.theme-dark .panel-wide button.danger:hover:not(:disabled) {
  background: #3f1d1d !important;
  color: #fecaca !important;
  border-color: #7f1d1d !important;
  box-shadow: none !important;
}
html.theme-dark .panel-wide button[type="submit"]:hover:not(:disabled) {
  background: #2a2a2a;
  color: #fff;
  border-color: #fff;
}
html.theme-dark .report-modal::backdrop,
html.theme-dark .changelog-dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
@media (max-width: 720px) {
  html.theme-dark .vpn-devices tr { background: #111; }
}
html.theme-dark .vpn-tabs a {
  color: #e5e5e5;
}
html.theme-dark .vpn-tabs a.is-on {
  background: #f4f4f4;
  color: #111;
}
html.theme-dark .vpn-download,
html.theme-dark .vpn-download:hover,
html.theme-dark .vpn-download span,
html.theme-dark .vpn-download svg {
  background: #111;
  color: #f4f4f4;
  border-color: #f4f4f4;
}
html.theme-dark .vpn-download .vpn-version { color: #a3a3a3; }
html.theme-dark .top-menu[open] .top-menu-btn,
html.theme-dark .top-menu[open] ~ .ssh-top {
  background: #111;
  color: #f4f4f4;
  border-color: #f4f4f4;
}
