:root {
  color-scheme: dark;
  --bg: #182333;
  --bg-deep: #111927;
  --bg-soft: #202c3d;
  --panel: #1c2838;
  --panel-2: #172231;
  --line: #334156;
  --line-soft: rgba(208, 218, 230, 0.13);
  --text: #f4f8ff;
  --muted: #9fb1c5;
  --blue: #4f8cff;
  --blue-2: #2f6df4;
  --green: #22c968;
  --red: #f45d6c;
  --amber: #f3bd4f;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #162131;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

.menu-button {
  display: inline-grid;
  place-items: center;
  gap: 3px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 5px;
  background: var(--blue-2);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: white;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #dce8f7;
  font-size: 14px;
  font-weight: 800;
}

.brand-cube {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ffd44d, #ffab2e);
}

.brand-cube::after {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 11px;
  height: 11px;
  border: 2px solid #162131;
  border-radius: 3px;
  background: var(--blue);
  content: "";
}

.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #dce8f7;
  font-size: 14px;
  font-weight: 800;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
}

.status-pill {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  margin-left: auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #273449;
  color: #dbe7f5;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.header-actions button,
.more-button,
.tool-button {
  position: relative;
  width: 34px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #273449;
  color: var(--text);
  cursor: pointer;
}

.header-actions button:first-child::before,
.search-tool::before {
  position: absolute;
  inset: 8px 10px 10px 8px;
  border: 2px solid #dbe7f5;
  border-radius: 50%;
  content: "";
}

.header-actions button:first-child::after,
.search-tool::after {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #dbe7f5;
  transform: rotate(45deg);
  content: "";
}

.header-actions button:last-child::before,
.reload-tool::before {
  position: absolute;
  inset: 8px;
  border: 2px solid #dbe7f5;
  border-left-color: transparent;
  border-radius: 50%;
  content: "";
}

.page-shell {
  width: min(100%, 1120px);
  min-height: calc(100vh - 58px);
  margin: 0 auto;
  padding: 0 14px 32px;
}

.file-share-shell {
  background: #1b2636;
}

.promo-strip {
  display: grid;
  place-items: center;
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  color: #d8e4f4;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.folder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 26px 8px 18px;
}

.folder-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.big-folder {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 35px;
  border-radius: 5px;
  background: linear-gradient(180deg, #ffd954, #f5ad2c);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.08);
}

.big-folder::before {
  position: absolute;
  left: 4px;
  top: -9px;
  width: 22px;
  height: 12px;
  border-radius: 5px 5px 0 0;
  background: #ffd954;
  content: "";
}

.big-folder span {
  position: absolute;
  left: 2px;
  bottom: -8px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border: 2px solid #1b2636;
  border-radius: 50%;
  background: #78869b;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

h1 {
  margin: 0;
  overflow-wrap: anywhere;
  color: white;
  font-size: 20px;
  line-height: 1.2;
}

.folder-bar p {
  margin: 5px 0 0;
  color: #bed0e3;
  font-size: 13px;
}

.dot-separator {
  margin: 0 5px;
  color: #75889d;
}

.x-link {
  color: #78b6ff;
  font-weight: 700;
  text-decoration: none;
}

.more-button::before,
.more-button::after {
  position: absolute;
  left: 15px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #dbe7f5;
  box-shadow: 0 7px 0 #dbe7f5;
  content: "";
}

.more-button::before {
  top: 7px;
}

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

.owner-card,
.notice-bar,
.footer-note,
.stats-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 25, 39, 0.42);
}

.owner-photo {
  display: none;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: cover;
  background: #0d141f;
}

.owner-label,
.notice-badge,
.file-meta,
.file-description,
.stats-line,
.modal-kicker {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.owner-label {
  margin: 0 0 4px;
  color: #74a7e7;
  font-size: 11px;
  text-transform: uppercase;
}

.owner-card p,
.notice-bar p,
.footer-note p {
  margin: 0;
  color: #c9d7e8;
  font-size: 13px;
  line-height: 1.6;
}

.notice-badge {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 4px 7px;
  border: 1px solid rgba(243, 189, 79, 0.45);
  border-radius: 4px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.file-panel {
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.suspended-panel {
  display: grid;
  gap: 8px;
  padding: 20px 16px;
  border: 1px solid rgba(244, 93, 108, 0.42);
  border-radius: 6px;
  background: rgba(53, 18, 27, 0.34);
}

.suspended-lock {
  position: relative;
  width: 36px;
  height: 29px;
  border: 2px solid var(--red);
  border-radius: 5px;
}

.suspended-lock::before {
  position: absolute;
  left: 7px;
  top: -15px;
  width: 18px;
  height: 15px;
  border: 2px solid var(--red);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  content: "";
}

.suspended-panel h2 {
  margin: 0;
  font-size: 20px;
}

.suspended-panel p {
  margin: 0;
  color: #d8e4f4;
  font-size: 13px;
  line-height: 1.65;
}

.file-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.select-all {
  display: grid;
  place-items: center;
  width: 36px;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.toolbar-spacer {
  flex: 1;
}

.open-tool {
  background: var(--green);
  border-color: var(--green);
}

.open-tool::before {
  position: absolute;
  left: 9px;
  top: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-left: 0;
  border-bottom: 0;
  content: "";
}

.open-tool::after {
  position: absolute;
  left: 8px;
  top: 13px;
  width: 15px;
  height: 2px;
  background: white;
  content: "";
}

.sort-tool::before {
  position: absolute;
  left: 9px;
  top: 6px;
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
  border-bottom: 7px solid #dbe7f5;
  content: "";
}

.sort-tool::after {
  position: absolute;
  left: 9px;
  bottom: 6px;
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
  border-top: 7px solid #dbe7f5;
  content: "";
}

.filter-tool::before {
  position: absolute;
  left: 8px;
  top: 7px;
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
  border-top: 11px solid #dbe7f5;
  content: "";
}

.filter-tool::after {
  position: absolute;
  left: 14px;
  top: 16px;
  width: 4px;
  height: 7px;
  background: #dbe7f5;
  content: "";
}

.file-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 8px 12px 0;
  border-bottom: 1px solid var(--line);
}

.file-check {
  display: grid;
  place-items: start center;
  padding-top: 87px;
}

.file-content {
  min-width: 0;
}

.file-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.file-type {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 32px;
  border-radius: 4px;
  background: #3385ff;
}

.file-type::before {
  position: absolute;
  right: 0;
  top: 0;
  border-top: 10px solid rgba(255, 255, 255, 0.65);
  border-left: 10px solid transparent;
  content: "";
}

.file-type::after {
  position: absolute;
  left: 7px;
  bottom: 7px;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: #cfe5ff;
  box-shadow: 0 -6px 0 rgba(207, 229, 255, 0.7);
  content: "";
}

.file-type.video {
  background: #4f8cff;
}

.file-type.video::after {
  left: 9px;
  bottom: 8px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #ffffff;
  background: transparent;
  box-shadow: none;
}

.file-title {
  min-width: 0;
}

.file-title strong {
  display: block;
  color: white;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.file-meta {
  display: block;
  margin-top: 5px;
  color: #aebdd0;
  font-size: 12px;
  line-height: 1.45;
}

.file-description {
  margin: 7px 0 0;
  color: #d0d9e6;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.file-preview-link {
  display: block;
  width: min(100%, 300px);
  margin: 10px 0 0;
  color: inherit;
  text-decoration: none;
}

.file-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.35);
  background: #05080c;
}

.file-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-preview {
  color: #8092a8;
  font-size: 12px;
}

.file-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.file-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 1px solid #516179;
  border-radius: 5px;
  background: #1b2637;
  color: white;
  text-decoration: none;
}

.play-action::before {
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid white;
  content: "";
}

.download-action::before {
  width: 12px;
  height: 11px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
  content: "";
}

.menu-action::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 7px 0 white, 0 -7px 0 white;
  content: "";
}

.stats-line {
  justify-content: flex-end;
  color: #aebdd0;
  font-size: 12px;
}

.stats-line strong {
  color: white;
}

.footer-note p {
  color: #aebdd0;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 10, 15, 0.82);
  backdrop-filter: blur(10px);
}

.modal-backdrop.is-visible {
  display: flex;
}

.age-modal {
  width: min(100%, 390px);
  padding: 22px;
  border: 1px solid #42536a;
  border-radius: 7px;
  background: #172231;
  box-shadow: var(--shadow);
}

.modal-lock {
  position: relative;
  width: 42px;
  height: 34px;
  margin-bottom: 15px;
  border: 2px solid var(--blue);
  border-radius: 5px;
}

.modal-lock::before {
  position: absolute;
  left: 8px;
  top: -18px;
  width: 22px;
  height: 18px;
  border: 2px solid var(--blue);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  content: "";
}

.modal-kicker {
  margin: 0 0 4px;
  color: #7eb4ff;
  font-size: 11px;
  text-transform: uppercase;
}

.age-modal h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
}

