:root {
  --bg: #f7f7f8;
  --panel: #fff;
  --panel-soft: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #111827;
  --primary-2: #374151;
  --danger: #dc2626;
  --ok: #16a34a;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
  --radius: 20px;
  --sidebar: 292px;
}
* {
  box-sizing: border-box;
}
html {
  height: 100%;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}
.brand {
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 4px 2px 14px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  border-left: 0;
  border-top: 0;
  border-right: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.brand:hover .brand-title {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: none;
  flex: 0 0 auto;
}
.brand-mark i {
  font-size: 17px;
  line-height: 1;
}
.brand-text {
  min-width: 0;
}
.brand-title {
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nav-item:hover {
  background: var(--panel-soft);
}
.nav-item.active {
  background: #111827;
  color: #fff;
}
.nav-item .txt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item .ico {
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
  display: grid;
  place-items: center;
}
.nav-item i {
  font-size: 15px;
  line-height: 1;
}
.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.side-action {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.side-action:hover {
  background: var(--panel-soft);
}
.side-action.primary {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.side-action.danger {
  color: var(--danger);
  background: #fff;
}
.side-action[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.side-action i {
  width: 18px;
  text-align: center;
}
.side-action.login-action {
  border-color: transparent;
  background: transparent;
  color: #9ca3af;
  padding: 8px 10px;
  font-size: 13px;
}
.side-action.login-action:hover {
  background: #f9fafb;
  color: #6b7280;
}
.side-action.login-action.is-admin {
  border-color: #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 14px;
}
.admin-pill {
  font-size: 12px;
  color: var(--ok);
  padding: 0 2px;
}

.app-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 0;
  color: #9ca3af;
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  user-select: none;
}
.app-foot-name {
  font-weight: 500;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.topbar {
  height: 78px;
  flex: 0 0 auto;
  background: rgba(247, 247, 248, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  min-width: 0;
  z-index: 10;
}
.back-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  flex: 0 0 auto;
}
.back-btn:hover {
  background: #f9fafb;
}
.back-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.back-btn i {
  font-size: 17px;
  line-height: 1;
  transform: translateX(-1px);
}
.title-wrap {
  min-width: 0;
  flex: 1;
}
.page-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 560;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.page-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}
.breadcrumb a,
.breadcrumb span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb a:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.breadcrumb-sep {
  flex: 0 0 auto;
  color: #cbd5e1;
}
.top-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
}
.btn:hover {
  background: #f9fafb;
}
.btn.primary {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.btn.danger {
  background: #fff;
  color: var(--danger);
  border-color: #fecaca;
}
.btn.small {
  padding: 7px 10px;
  min-height: 34px;
  border-radius: 11px;
  font-size: 13px;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn i {
  line-height: 1;
}
.content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px;
}
.view {
  max-width: 1100px;
  margin: 0 auto;
  animation-duration: 0.18s;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
}
.view.forward {
  animation-name: slideForward;
}
.view.back {
  animation-name: slideBack;
}
@keyframes slideForward {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideBack {
  from { opacity: 0; }
  to { opacity: 1; }
}
.grid {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 18px 4px 15px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.035);
  width: 100%;
  height: 68px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  transition:
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.card.is-invisible {
  background: #f9fafb;
  border-style: dashed;
  opacity: 0.68;
  filter: saturate(0.65);
}
.card.is-invisible .card-icon {
  background: #e5e7eb;
  color: #6b7280;
}
.card.is-invisible .card-title {
  color: #6b7280;
}
.admin-mode .card {
  height: 76px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.card.clickable {
  cursor: pointer;
}
.card.clickable:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
body:not(.admin-mode) .card[data-open-section] .card-title {
  -webkit-line-clamp: 3;
}
body:not(.admin-mode) .card[data-open-section] .card-side,
body:not(.admin-mode) .card[data-open-section] .card-info,
body:not(.admin-mode) .card[data-open-section] .meta-line {
  flex: 0 0 auto;
  max-width: none;
  overflow: visible;
}
.nav-chevron {
  font-size: 22px;
  color: #9ca3af;
  flex: 0 0 auto;
  line-height: 1;
}
.card.clickable:hover .nav-chevron {
  color: #111827;
  transform: translateX(1px);
}
.resource-card {
  cursor: pointer;
}
.resource-card .card-title {
  -webkit-line-clamp: 3;
}
.resource-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.resource-side {
  display: flex;
  align-items: center;
  align-self: stretch;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}
.open-resource-btn {
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  white-space: nowrap;
}
.open-resource-btn:hover {
  background: #374151;
  border-color: #374151;
}
.admin-resource-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.card-head {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: 0 0 auto;
  color: #111827;
}
.card-icon i {
  font-size: 16px;
  line-height: 1;
}
.card-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.card-title {
  font-weight: 510;
  font-size: 15.5px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.card-side {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 9px;
  flex: 0 1 auto;
  max-width: 52%;
  min-width: 0;
  overflow: hidden;
}
.card-info {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.meta-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  min-width: 0;
}
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.card-actions .btn {
  min-width: 0;
}
.card-actions .btn .action-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
}
.order-btn {
  width: 28px;
  height: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  line-height: 1;
}
.order-btn:hover {
  background: #f9fafb;
}
.order-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}
.badge {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 5px;
  color: var(--muted);
  width: max-content;
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge.off {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.empty {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.mobile-menu-btn {
  display: none;
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  opacity: 0.9;
}
.mobile-menu-btn i {
  font-size: 17px;
  line-height: 1;
  display: block;
}
.mobile-menu-btn.is-hidden {
  display: none !important;
}
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 15;
}
dialog {
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: -18px 0 60px rgba(15, 23, 42, 0.18);
  width: min(520px, calc(100vw - 22px));
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  background: #fff;
  animation: sheetIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}
@keyframes sheetIn {
  from {
    opacity: 0.7;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal {
  padding: 22px;
  min-height: 100%;
  max-height: 100dvh;
  overflow: auto;
}
.modal h2 {
  margin: 0 0 12px;
  font-size: 20px;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 560;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.password-toggle:hover {
  background: var(--panel-soft);
  color: var(--text);
}
.password-toggle i {
  font-size: 15px;
  line-height: 1;
}
.id-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: lowercase;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.check input {
  width: 18px;
  height: 18px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
  flex-wrap: wrap;
  position: sticky;
  bottom: -22px;
  background: linear-gradient(to top, #fff 82%, rgba(255, 255, 255, 0));
  padding-top: 14px;
  padding-bottom: 2px;
}
.text-edit-area {
  min-height: 260px !important;
  line-height: 1.55;
}
.icon-picker {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.icon-picker-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.icon-preview {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.icon-preview i {
  font-size: 21px;
  line-height: 1;
}
.icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
}
.icon-choice {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  color: #111827;
}
.icon-choice:hover,
.icon-choice.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.icon-choice i {
  font-size: 16px;
  line-height: 1;
}
.help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.danger-zone {
  border: 1px solid #fecaca;
  background: #fff7f7;
  border-radius: 14px;
  padding: 12px;
}
.create-wrap {
  position: relative;
  display: inline-flex;
}
.create-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 7px;
  z-index: 30;
}
.create-menu[hidden] {
  display: none;
}
.create-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 11px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}
.create-menu button:hover {
  background: var(--panel-soft);
}
.create-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.create-menu i {
  width: 18px;
  text-align: center;
}
.text-entry h1,
.text-entry h2,
.text-entry h3 {
  color: var(--text);
  font-weight: 560;
  line-height: 1.25;
  margin: 0.15em 0 0.45em;
}
.text-entry h1 {
  font-size: 1.45em;
}
.text-entry h2 {
  font-size: 1.22em;
}
.text-entry h3 {
  font-size: 1.08em;
}
.text-entry p {
  margin: 0.25em 0 0.65em;
}
.text-entry ul,
.text-entry ol {
  margin: 0.3em 0 0.75em;
  padding-left: 1.35em;
}
.text-entry li {
  margin: 0.16em 0;
}
.text-entry blockquote {
  margin: 0.45em 0 0.85em;
  padding-left: 12px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.text-entry > :last-child {
  margin-bottom: 0;
}
.text-entry h1:last-child,
.text-entry h2:last-child,
.text-entry h3:last-child {
  margin-top: 0;
  margin-bottom: 0;
}
.config-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.tab-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}
.tab-btn.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.tab-panel[hidden] {
  display: none;
}
.config-general {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.config-general .field {
  gap: 8px;
}
.config-general .field > label,
.icon-slots .field > label {
  display: block;
  margin: 0 0 7px;
  padding-left: 1px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.config-general .row {
  gap: 20px;
}
.config-general input {
  min-height: 46px;
}
.icon-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 12px;
  margin-top: 12px;
}
.icon-slot-field {
  position: relative;
}
.icon-slot-preview {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  color: #111827;
  pointer-events: none;
}
.icon-slot-field input {
  padding-right: 48px;
}
.config-note {
  margin-bottom: 2px;
}
.config-note label {
  margin-bottom: 6px !important;
}
.file-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}
.file-count i {
  font-size: 12px;
  line-height: 1;
}
.file-count span {
  font-weight: 520;
}
.text-entry {
  position: relative;
  min-width: 0;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  color: #374151;
  font-size: 15px;
  line-height: 1.65;
  padding: 12px 2px 12px 0;
  margin: 6px 0;
}
.text-entry b {
  font-weight: 540;
  color: var(--text);
}
.text-entry i {
  color: #374151;
}
.text-entry a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.text-entry a:hover {
  text-decoration-style: solid;
}
.text-entry-admin {
  padding-right: 122px;
}
.text-entry.is-invisible {
  background: #f9fafb;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  opacity: 0.68;
  filter: saturate(0.65);
  padding-left: 14px;
  padding-right: 122px;
}
.text-entry.is-invisible,
.text-entry.is-invisible p,
.text-entry.is-invisible li,
.text-entry.is-invisible blockquote,
.text-entry.is-invisible h1,
.text-entry.is-invisible h2,
.text-entry.is-invisible h3,
.text-entry.is-invisible b,
.text-entry.is-invisible i {
  color: #6b7280;
}
.text-entry-tools {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  gap: 5px;
  align-items: center;
}
.text-tool {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.text-tool:hover {
  background: #f9fafb;
}
.text-tool.danger {
  color: var(--danger);
  border-color: #fecaca;
}
.text-tool:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}
@media (max-width: 840px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, var(--sidebar));
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    height: 100vh;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .scrim.show {
    display: block;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .main {
    height: 100vh;
  }
  .topbar {
    height: auto;
    min-height: 72px;
    padding: 10px 12px;
    gap: 8px;
  }
  .page-title {
    font-size: 18px;
  }
  .page-subtitle {
    font-size: 12px;
  }
  .top-actions .btn {
    padding: 9px 10px;
  }
  .top-actions .btn .label {
    display: none;
  }
  .content {
    padding: 16px 12px 86px;
  }
  .grid {
    max-width: 100%;
  }
  .row {
    grid-template-columns: 1fr;
  }
  .card {
    height: 66px;
    padding: 4px 13px 4px 12px;
    gap: 7px;
  }
  .admin-mode .card {
    height: 74px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .card-icon {
    width: 32px;
    height: 32px;
    border-radius: 13px;
  }
  .card-title {
    font-size: 14.5px;
  }
  .card-side {
    max-width: 48%;
    gap: 6px;
  }
  .card-info .meta {
    max-width: 116px;
  }
  .meta-line {
    gap: 4px;
  }
  .card-actions {
    flex-direction: row;
    gap: 5px;
  }
  .card-actions .btn {
    padding: 6px 7px;
    min-height: 30px;
    font-size: 12px;
  }
  .card-actions .btn .action-label {
    display: none;
  }
  .order-btn {
    width: 27px;
    height: 27px;
  }
  .badge {
    max-width: 74px;
  }
  .nav-chevron {
    font-size: 19px;
  }
  .resource-side {
    gap: 6px;
  }
  .open-resource-btn {
    padding: 6px 8px;
    min-height: 30px;
    font-size: 12px;
  }
  .open-resource-btn .action-label {
    display: none;
  }
  .admin-resource-actions {
    gap: 5px;
  }
  .text-entry-admin {
    padding-right: 0;
    padding-bottom: 44px;
  }
  .text-entry-tools {
    top: auto;
    bottom: 6px;
    right: 0;
  }
  .modal {
    padding: 18px;
  }
  dialog {
    width: min(94vw, 520px);
    border-radius: 0;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 0 0 auto;
  }
  .back-btn {
    width: 40px;
    height: 40px;
  }
  .icon-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .icon-slots {
    grid-template-columns: 1fr;
  }
}
.side-action[hidden] {
  display: none !important;
}

.utility-page {
  margin: 40px;
  line-height: 1.5;
}
.utility-card {
  max-width: 760px;
}
.nav-empty {
  padding: 14px;
}
.field-compact {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
