.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px;
}

.workspace {
  width: min(1480px, 100%);
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.glass-card {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: var(--radius-xl);
  padding: 18px 26px;
}

.topbar {
  min-height: 80px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-badge {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-badge svg,
.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.brand-meta {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.search-box {
  position: relative;
  width: min(360px, 100%);
  min-width: 260px;
}

.search-box input,
.inline-input,
.inline-select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fafbfc;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box input:focus,
.inline-input:focus,
.inline-select:focus {
  border-color: rgba(14, 116, 144, 0.4);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.08);
}

.search-box input {
  min-height: 40px;
  border-radius: 10px;
  padding: 8px 14px 8px 38px;
  font-size: 14px;
  color: var(--muted);
}

.search-icon {
  position: absolute;
  inset: 0 auto 0 12px;
  width: 16px;
  height: 16px;
  margin: auto 0;
  color: var(--muted);
  display: inline-flex;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.header-btn {
  min-width: 80px;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.header-btn:hover {
  background: #f8fafc;
  border-color: var(--line-strong);
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease;
  font-size: 14px;
}

.btn:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
}

.btn-primary {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-ghost {
  background: rgba(14, 116, 144, 0.08);
  color: var(--accent-strong);
  border-color: rgba(14, 116, 144, 0.12);
}

.btn-muted {
  color: var(--muted);
}

.btn-danger {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.06);
  border-color: rgba(192, 57, 43, 0.12);
}

.btn-small {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0;
  background: transparent;
  border: 0;
}

.crumb {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  color: var(--text);
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.crumb.is-current {
  color: #0f172a;
  font-weight: 700;
  background: #f8fafc;
}

.toolbar-legacy {
  flex-shrink: 0;
  padding: 12px 14px;
}

.toolbar-actions-legacy {
  gap: 8px;
}

.page-stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-bar {
  flex-shrink: 0;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.page-panel {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.page-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.home-page,
.admin-page {
  width: 100%;
}

.home-explorer-panel,
.admin-main-panel,
.admin-auth-panel {
  display: flex;
  flex-direction: column;
}

.explorer-body {
  padding: 20px 22px 22px;
}

.admin-panel-scroll {
  padding: 20px;
}

.admin-scroll-stack {
  display: grid;
  gap: 16px;
}

.admin-section {
  display: grid;
  gap: 16px;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.admin-section-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.admin-toolbar-main,
.admin-toolbar-actions,
.admin-toolbar-stack {
  width: 100%;
}

.admin-toolbar-actions,
.admin-toolbar-stack {
  justify-content: flex-end;
}

.admin-toolbar-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.admin-filter-bar {
  width: 100%;
  margin-bottom: 0;
}

.toolbar-btn {
  min-width: 80px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.toolbar-btn-active {
  background: #f1f5f9;
  border-color: var(--line-strong);
}

.toolbar-select {
  min-width: 90px;
  min-height: 40px;
  width: auto;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  appearance: auto;
  text-align: center;
  text-align-last: center;
}

.filter-popup-wrap {
  position: relative;
  display: inline-block;
}

.filter-popup-trigger {
  min-width: 72px;
}

.filter-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 140px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-popup-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}

.filter-popup-item:hover {
  background: #f1f5f9;
}

.filter-popup-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.toolbar-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(14, 116, 144, 0.08);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}

.surface {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.surface-legacy {
  display: block;
}

.explorer,
.inspector,
.admin-board,
.share-board,
.auth-board {
  border-radius: var(--radius-xl);
  min-height: 0;
}

.explorer,
.admin-board,
.share-board,
.auth-board {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 12px;
}

.panel-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.panel-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.panel-body {
  flex: 1;
  min-height: 0;
  padding: 0 24px 24px;
  overflow: auto;
}

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

.mini-stat {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
}

.mini-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.mini-stat-value {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.mini-stat-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.status-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.file-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
  overflow: hidden;
}

.item-pick {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 0;
}

.item-pick.is-active {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.item-card:hover {
  border-color: rgba(14, 116, 144, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.item-card.is-selected {
  border-color: rgba(14, 116, 144, 0.5);
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.12);
  background: #f8fcfd;
}

.item-card-legacy {
  min-height: 120px;
  justify-content: center;
}

.file-grid.is-list .item-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

.item-icon {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid var(--line);
}

.item-icon.folder {
  color: #b45309;
  background: #fffbeb;
  border-color: rgba(180, 83, 9, 0.2);
}

.item-icon.pdf {
  color: #dc2626;
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.2);
}

.item-icon.image {
  color: #0891b2;
  background: #ecfeff;
  border-color: rgba(8, 145, 178, 0.2);
}

.item-icon.video {
  color: #4f46e5;
  background: #eef2ff;
  border-color: rgba(79, 70, 229, 0.2);
}

.item-icon.audio {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: rgba(124, 58, 237, 0.2);
}

.item-icon.archive {
  color: #16a34a;
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, 0.2);
}

.item-icon.file,
.item-icon.text,
.item-icon.app {
  color: #475569;
  background: #f1f5f9;
  border-color: var(--line);
}

.item-icon svg {
  width: 26px;
  height: 26px;
}

.item-content {
  min-width: 0;
  flex: 1;
}

.item-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
  font-weight: 600;
}

.item-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.item-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 32, 51, 0.05);
}

.details-drawer-wrap {
  position: fixed;
  inset: 0;
  z-index: 26;
  pointer-events: none;
}

.details-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: opacity 180ms ease;
}

.details-drawer {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 36px));
  border-radius: var(--radius-xl);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(calc(100% + 24px));
  transition: transform 220ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.details-drawer.is-open {
  transform: translateX(0);
}

.details-drawer-wrap.is-open {
  pointer-events: auto;
}

.details-drawer-wrap.is-open .details-drawer-backdrop {
  opacity: 1;
}

.details-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.details-drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
}

.details-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.details-panel-shell,
.details-panel-empty {
  display: grid;
  gap: 14px;
}

.details-panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.details-panel-copy {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
  word-break: break-all;
}

.details-panel-grid {
  display: grid;
  gap: 10px;
}

.details-kv {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.details-k {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.details-v {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
}

.details-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(14, 116, 144, 0.06);
  border: 1px solid rgba(14, 116, 144, 0.15);
}

.preview-modal {
  width: min(1080px, 100%);
  max-height: min(88vh, 980px);
  display: flex;
  flex-direction: column;
}

.preview-modal-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.preview-media-shell {
  min-height: min(72vh, 760px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.preview-media-shell img,
.preview-media-shell video,
.preview-media-shell iframe {
  width: 100%;
  max-height: min(72vh, 760px);
  border: 0;
  object-fit: contain;
  background: white;
  border-radius: var(--radius-md);
}

.preview-text {
  margin: 0;
  padding: 20px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
}

.preview-editor {
  width: 100%;
  min-height: min(70vh, 720px);
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  padding: 20px;
  line-height: 1.7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.check-row input {
  width: 18px;
  height: 18px;
}

.inspector {
  padding: 18px;
}

.inspector-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
}

.inspector-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.inspector-copy {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.detail-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.detail-key {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail-value {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
}

.detail-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  height: 100%;
  padding: 36px 20px;
  text-align: center;
}

.empty-orb {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  background: rgba(14, 116, 144, 0.08);
  color: var(--accent);
}

.empty-orb svg {
  width: 36px;
  height: 36px;
}

.empty-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.empty-copy {
  margin: 8px auto 0;
  max-width: 480px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

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

.admin-board {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.admin-bar {
  align-items: flex-start;
  min-height: auto;
  padding: 14px 20px;
}

.admin-bar .admin-toolbar-actions {
  flex-wrap: wrap;
}

.admin-bar-secondary {
  gap: 18px;
}

.admin-card {
  padding: 16px;
  border-radius: var(--radius-xl);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.admin-card.span-4 {
  grid-column: span 4;
}

.admin-card.span-6 {
  grid-column: span 6;
}

.admin-card.span-8 {
  grid-column: span 8;
}

.admin-card.span-12 {
  grid-column: span 12;
}

.admin-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
}

.admin-copy {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.attention-list,
.latest-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.attention-item,
.latest-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.attention-item[data-level="warning"] {
  background: rgba(183, 110, 17, 0.06);
  border-color: rgba(183, 110, 17, 0.15);
}

.attention-item[data-level="ok"] {
  background: rgba(24, 121, 78, 0.06);
  border-color: rgba(24, 121, 78, 0.15);
}

.attention-title,
.latest-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.attention-copy,
.latest-copy {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.share-board {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
}

.share-side {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: #0f4c5c;
  color: white;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.share-side .panel-title,
.share-side .panel-copy,
.share-side .toolbar-tag {
  color: inherit;
}

.share-side .toolbar-tag {
  background: rgba(255, 255, 255, 0.12);
}

.share-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 28px;
  gap: 18px;
}

.share-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.share-filter-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.share-filter-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.share-filter-count {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
}

.share-filter-active .share-filter-count {
  background: rgba(255, 255, 255, 0.2);
}

.share-status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.tag-active {
  background: rgba(24, 121, 78, 0.1);
  color: #18794e;
}

.tag-expired {
  background: rgba(192, 57, 43, 0.1);
  color: #c0392b;
}

.tag-soon {
  background: rgba(183, 110, 17, 0.1);
  color: #b76e11;
}

.tag-unlimited {
  background: rgba(14, 116, 144, 0.1);
  color: #0e7490;
}

.tag-password {
  background: rgba(107, 70, 193, 0.1);
  color: #6b46c1;
}

.tag-preview {
  background: rgba(24, 121, 78, 0.1);
  color: #18794e;
}

.tag-no-preview {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.tag-download {
  background: rgba(14, 116, 144, 0.1);
  color: #0e7490;
}

.tag-no-download {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.tag-exhausted {
  background: rgba(192, 57, 43, 0.1);
  color: #c0392b;
}

.share-item-expired {
  opacity: 0.7;
  border-left: 3px solid rgba(192, 57, 43, 0.4);
}

.share-item-exhausted {
  opacity: 0.85;
  border-left: 3px solid rgba(107, 70, 193, 0.4);
}

.share-item-expiring-soon {
  border-left: 3px solid rgba(183, 110, 17, 0.4);
}

.status-dot-expired {
  background: #c0392b;
}

.status-dot-exhausted {
  background: #6b46c1;
}

.status-dot-soon {
  background: #b76e11;
}

.admin-status-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-danger:hover {
  background: rgba(192, 57, 43, 0.12);
  border-color: rgba(192, 57, 43, 0.24);
}

.preview-stage {
  flex: 1;
  min-height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.preview-stage img,
.preview-stage video,
.preview-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: white;
}

.stack {
  display: grid;
  gap: 14px;
}

.modal-wrap,
.toast-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.modal-wrap {
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.modal-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: var(--radius-xl);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.modal-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.modal-copy {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.modal-form {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.inline-input,
.inline-select {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}

.toast-wrap {
  display: grid;
  place-items: end center;
  padding: 24px;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 12px;
  color: white;
  background: rgba(16, 32, 51, 0.92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.toast[data-type="success"] {
  background: rgba(24, 121, 78, 0.95);
}

.toast[data-type="error"] {
  background: rgba(192, 57, 43, 0.95);
}

.upload-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

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

.upload-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.upload-panel-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.upload-panel-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.upload-panel-btn:hover {
  background: rgba(16, 32, 51, 0.06);
}

.upload-panel-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.upload-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-row-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--muted);
}

.upload-row-icon svg { width: 100%; height: 100%; }

.upload-row[data-status="success"] .upload-row-icon { color: #18794e; }
.upload-row[data-status="error"] .upload-row-icon { color: #c0392b; }

.upload-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.upload-row-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.upload-row-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.08);
  overflow: hidden;
}

.upload-row-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.upload-row[data-status="success"] .upload-row-bar { background: #18794e; }
.upload-row[data-status="error"] .upload-row-bar { background: #c0392b; }

.upload-row-status {
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 auto;
  min-width: 36px;
  text-align: right;
}

.upload-row-remove,
.upload-row-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background .15s;
}
.upload-row-btn:hover {
  background: var(--hover-bg, rgba(128,128,128,0.1));
  color: var(--text);
}

.result-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 12px;
  font-size: 13px;
  color: var(--muted);
}

.result-hint .status-dot { flex: 0 0 auto; }

.markdown-body {
  line-height: 1.7;
  color: var(--text);
  word-wrap: break-word;
  overflow-y: auto;
  max-height: 100%;
  padding: 4px 2px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 1.2em 0 0.6em;
  line-height: 1.3;
  font-weight: 700;
}

.markdown-body h1 { font-size: 1.6em; }
.markdown-body h2 { font-size: 1.35em; }
.markdown-body h3 { font-size: 1.15em; }
.markdown-body p { margin: 0.6em 0; }
.markdown-body ul,
.markdown-body ol { margin: 0.6em 0; padding-left: 1.6em; }
.markdown-body li { margin: 0.25em 0; }

.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(16, 32, 51, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.markdown-body pre {
  background: rgba(16, 32, 51, 0.06);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
}

.markdown-body blockquote {
  margin: 0.8em 0;
  padding: 0.2em 1em;
  border-left: 3px solid rgba(191, 58, 45, 0.5);
  color: var(--muted);
}

.markdown-body a { color: #c0392b; text-decoration: underline; }

.preview-edit-meta {
  font-size: 12px;
  color: var(--muted);
  margin-right: auto;
  align-self: center;
}

.preview-edit-meta[data-dirty="true"] { color: #c0392b; }

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
