:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-soft: #f7f8f4;
  --line: #e4e4df;
  --text: #1d1d1b;
  --muted: #706f6f;
  --primary: #80bc00;
  --primary-dark: #5d8f00;
  --ink: #252523;
  --blue: #52616b;
  --teal: #80bc00;
  --coral: #706f6f;
  --orange: #a5c95b;
  --green: #80bc00;
  --violet: #3b3b38;
  --shadow: 0 24px 70px rgba(29, 29, 27, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Helvetica Neue", Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.brand small {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-logo {
  display: block;
  width: min(205px, 100%);
  height: auto;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(128, 188, 0, 0.16), rgba(112, 111, 111, 0.12)),
    #d9ddd4;
}

.login-frame {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.75fr);
  width: min(1080px, 100%);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-art {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: var(--ink);
}

.login-photo {
  position: absolute;
  inset: 0;
}

.login-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-photo::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(29, 29, 27, 0.1), rgba(29, 29, 27, 0.78)),
    linear-gradient(90deg, rgba(29, 29, 27, 0.2), rgba(29, 29, 27, 0));
}

.login-photo-caption {
  position: absolute;
  right: 34px;
  bottom: 34px;
  left: 34px;
  z-index: 1;
  color: #fff;
}

.login-photo-caption img {
  width: min(285px, 80%);
  height: auto;
  object-fit: contain;
}

.login-photo-caption p {
  max-width: 420px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.55;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
}

.login-copy {
  margin: 46px 0 28px;
}

.login-copy p,
.page-title p,
.panel-head p {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 4.2vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-copy span,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.alert {
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 95, 87, 0.35);
  border-radius: 8px;
  color: #9f2520;
  background: rgba(255, 95, 87, 0.08);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: #30343b;
  font-size: 13px;
  font-weight: 700;
}

.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%;
  height: 50px;
  margin-bottom: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  background: var(--surface-soft);
  outline: none;
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(128, 188, 0, 0.14);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 16px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.login-form button {
  height: 52px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font: inherit;
  font-weight: 800;
  background: var(--primary);
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  padding: 28px;
}

.sidebar {
  position: sticky;
  top: 28px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px 0 0 6px;
  background: var(--surface);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 42px;
}

.side-nav a,
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #2b3038;
  font-weight: 700;
}

.side-nav a.active,
.side-nav a:hover,
.sidebar-footer a:hover {
  color: var(--text);
  background: rgba(128, 188, 0, 0.14);
}

.side-nav a.active {
  color: var(--primary-dark);
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: currentColor;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.main {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #fbfbfc;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 6px 0 0;
}

.icon-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
}

.page-title {
  margin-right: auto;
  min-width: 0;
}

.page-title h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.site-link,
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.site-link {
  padding: 0 13px;
  font-weight: 800;
}

.user-pill {
  padding: 6px 12px 6px 7px;
}

.user-pill > span,
.profile-card > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background: var(--primary);
}

.user-pill strong,
.profile-card strong {
  display: block;
  font-size: 13px;
}

.user-pill small,
.profile-card small {
  color: var(--muted);
  font-size: 11px;
}

.content {
  padding: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.metric-card {
  position: relative;
  min-height: 124px;
  padding: 18px;
  overflow: hidden;
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
}

.metric-icon.coral {
  background: var(--coral);
}

.metric-icon.blue {
  background: var(--blue);
}

.metric-icon.green {
  background: var(--teal);
}

.metric-icon.violet {
  background: var(--violet);
}

.metric-card p {
  margin: 16px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  font-size: 27px;
}

.spark {
  position: absolute;
  right: 18px;
  bottom: 22px;
  display: flex;
  align-items: end;
  gap: 4px;
  height: 34px;
}

.spark span {
  width: 5px;
  border-radius: 5px;
  background: var(--blue);
}

.spark span:nth-child(1) { height: 12px; opacity: 0.35; }
.spark span:nth-child(2) { height: 18px; opacity: 0.55; }
.spark span:nth-child(3) { height: 28px; }
.spark span:nth-child(4) { height: 22px; opacity: 0.75; }
.spark span:nth-child(5) { height: 15px; opacity: 0.45; }

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-actions a {
  display: grid;
  gap: 10px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.quick-actions strong {
  font-size: 18px;
}

.quick-actions small {
  color: var(--muted);
  font-weight: 700;
}

.profile-card {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
}

.notice {
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(128, 188, 0, 0.35);
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 800;
  background: rgba(128, 188, 0, 0.1);
}

.notice.error {
  border-color: rgba(159, 37, 32, 0.28);
  color: #9f2520;
  background: rgba(159, 37, 32, 0.08);
}

.manage-grid {
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1fr);
  align-items: start;
}

.panel.wide,
.full-panel {
  min-width: 0;
}

.full-panel {
  margin-top: 18px;
}

.edit-panel {
  max-width: 720px;
}

.return-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.inline-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  background: var(--surface-soft);
  outline: none;
}