.modal-text {
  margin: 0;
  color: #c9d7e8;
  font-size: 14px;
  line-height: 1.65;
}

.modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 0;
  background: var(--blue);
  color: white;
}

.ghost-button {
  border: 1px solid #516179;
  background: transparent;
  color: #dbe7f5;
}

body.modal-open {
  overflow: hidden;
}

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

.file-row.no-checkbox {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 8px;
}

.display-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.preset-button {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(79, 140, 255, 0.08);
  color: #dbe7f5;
  text-align: left;
  cursor: pointer;
}

.preset-button:hover,
.preset-button:focus-visible {
  border-color: rgba(120, 182, 255, 0.75);
  outline: 0;
  background: rgba(79, 140, 255, 0.14);
}

.preset-button strong {
  color: white;
  font-size: 14px;
}

.preset-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.preset-button small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.preset-button em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(120, 182, 255, 0.28);
  border-radius: 999px;
  color: #cfe0f5;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

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

.analytics-summary div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(14, 22, 33, 0.45);
}

.analytics-summary span,
.analytics-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.analytics-summary strong {
  display: block;
  margin: 3px 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.analytics-list {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(10, 16, 25, 0.34);
}

.analytics-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-row span {
  color: var(--muted);
  font-size: 11px;
}

.analytics-row b {
  color: #58e590;
  font-size: 13px;
}

.policy-warnings {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.policy-block,
.policy-caution {
  padding: 11px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.policy-block {
  border: 1px solid rgba(244, 93, 108, 0.48);
  background: rgba(244, 93, 108, 0.1);
}

.policy-caution {
  border: 1px solid rgba(243, 189, 79, 0.42);
  background: rgba(243, 189, 79, 0.09);
}

.policy-block b {
  color: #ff9ca6;
}

.policy-caution b {
  color: #ffd37b;
}

.policy-warnings ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.policy-warnings li + li {
  margin-top: 4px;
}

.preview-suspended {
  padding: 14px;
  border: 1px solid rgba(244, 93, 108, 0.38);
  border-radius: 6px;
  background: rgba(53, 18, 27, 0.28);
  color: #ffdce0;
  font-size: 13px;
  line-height: 1.6;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: #dbe7f5;
  font-size: 12px;
  cursor: pointer;
}

/* Editor */
.editor-shell {
  width: min(100%, 960px);
  background: transparent;
}

.editor-layout {
  display: grid;
  gap: 14px;
}

.editor-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 25, 39, 0.74);
}

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

.field-grid,
.link-editor {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111927;
  color: var(--text);
  font: inherit;
  padding: 10px;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.editor-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.editor-actions button,
.small-button {
  min-height: 42px;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.small-button {
  border: 1px solid #516179;
  background: transparent;
  color: #dbe7f5;
}

.link-editor {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.image-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.editor-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.profile-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 25, 39, 0.74);
}

.folder-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-photo-wrap {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 5px;
  background: #111927;
}

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

.folder-label {
  margin: 0 0 5px;
  color: #7eb4ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.profile-meta p {
  margin: 10px 0 0;
  color: #c9d7e8;
  font-size: 13px;
  line-height: 1.6;
}

@media (min-width: 760px) {
  .page-shell {
    padding-inline: 24px;
  }

  .file-row {
    grid-template-columns: 42px minmax(0, 1fr);
    padding-right: 10px;
  }

  .file-head {
    max-width: 720px;
  }

  .file-preview-link {
    margin-left: 38px;
  }

  .file-actions {
    margin-right: 0;
  }
}

@media (min-width: 900px) {
  .editor-layout {
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: start;
  }
}

@media (max-width: 520px) {
  .app-header {
    min-height: 54px;
  }

  .page-shell {
    padding-inline: 10px;
  }

  .promo-strip {
    min-height: 58px;
    font-size: 12px;
  }

  .folder-bar {
    padding-top: 20px;
  }

  .owner-card {
    display: none;
  }

  .file-preview-link {
    width: min(100%, 260px);
  }
}
