:root {
  --page: #0d1117;
  --surface: #161b22;
  --card: #21262d;
  --border: rgba(255,255,255,.07);
  --text: #e6edf3;
  --muted: #7d8590;
  --accent: #51cf66;
  --accent-dim: rgba(81,207,102,.2);
  --top-h: 60px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--top-h) + 10px);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.top-left, .top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.logo svg {
  height: 34px;
  width: auto;
  overflow: visible;
}

.logo:hover {
  color: var(--accent);
}

.top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  min-width: 42px;
  padding: 0 10px;
  background: var(--card);
  color: var(--muted);
  text-decoration: none;
  border: var(--rz-border-w, 2px) solid var(--border);
  border-radius: var(--rz-radius, 12px);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.top-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.top-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.top-btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.top-btn.icon-btn {
  gap: 0;
  padding: 0;
  width: 42px;
  letter-spacing: 0;
}

html[data-style=cartoon] .top-btn {
  box-shadow: 0 3px 0 var(--border);
}

html[data-style=cartoon] .top-btn:active {
  box-shadow: none;
  transform: translateY(2px);
}

.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rz-radius-lg, 16px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.menu a {
  padding: 11px 14px;
  border-radius: var(--rz-radius, 12px);
  text-decoration: none;
  font-weight: 500;
}

.menu a:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

@media (max-width: 700px) {
  .menu-btn span {
    display: none;
  }
  .menu {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--top-h);
    bottom: 0;
    min-width: 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    gap: 6px;
    box-shadow: none;
    background: var(--page);
  }
  .menu a {
    padding: 16px;
    font-size: 20px;
    background: var(--card);
    border: 1px solid var(--border);
  }
  body.menu-open {
    overflow: hidden;
  }
}
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.settings-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.settings-panel {
  position: fixed;
  top: calc(var(--top-h) + 16px);
  right: 24px;
  bottom: 16px;
  z-index: 100;
  width: 320px;
  max-width: calc(100% - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--rz-radius-lg, 20px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transform: translateX(calc(100% + 48px));
  transition: transform 0.4s cubic-bezier(0.32, 0, 0.15, 1);
}

.settings-panel.show {
  transform: translateX(0);
}

@media (max-width: 700px) {
  .settings-panel {
    right: 16px;
  }
}
.settings-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.settings-title {
  font-size: 0.8em;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}

.settings-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.15s, color 0.15s;
}

.settings-close:hover {
  background: var(--accent);
  color: #000;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.s-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.s-label {
  font-size: 0.65em;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

.btn-reset {
  margin-top: auto;
  width: 100%;
  height: 38px;
  flex-shrink: 0;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.85em;
  letter-spacing: 0.3px;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  transition: transform 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-reset:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.custom-select-wrap {
  width: 100%;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 100px;
}

.custom-select__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.custom-select__btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.custom-select__btn.open {
  background: var(--surface);
  border-color: var(--accent);
}

.custom-select__btn.open .custom-select__arrow {
  transform: rotate(180deg);
}

.custom-select__text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__arrow {
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.custom-select__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000;
  width: 100%;
  max-height: 240px;
  padding: 4px;
  overflow-y: auto;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.custom-select__dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select__option {
  position: relative;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}

.custom-select__option::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.15s ease;
}

.custom-select__option:hover {
  background: var(--accent-dim);
  color: var(--accent);
  padding-left: 18px;
}

.custom-select__option:hover::before {
  width: 7px;
}

.custom-select__option.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 700px) {
  .row {
    grid-template-columns: 1fr;
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rz-radius-lg, 20px);
  padding: 16px;
  min-width: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
}

.h-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.h-link .arrow {
  transition: transform 0.15s;
}

.h-link:hover .arrow {
  transform: translateX(4px);
}

.empty, .note {
  color: var(--muted);
  margin: 0;
}

.note {
  margin-top: 12px;
  font-size: 14px;
}

.more {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.more:hover {
  text-decoration: underline;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.files li {
  display: flex;
  gap: 6px;
}

.files a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rz-radius, 12px);
  text-decoration: none;
}

.files a:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.files .file {
  flex: 1;
  min-width: 0;
}

.nr {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.files .file-btn {
  flex: none;
  justify-content: center;
  width: 46px;
  padding: 0;
  color: var(--muted);
}
.files .file-btn svg {
  width: 22px;
  height: 22px;
}

.files .file-btn:hover {
  color: var(--accent);
}

.ext {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
}

.name {
  flex: 1;
  overflow-wrap: anywhere;
}

.calcs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 10px;
}

.calc {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border: var(--rz-border-w, 2px) solid var(--border);
  border-radius: var(--rz-radius-lg, 16px);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

a.calc:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.calc-ico {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--rz-radius, 12px);
  background: var(--surface);
  color: var(--text);
}

.calc-ico svg {
  width: 40px;
  height: 40px;
  overflow: visible;
}

a.calc:hover .calc-ico {
  color: var(--accent);
}

.calc-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.calc-name {
  font-weight: 600;
  font-size: 18px;
}

.calc-desc {
  color: var(--muted);
  font-size: 14px;
}

.calc.off {
  cursor: not-allowed;
  border-style: dashed;
  background: repeating-linear-gradient(135deg, var(--card) 0 12px, var(--surface) 12px 24px);
}

.calc.off .calc-ico {
  filter: grayscale(1);
  opacity: 0.45;
}

.calc.off .calc-name {
  color: var(--muted);
}

.calc.off .calc-desc {
  opacity: 0.6;
}

.calc.off .calc-txt {
  padding-right: 74px;
}

.soon {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.soon svg {
  width: 12px;
  height: 12px;
}

.building {
  text-align: center;
  padding: 40px 16px;
}

.building p {
  font-size: 20px;
  margin: 8px 0 0;
}

.building-ico {
  width: 90px;
  height: 90px;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}

.modal {
  width: min(360px, 100%);
  padding: 24px 20px 20px;
  text-align: center;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--rz-radius-lg, 20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.modal-ico {
  width: 72px;
  height: 72px;
  color: var(--muted);
}

.modal h3 {
  margin: 10px 0 6px;
  font-size: 20px;
  color: var(--text);
}

.modal p {
  margin: 0 0 18px;
  color: var(--muted);
}

.modal-ok {
  width: 100%;
  height: 44px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: #000;
  border: 0;
  border-radius: var(--rz-radius, 12px);
}

.modal-ok:hover {
  opacity: 0.88;
}