.stack-form textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.inline-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(128, 188, 0, 0.14);
}

.stack-form button,
.inline-form button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font: inherit;
  font-weight: 900;
  background: var(--primary);
  cursor: pointer;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.section-add-form {
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--line);
}

.inline-form button {
  min-width: 112px;
  padding: 0 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: var(--surface-soft);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.dataTables_wrapper {
  display: grid;
  gap: 12px;
}

.dataTables_wrapper::after {
  display: table;
  clear: both;
  content: "";
}

.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dataTables_length {
  float: left;
}

.dataTables_filter {
  float: right;
  text-align: right;
}

.dataTables_length select,
.dataTables_filter input {
  min-height: 36px;
  margin: 0 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  background: var(--surface-soft);
  outline: none;
}

.dataTables_filter input {
  width: min(260px, 52vw);
}

.dataTables_length select:focus,
.dataTables_filter input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(128, 188, 0, 0.14);
}

.dataTables_info {
  float: left;
  padding-top: 9px;
}

.dataTables_paginate {
  display: flex;
  float: right;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.dataTables_paginate a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.dataTables_paginate a:hover,
.dataTables_paginate .paginate_active {
  border-color: rgba(128, 188, 0, 0.45);
  color: var(--primary-dark);
  background: rgba(128, 188, 0, 0.1);
}

.dataTables_paginate .paginate_button_disabled,
.dataTables_paginate .paginate_disabled_previous,
.dataTables_paginate .paginate_disabled_next {
  opacity: 0.45;
  cursor: default;
}

.data-table th.sorting,
.data-table th.sorting_asc,
.data-table th.sorting_desc {
  cursor: pointer;
}

.data-table th.sorting::after,
.data-table th.sorting_asc::after,
.data-table th.sorting_desc::after {
  float: right;
  color: var(--primary);
  font-size: 10px;
}

.data-table th.sorting::after {
  content: "<>";
}

.data-table th.sorting_asc::after {
  content: "^";
}

.data-table th.sorting_desc::after {
  content: "v";
}

.data-table strong,
.section-card strong,
.doc-item strong {
  display: block;
}

.data-table small,
.section-card small,
.doc-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.count-pill,
.file-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  background: rgba(128, 188, 0, 0.12);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status.on {
  color: #3c7000;
  background: rgba(128, 188, 0, 0.16);
}

.status.off {
  color: #6c6b66;
  background: #eeeeea;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  background: #fff;
  cursor: pointer;
}

.ghost-button:hover {
  border-color: rgba(128, 188, 0, 0.45);
  color: var(--primary-dark);
  background: rgba(128, 188, 0, 0.08);
}

.ghost-button.danger {
  color: #9f2520;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-cell form {
  margin: 0;
}

.session-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-list span {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: var(--surface-soft);
}

.server-checks {
  display: grid;
  gap: 10px;
}

.server-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.server-check span {
  display: inline-flex;
  min-width: 58px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.server-check strong {
  font-size: 13px;
  line-height: 1.35;
}

.server-check.ok span {
  background: var(--primary);
}

.server-check.fail {
  border-color: rgba(159, 37, 32, 0.28);
  background: rgba(159, 37, 32, 0.06);
}

.server-check.fail span {
  background: #9f2520;
}

.qr-print-card {
  max-width: 620px;
}

.qr-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.qr-card img {
  width: 220px;
  height: 220px;
}

.qr-card p {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.qr-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.qr-card strong,
.qr-card small {
  display: block;
}

.qr-card strong {
  margin-bottom: 8px;
  font-size: 18px;
}

.qr-card small {
  color: var(--muted);
  word-break: break-all;
}

.structure-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.structure-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.structure-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.structure-summary strong {
  font-size: 22px;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.code-grid label:last-child {
  grid-column: 1 / -1;
}

.form-note {
  padding: 10px 12px;
  border: 1px solid rgba(128, 188, 0, 0.25);
  border-radius: 8px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  background: rgba(128, 188, 0, 0.08);
}

.is-hidden {
  display: none !important;
}

.structure-tree {
  overflow-x: auto;
  padding: 4px 0;
}

.structure-tree-list {
  display: grid;
  gap: 10px;
  min-width: 520px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.structure-tree-list .structure-tree-list {
  margin-top: 10px;
  padding-left: 28px;
  border-left: 2px solid var(--line);
}

.tree-node {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.tree-node span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  background: rgba(128, 188, 0, 0.12);
}

.tree-node strong,
.tree-node small,
.tree-node code {
  display: block;
}

.tree-node small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tree-node code {
  margin-top: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.tree-node form {
  flex: 0 0 auto;
  margin: 0;
}

.node-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 280px;
}

.node-docs > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.mini-upload-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.mini-upload-form input {
  min-height: 34px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.section-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.elements-section-card {
  grid-column: 1 / -1;
  background: #fff;
}

.elements-document-tree {
  padding: 14px;
}

.element-workbench {
  display: grid;
  grid-template-columns: minmax(360px, 0.56fr) minmax(320px, 0.44fr);
  gap: 14px;
  align-items: start;
}

.element-picker {
  min-width: 0;
}

.tree-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.compact-tree {
  max-height: 620px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.compact-tree-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  list-style: none;
}

.compact-tree-list.is-root {
  padding-left: 0;
}

.compact-tree-item:not(.is-open) > .compact-tree-children {
  display: none;
}

.compact-tree-row {
  display: grid;
  grid-template-columns: 24px minmax(260px, 1fr);
  gap: 6px;
  align-items: center;
}

.tree-toggle,
.tree-toggle-spacer {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

.tree-toggle {
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  background: #fff;
  cursor: pointer;
}

.compact-tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.compact-tree-node:hover,
.compact-tree-node.is-selected {
  border-color: rgba(128, 188, 0, 0.55);
  background: rgba(128, 188, 0, 0.1);
}

.tree-node-main {
  min-width: 0;
}

.tree-node-main strong,
.tree-node-main small {
  display: block;
}

.tree-node-main strong {
  font-size: 12px;
}

.tree-node-main small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tree-count {
  display: inline-flex;
  min-width: 24px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  background: var(--primary);
}

.element-doc-panel {
  position: sticky;
  top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.compact-head {
  margin-bottom: 12px;
}

.compact-head h2 {
  font-size: 16px;
  line-height: 1.25;
}

.ghost-button.is-selected {
  border-color: rgba(128, 188, 0, 0.6);
  color: var(--primary-dark);
  background: rgba(128, 188, 0, 0.14);
}

.compact-tree-node.is-selected .tree-count {
  background: var(--primary-dark);
}

.selected-docs {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.element-upload-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.element-edit-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.element-edit-form .form-span,
.element-edit-form .action-cell {
  grid-column: 1 / -1;
}

.section-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.section-actions form {
  margin: 0;
}

.section-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.doc-list {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.doc-form {
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.doc-form-title {
  margin-bottom: 2px;
  font-size: 14px;
}

.doc-form input[type="file"] {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 10px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.doc-item div {
  min-width: 0;
  margin-right: auto;
}

@media (max-width: 980px) {
  .login-frame,
  .app-shell,
  .work-grid,
  .manage-grid,
  .section-board {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .app-shell {
    padding: 0;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    inset: 12px auto 12px 12px;
    width: 260px;
    height: auto;
    transform: translateX(-115%);
    transition: transform 0.2s ease;
    border-radius: 14px;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    border: 0;
    border-radius: 0;
  }

  .topbar {
    border-radius: 0;
  }

  .icon-button {
    display: grid;
    place-items: center;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 0;
  }

  .login-frame {
    min-height: 100vh;
    border-radius: 0;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .site-link {
    display: none;
  }

  .dashboard-grid,
  .quick-actions,
  .structure-summary,
  .code-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 14px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .element-workbench {
    grid-template-columns: 1fr;
  }

  .element-doc-panel {
    position: static;
  }

  .mini-upload-form {
    grid-template-columns: 1fr;
  }
}
