.spektr-file-row {
  cursor: pointer;
}

.spektr-overlay {
  position: fixed;
  inset: 0;
  z-index: 80000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(8px);
}

.spektr-card {
  width: min(420px, 100%);
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.spektr-viewer {
  width: min(1100px, 100%);
  height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
}

.spektr-overlay-full {
  padding: 0;
  background: rgba(2, 6, 23, 0.92);
}

.spektr-overlay-full .spektr-viewer {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.spektr-overlay-full .spektr-viewer-body img {
  max-height: calc(100vh - 88px);
}

.spektr-card-head,
.spektr-viewer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid hsl(var(--border));
}

.spektr-card-head h2,
.spektr-viewer-head h2 {
  margin: 0;
  font-family: var(--font-display), Inter, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.spektr-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.spektr-grow {
  min-width: 0;
  flex: 1;
}

.spektr-icon-btn,
.spektr-action {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.spektr-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: hsl(var(--muted-foreground));
}

.spektr-icon-btn:hover,
.spektr-action:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.spektr-actions {
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.spektr-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}

.spektr-action svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.spektr-share-box {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spektr-share-box input {
  width: 100%;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

[data-testid^="menu-share-"] {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
}

[data-testid^="menu-share-"] svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.spektr-action-danger {
  color: hsl(var(--destructive));
}

.spektr-action-danger:hover {
  background: hsl(var(--destructive) / 0.12);
  color: hsl(var(--destructive));
}

.spektr-viewer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: hsl(var(--background));
}

.spektr-viewer-body iframe,
.spektr-viewer-body img,
.spektr-viewer-body video,
.spektr-viewer-body audio {
  display: block;
}

.spektr-viewer-body iframe,
.spektr-viewer-body video {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b1220;
}

.spektr-viewer-body img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(86vh - 110px);
  margin: auto;
  object-fit: contain;
}

.spektr-img-wrap {
  min-height: 280px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.spektr-text,
.spektr-md,
.spektr-office {
  padding: 24px 28px;
  max-width: 920px;
  margin: 0 auto;
  line-height: 1.65;
  color: hsl(var(--foreground));
}

.spektr-office * {
  color: inherit !important;
  background-color: transparent !important;
}

.spektr-text {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.spektr-md h1,
.spektr-md h2,
.spektr-md h3 {
  font-family: var(--font-display), Inter, sans-serif;
  margin: 1.2em 0 0.5em;
}

.spektr-md pre,
.spektr-office table,
.spektr-csv {
  overflow: auto;
}

.spektr-md pre,
.spektr-md code {
  font-family: var(--font-mono), ui-monospace, monospace;
  background: hsl(var(--muted));
  border-radius: 8px;
}

.spektr-md pre {
  padding: 12px 14px;
}

.spektr-md code {
  padding: 1px 5px;
}

.spektr-office table,
.spektr-csv {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.spektr-office th,
.spektr-office td,
.spektr-csv th,
.spektr-csv td {
  border: 1px solid hsl(var(--border));
  padding: 8px 10px;
  text-align: left;
}

.spektr-office th,
.spektr-csv th {
  background: hsl(var(--muted));
  font-weight: 600;
}

.spektr-empty,
.spektr-loading {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 40px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.spektr-rename {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spektr-rename input {
  width: 100%;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.spektr-rename-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.spektr-btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.spektr-btn-ghost {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.spektr-btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.spektr-audio-wrap {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 40px;
}

.spektr-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 24px;
  min-height: 100%;
  background: #0f172a;
}

.spektr-pdf canvas {
  width: 100%;
  max-width: 920px;
  height: auto;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.spektr-pdf-object {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 70vh;
  border: 0;
}

.spektr-zoom-bar {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  margin-left: auto;
  padding: 2px;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  background: hsl(var(--muted) / 0.45);
}

.spektr-zoom-bar .spektr-icon-btn {
  width: 32px;
  height: 32px;
}

.spektr-zoom-label {
  min-width: 52px;
  height: 32px;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.spektr-zoom-label:hover {
  color: hsl(var(--foreground));
}

.spektr-zoom-body {
  overflow: hidden;
}

.spektr-zoom-host {
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.spektr-zoom-host.is-panning {
  cursor: grab;
}

.spektr-zoom-host.is-panning.is-zoomed,
.spektr-zoom-host.is-zoomed.is-panning {
  cursor: grabbing;
}

.spektr-zoom-host.is-zoomed {
  cursor: grab;
}

.spektr-zoom-stage {
  transform-origin: 0 0;
}

.spektr-zoom-host .spektr-img-wrap {
  height: auto;
  min-height: min(60vh, 520px);
}

.spektr-zoom-stage img {
  max-height: none;
}

@media (max-width: 1023px) {
  .spektr-viewer-head {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .spektr-viewer-body iframe,
  .spektr-pdf-object {
    min-height: calc(100dvh - 88px);
  }
}
