@font-face {
  font-family: 'DynaPuff';
  src: url('fonts/DynaPuff.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Comfortaa";
  src: url("fonts/Comfortaa.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --doc-surround: #1a1a1a;
  --doc-page: #0f0f0f;
  scrollbar-color: #3a3a3a transparent;
  --bg: #080808;
  --panel: #1a1a1a;
  --row-alt: #212121;
  --panel-hover: #2a2a2a;
  --panel-active: #333333;
  --text: #e0e0e0;
  --muted: #a0a0a0;
  --white: #ffffff;
  --accent: #6e75df;
  --accent-ink: #0a1424;
  --danger: #ff7b7b;
  --ok: #7bdc9a;
  --warn: #ffc56e;
}

body.auth {
  --accent: #cea2fd;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Comfortaa", sans-serif;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: rgba(22, 22, 22, 0.6);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow:
  inset 0 0 5px rgba(0, 0, 0, 0.2),
  0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 0;
}

.topbar {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: transparent;
  height: 60px;
  position: relative;
  z-index: 2;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  transition: 0s;
}

.logo:hover {
  filter: brightness(85%);
}

.logo code {
  color: #8a91ff;
}

.logo img {
  height: 32px;
}

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 12px 20px;
  position: relative;
  z-index: 2;
  gap: 12px;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar > .storage {
  background-color: transparent;
  margin-top: 14px;
  margin-bottom: auto;
  position: relative;
}

.sidebar > .storage::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  border: 1px inset #5b55a4;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 27px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition:
  background-color 0.15s ease,
  color 0.15s ease;
}

.nav-links a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

.nav-links a:hover {
  background-color: var(--panel-hover);
  color: var(--white);
}

.nav-links a.active {
  background-color: var(--panel);
  color: var(--white);
}

.nav-links a:focus-visible,
.profile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-end {
  display: flex;
  align-items: flex-end;
}

.sidebar-end .profile {
  width: 100%;
}

.card {
  background-color: #131313;
  color: var(--white);
  border-radius: 20px;
  padding: 14px;
  font-size: 13px;
}

.storage-label {
  display: block;
  margin-bottom: 8px;
}

.storage-bar,
.meter {
  height: 6px;
  border-radius: 3px;
  background-color: var(--panel-active);
  overflow: hidden;
}

.storage-bar > div,
.meter > div {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.storage-bar.full > div,
.meter.full > div {
  background-color: var(--danger);
}

.storage-text {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  transition: background-color 0.15s ease;
  min-width: 0;
}

.profile:hover {
  background-color: var(--panel-hover);
}

.profile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
  font-weight: 900;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--panel-active);
  color: var(--white);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;

}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar.small {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.owner-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.content {
  flex-grow: 1;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-top-left-radius: 20px;
  border-top-right-radius: 1px;
  overflow-y: auto;
  position: relative;
  z-index: 3;
  padding: 24px 28px;
  min-width: 0;
}

.content.centered {
  align-items: center;
  justify-content: center;
}

.content h1 {
  margin: 0 0 18px;
  font-size: 1.3em;
  color: var(--white);
}

.file-list-wrap {
  overflow-x: auto;
  border-radius: 14px;
}

.file-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.file-list th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--panel-active);
}

.file-list td {
  padding: 12px 16px;
  color: var(--text);
}

.file-list tbody tr:nth-child(odd) {
  background-color: var(--panel);
}

.file-list tbody tr:nth-child(even) {
  background-color: var(--row-alt);
}

.file-list tbody tr:hover {
  background-color: var(--panel-hover);
}

.file-list .col-name {
  width: 100%;
  max-width: 0;
}

.file-list td.col-size,
.file-list td.col-created,
.file-list td.col-owner,
.file-list td.muted {
  color: var(--muted);
}

.file-list td:first-child {
  border-radius: 12px 0 0 12px;
}

.file-list td:last-child {
  border-radius: 0 12px 12px 0;
}

.file-list .col-actions {
  width: 1%;
  padding: 4px 8px;
  text-align: right;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  min-width: 0;
}

.file-name span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-name:hover span {
  text-decoration: underline;
}

.file-name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.file-name svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

.file-name.folder svg {
  color: var(--accent);
}

.file-name.file svg {
  color: var(--muted);
}

.file-name svg.shared-mark {
  width: 14px;
  height: 14px;
  color: var(--accent);
}


.file-list .col-check {
  width: 1%;
  padding: 0 0 0 14px;
}

.file-list .col-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
  accent-color: var(--accent);
  cursor: pointer;
}


.file-list.selectable td.col-check input {
  opacity: 0;
  transition: opacity 0.1s ease;
}

.file-list.selectable tr:hover td.col-check input,
.file-list.selectable tr.selected td.col-check input,
.file-list.selectable:has(tr.selected) td.col-check input {
  opacity: 1;
}

.file-list tbody tr.selected,
.file-list tbody tr.selected:hover {
  background-color: color-mix(in srgb, var(--accent) 16%, var(--panel));
}

.file-list.selectable tbody tr {
  cursor: default;
}

.selection-bar {
  align-items: center;
}

.sel-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin-right: 4px;
}

@media (hover: none) {
  .file-list.selectable td.col-check input {
    opacity: 1;
  }
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 1.3em;
  font-weight: 600;
  color: var(--white);
  flex: 1;
  min-width: 0;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 8px;
}

.crumbs a:hover {
  color: var(--white);
  background: var(--panel-hover);
}

.crumbs .sep {
  color: #555;
}

.crumbs .here {
  padding: 2px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  background-color: var(--panel-active);
  color: var(--white);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
  background-color 0.15s ease,
  filter 0.15s ease,
  transform 0.1s ease;
}

.btn:hover {
  background-color: #3d3d3d;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

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

.btn.primary:hover {
  filter: brightness(1.1);
}

.btn.danger {
  background-color: rgba(255, 123, 123, 0.15);
  color: var(--danger);
}

.btn.danger:hover {
  background-color: rgba(255, 123, 123, 0.25);
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--panel-active);
  color: var(--white);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.badge.ok {   }
.badge.bad { background: rgba(255, 123, 123, 0.14); color: var(--danger); }
.badge.warn { background: rgba(255, 197, 110, 0.14); color: var(--warn); }
.badge.accent { background: rgba(110, 168, 255, 0.14); color: var(--accent); }

.field label {
  display: block;
  margin: 0 0 6px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select,
.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 15px;
  background-color: var(--bg);
  color: var(--white);
  font: inherit;
  font-size: 14px;
  transition:
  border-color 0.15s ease,
  box-shadow 0.15s ease;
}

.input.small {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.field input::placeholder,
.input::placeholder {
  color: #6a6a6a;
}

.field input:focus,
.field select:focus,
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.field .hint {
  margin: 6px 4px 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row > .field {
  flex: 1 1 160px;
}

.error {
  margin: 0;
  min-height: 1em;
  font-size: 12px;
  color: var(--danger);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 64px;
}

.toggle-pw {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.toggle-pw:hover {
  background-color: var(--panel-hover);
  color: var(--white);
}

.login {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-avatar {
  height: 120px;
  border-radius: 20%;
}

.login h1 {
  margin: 0 0 6px;
  font-size: 1.5em;
  color: var(--white);
}

.login-sub {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.submit {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background-color: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
  filter 0.15s ease,
  transform 0.1s ease;
}

.submit:hover {
  filter: brightness(1.1);
}


a.submit {
  display: block;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}

.login > .error {
  margin-bottom: 12px;
}

.submit:active {
  transform: scale(0.98);
}

.submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.submit:focus-visible,
.toggle-pw:focus-visible,
.link-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.recovery-code {
  display: block;
  margin: 8px 0 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg);
  color: var(--white);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-align: center;
  user-select: all;
  word-break: break-all;
}

.notice {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 197, 110, 0.1);
  color: var(--warn);
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

.check input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.menu {
  position: fixed;
  z-index: 50;
  min-width: 180px;
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: #242424;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  border: none;
}

.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.menu button:hover,
.menu button:focus-visible {
  outline: none;
  background: var(--panel-active);
  color: var(--white);
}

.menu button.danger {
  color: var(--danger);
}

.menu svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.menu hr {
  border: 0;
  border-top: 1px solid #333;
  margin: 4px 6px;
}

dialog.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: none;
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body h2 {
  margin: 0;
  font-size: 1.1em;
  color: var(--white);
  overflow-wrap: anywhere;
}

.modal-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

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

.mode-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mode-picker label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.mode-picker label strong {
  color: var(--white);
  font-size: 13px;
}

.mode-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-picker label:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

.mode-picker label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  color: var(--white);
  font: inherit;
  font-size: 12px;
}

.share-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--row-alt);
  font-size: 12px;
}

.share-item .share-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 12px;
  background: #2b2b2b;
  color: var(--white);
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 32px);
}

.toast.bad {
  background: #4a2020;
}

.drop-hint {
  position: absolute;
  inset: 12px;
  z-index: 5;
  display: none;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, rgba(26, 26, 26, 0.92));
  color: var(--white);
  font-weight: 600;
  pointer-events: none;
}

.content.dragging .drop-hint {
  display: grid;
}

.uploads {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(360px, calc(100vw - 32px));
  max-height: 50vh;
  overflow-y: auto;
  padding: 12px;
  border-radius: 18px;
  background: #242424;
  border: 1px solid #2f2f2f;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uploads[hidden] {
  display: none;
}

.uploads-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}

.upload-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.upload-item .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.upload-item .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--white);
}

.upload-item.done .meter > div { background: var(--ok); }
.upload-item.failed .meter > div { background: var(--danger); }
.upload-item.waiting .meter > div { background: var(--warn); }
.upload-item.waiting .muted { color: var(--warn); }
.upload-item.failed .muted { color: var(--danger); }
.upload-item a { color: inherit; text-decoration: underline; }

.upload-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.panels {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  align-items: start;
}

.panel {
  padding: 18px;
  border-radius: 18px;
  background: var(--row-alt);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
}

.panel h2 {
  margin: 0;
  font-size: 14px;
  color: var(--white);
}

.panel p {
  margin: 0;
  line-height: 1.6;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
}

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

.kv dd {
  margin: 0;
  color: var(--white);
  overflow-wrap: anywhere;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 14px;
  border-radius: 16px;
  background: var(--row-alt);
}

.stat .num {
  display: block;
  font-size: 1.5em;
  font-weight: 600;
  color: var(--white);
}

.stat .lbl {
  font-size: 11px;
  color: var(--muted);
}

.stat.bad .num { color: var(--danger); }

.stat .meter { margin-top: 10px; }

.activity { margin-bottom: 18px; }

.activity-verdict {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--row-alt);
  line-height: 1.5;
}

.activity-verdict svg {
  flex: none;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.activity-verdict.ok svg, .activity-verdict.ok strong { color: var(--ok); }
.activity-verdict.wait svg, .activity-verdict.wait strong { color: var(--warn); }

.activity .file-list-wrap { margin-top: 12px; }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filters .input {
  width: auto;
  flex: 1 1 140px;
}

.quota-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.quota-cell .input {
  width: 90px;
}

.usage {
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.wrap-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 160px;
}

.viewer-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.viewer-head .titles {
  flex: 1;
  min-width: 0;
}

.viewer-head h1 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.viewer-head .sub {
  font-size: 12px;
  color: var(--muted);
}

.shared-by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  vertical-align: middle;
}

.shared-by strong {
  color: var(--text);
  font-weight: 600;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.media-note {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--warn);
  font-size: 13px;
  white-space: nowrap;
}

.media-note[hidden] {
  display: none;
}

.stage img,
.stage video {
  max-width: 100%;
  max-height: calc(100dvh - 220px);
  border-radius: 14px;
  background: #000;
}

.stage audio {
  width: min(100%, 560px);
  margin-top: 40px;
}

.stage iframe {
  width: 100%;
  height: calc(100dvh - 220px);
  min-height: 360px;
  border: 0;
  border-radius: 14px;
  background: #fff;
}

.stage pre {
  width: 100%;
  margin: 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.markdown {
  width: 100%;
  max-width: 820px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.markdown h1,
.markdown h2,
.markdown h3 { color: var(--white); line-height: 1.3; }
.markdown a { color: var(--accent); }
.markdown img { max-width: 100%; }
.markdown code { padding: 2px 5px; border-radius: 6px; background: var(--bg); font-size: 0.9em; }
.markdown pre { padding: 14px; border-radius: 12px; background: var(--bg); overflow: auto; }
.markdown pre code { padding: 0; background: none; }
.markdown blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--panel-active); color: var(--muted); }
.markdown table { border-collapse: collapse; }
.markdown th, .markdown td { padding: 6px 10px; border: 1px solid var(--panel-active); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  align-content: start;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border-radius: 16px;
  background: var(--row-alt);
  color: var(--text);
  text-decoration: none;
}

.tile:hover {
  background: var(--panel-hover);
}

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile .thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}

.tile .thumb img,
.tile .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile .thumb > svg {
  width: 40px;
  height: 40px;
  fill: var(--muted);
}

.tile.folder .thumb > svg {
  fill: var(--accent);
}

.tile .thumb > svg.play {
  position: absolute;
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  fill: var(--white);
}

.tile .thumb .ext {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.tile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--white);
}

.tile-sub {
  font-size: 11px;
  color: var(--muted);
}

.viewer-head .crumbs {
  margin: 0 0 6px -6px;
}

.center-card {
  width: 100%;
  max-width: 380px;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.center-card h1 {
  margin: 0;
}

.center-card .big-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  fill: var(--muted);
}

@media (max-width: 600px) {
  .sidebar {
    width: 56px;
    padding: 8px 6px 12px;
  }

  .nav-links a {
    justify-content: center;
    padding: 10px;
  }

  .nav-links a span,
  .storage-label,
  .storage-text,
  .profile span:not(.avatar) {
    display: none;
  }

  .card {
    padding: 8px;
    border-radius: 16px;
  }

  .profile {
    justify-content: center;
  }

  .content {
    margin: 6px 6px 6px 0;
    border-radius: 16px;
    padding: 18px 12px;
  }

  .file-list .col-created,
  .file-list .col-owner,
  .file-list .hide-sm {
    display: none;
  }

  .file-list th,
  .file-list td {
    padding: 10px 10px;
  }

  .toolbar .btn span {
    display: none;
  }

  .mode-picker {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.file-name.doc svg {
  color: #7aa2ff;
}

.muted-link {
  color: var(--muted);
  text-decoration: none;
}

.muted-link:hover {
  color: var(--white);
  text-decoration: underline;
}

.content.doc-mode {
  padding: 0;
}

.doc-shell {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 100%;
}

.doc-head,
.doc-toolbar,
.doc-foot {
  flex-shrink: 0;
}

.doc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 6px;
}

.doc-back svg,
.doc-more svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.doc-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-title {
  width: 100%;
  max-width: 640px;
  margin-left: -8px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 1.25em;
  font-weight: 600;
  text-overflow: ellipsis;
}

.doc-title:hover {
  border-color: #333;
}

.doc-title:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

.doc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.doc-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
}

.doc-location:hover {
  color: var(--white);
}

.doc-location svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.doc-status.saved {
  color: var(--muted);
}

.doc-status.retry,
.doc-status.offline {
  color: var(--warn);
}

.doc-status.error {
  color: var(--danger);
}

.doc-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background: var(--row-alt);
  box-shadow: 0 6px 14px -10px rgba(0, 0, 0, 0.8);
}

.doc-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.doc-tool svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.doc-tool:hover {
  background: var(--panel-hover);
}

.doc-tool.on {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--white);
}

.doc-tool:focus-visible,
.doc-style:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.doc-tool b,
.doc-tool i,
.doc-tool u,
.doc-tool s {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.doc-tool .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.doc-sep {
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: #3a3a3a;
}

.doc-style {
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-active);
  color: var(--white);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.doc-scroll {
  flex: 1;
  padding: 12px 12px 20px;
}

.doc-scroll.paged {
  margin-top: 8px;
  padding: 16px 12px 24px;
  background: var(--doc-surround);
}

.doc-page {
  max-width: 900px;
  min-height: 70vh;
  margin: 0 auto;
  border: 1px solid #262626;
  background: #141414;
}

.doc-page.paged {
  width: var(--page-w);
  max-width: none;
  min-height: 0;
  border: 0;
  background: none;
}

.doc-page.paged .doc-body {
  min-height: var(--page-h);
  padding: var(--page-margin);
  background: repeating-linear-gradient(to bottom,
                                        var(--doc-page) 0, var(--doc-page) var(--page-h),
                                        transparent var(--page-h), transparent calc(var(--page-h) + var(--page-gap)));
}

.doc-body img {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.doc-body > img,
.doc-body [data-resize-container] {
  margin: 0.6em 0;
  max-width: 100%;
}

.doc-body img.ProseMirror-selectednode,
.doc-body .ProseMirror-selectednode img,
.doc-body [data-resize-state="true"] img {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.doc-body [data-resize-handle] {
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 2px solid #111;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.doc-body [data-resize-handle="bottom-right"] {
  cursor: nwse-resize;
}

.doc-body [data-resize-handle="bottom-left"] {
  cursor: nesw-resize;
}

.doc-body [data-resize-container]:hover [data-resize-handle],
.doc-body .ProseMirror-selectednode [data-resize-handle],
.doc-body [data-resize-state="true"] [data-resize-handle] {
  opacity: 1;
}

.doc-body[contenteditable="false"] [data-resize-handle] {
  display: none;
}

.doc-page-gap {
  pointer-events: none;
  user-select: none;
}

.doc-body {
  min-height: 70vh;
  padding: 32px 44px;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  caret-color: var(--accent);
  overflow-wrap: break-word;
}

.doc-body:focus {
  outline: none;
}

.doc-body ::selection {
  background: rgba(110, 117, 223, 0.38);
}

.doc-body p {
  margin: 0 0 0.7em;
}

.doc-body h1,
.doc-body h2,
.doc-body h3 {
  color: var(--white);
  line-height: 1.25;
}

.doc-body h1 {
  margin: 1.1em 0 0.45em;
  font-size: 1.9em;
}

.doc-body h2 {
  margin: 1em 0 0.4em;
  font-size: 1.45em;
}

.doc-body h3 {
  margin: 0.9em 0 0.35em;
  font-size: 1.2em;
}

.doc-body > :first-child {
  margin-top: 0;
}

.doc-body a {
  color: var(--accent);
  text-decoration: underline;
}

.doc-body blockquote {
  margin: 1em 0;
  padding: 0.2em 0 0.2em 1em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.doc-body code {
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.doc-body pre {
  margin: 1em 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg);
  overflow-x: auto;
}

.doc-body pre code {
  padding: 0;
  background: none;
}

.doc-body hr {
  margin: 1.6em 0;
  border: 0;
  border-top: 1px solid #333;
}

.doc-body hr.ProseMirror-selectednode {
  border-top-color: var(--accent);
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 0.7em;
  padding-left: 1.6em;
}

.doc-body li p {
  margin: 0.15em 0;
}

.doc-body mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #5c4a12;
  color: #fff3c4;
}

.doc-body ul[data-type="taskList"] {
  padding-left: 0.2em;
  list-style: none;
}

.doc-body ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 0.55em;
}

.doc-body ul[data-type="taskList"] li > label {
  flex: 0 0 auto;
  margin-top: 0.25em;
  user-select: none;
}

.doc-body ul[data-type="taskList"] li > div {
  flex: 1 1 auto;
  min-width: 0;
}

.doc-body ul[data-type="taskList"] li[data-checked="true"] > div {
  color: var(--muted);
  text-decoration: line-through;
}

.doc-body input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.doc-body .tableWrapper {
  margin: 1em 0;
  overflow-x: auto;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.doc-body td,
.doc-body th {
  position: relative;
  min-width: 1em;
  padding: 6px 10px;
  border: 1px solid #333;
  vertical-align: top;
}

.doc-body th {
  background: var(--row-alt);
  font-weight: 600;
  text-align: left;
}

.doc-body td p,
.doc-body th p {
  margin: 0;
}

.doc-body .selectedCell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(110, 117, 223, 0.18);
  pointer-events: none;
}

.doc-body p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  color: #666;
  pointer-events: none;
}

.link-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #2a2a2a;
}

.link-section h3 {
  margin: 0;
  font-size: 0.95em;
  color: var(--white);
}

.link-section .help {
  margin: 0;
}

.link-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
}

.details-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 13px;
}

.details-list dt {
  color: var(--muted);
}

.details-list dd {
  margin: 0;
  color: var(--white);
  overflow-wrap: anywhere;
}

.doc-foot {
  padding: 0 20px 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.section-title {
  margin: 22px 0 10px;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--muted);
}

.page-head + .section-title {
  margin-top: 0;
}

.doc-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.presence-person .avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.presence-more {
  font-size: 12px;
  color: var(--muted);
}

.doc-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ok);
}

.doc-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.doc-status.reconnecting,
.doc-status.connecting {
  color: var(--warn);
}

.doc-status.viewing {
  color: var(--muted);
}

.share-people .share-add {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-people .share-add input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #333;
  border-radius: 10px;
  background: var(--bg);
  color: var(--white);
  font: inherit;
  font-size: 13px;
}

.share-people .share-add input:focus {
  outline: none;
  border-color: var(--accent);
}

.share-people .help {
  margin: 0;
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.people-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 13px;
}

.people-list li:hover {
  background: var(--panel-hover);
}

.people-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--white);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.collaboration-carets__caret {
  position: relative;
  margin-right: -1px;
  margin-left: -1px;
  border-right: 1px solid;
  border-left: 1px solid;
  word-break: normal;
  pointer-events: none;
}

.collaboration-carets__label {
  position: absolute;
  top: -1.45em;
  left: -1px;
  padding: 1px 5px;
  border-radius: 4px 4px 4px 0;
  color: #0d0d0d;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: normal;
  white-space: nowrap;
  user-select: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.content.sheet-mode {
  overflow: hidden;
}

.sheet-shell {
  height: 100%;
  min-height: 0;
}

.sheet-toolbar {
  position: static;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.sheet-toolbar .doc-tool,
.sheet-toolbar .doc-sep,
.sheet-toolbar .doc-style {
  flex-shrink: 0;
}

.sheet-toolbar .doc-tool-text {
  font-size: 12px;
  white-space: nowrap;
}

.sheet-size {
  width: 58px;
}

.sheet-colour-tool {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.sheet-menu-tool {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 10px;
}

.sheet-menu-tool svg {
  width: 16px;
  height: 16px;
}

.sheet-swatch {
  display: block;
  width: 16px;
  height: 3px;
  border: 1px solid #555;
}

.sheet-colour-tool svg {
  width: 16px;
  height: 16px;
}

.sheet-formula {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 6px 12px 0;
  border: 1px solid #2c2c2c;
  background: var(--doc-page);
  flex-shrink: 0;
}

.sheet-namebox {
  width: 96px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid #2c2c2c;
  background: transparent;
  color: var(--white);
  font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sheet-fx {
  padding: 0 10px;
  line-height: 30px;
  color: var(--muted);
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  border-right: 1px solid #2c2c2c;
  user-select: none;
}

.sheet-bar {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 18px;
  resize: none;
  overflow: auto;
  white-space: pre;
}

.sheet-namebox:focus,
.sheet-bar:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sheet-find {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 12px 0;
  padding: 4px 8px;
  background: var(--row-alt);
  flex-shrink: 0;
}

.sheet-find > svg {
  width: 16px;
  height: 16px;
  fill: var(--muted);
}

.sheet-find input {
  flex: 1;
  max-width: 320px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #333;
  background: var(--bg);
  color: var(--white);
  font: inherit;
  font-size: 13px;
}

.sheet-find-count {
  font-size: 12px;
  min-width: 70px;
}

.sheet-grid {
  position: relative;
  flex: 1;
  min-height: 160px;
  margin: 6px 12px 0;
  border: 1px solid #2c2c2c;
  overflow: hidden;
  background: var(--doc-page);
}

.sheet-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.sheet-space {
  position: relative;
}

.sheet-canvas {
  position: sticky;
  top: 0;
  left: 0;
  display: block;
  touch-action: pan-x pan-y;
  outline: none;
}

.sheet-addrows {
  position: absolute;
  z-index: 2;
}

.sheet-input {
  position: absolute;
  z-index: 4;
  margin: 0;
  padding: 2px 5px;
  border: 2px solid var(--accent);
  border-radius: 0;
  background: var(--doc-page);
  color: var(--text);
  resize: none;
  overflow: hidden;
  white-space: pre;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  caret-color: transparent;
}

.sheet-grid.editing .sheet-input {
  opacity: 1;
  pointer-events: auto;
  caret-color: auto;
}

.sheet-grid.editing .sheet-input.away {
  opacity: 0;
  pointer-events: none;
}

.sheet-input:focus {
  outline: none;
}

.sheet-suggest,
.sheet-hint {
  position: absolute;
  z-index: 6;
  max-width: min(420px, 100%);
  padding: 4px;
  background: #242424;
  border: 1px solid #333;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  font-size: 12px;
}

.sheet-suggest-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-suggest-item.on,
.sheet-suggest-item:hover {
  background: var(--panel-active);
}

.sheet-suggest code,
.sheet-hint code {
  color: var(--white);
  font-size: 12px;
}

.sheet-hint {
  padding: 8px 10px;
}

.sheet-hint b {
  color: var(--accent);
}

.sheet-hint .muted {
  margin-top: 4px;
}

.sheet-link {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  padding: 6px 10px;
  background: #242424;
  border: 1px solid #333;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 12px;
}

.sheet-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: var(--muted);
}

.sheet-link a {
  color: #8fb4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 12px 4px;
  flex-shrink: 0;
}

.sheet-foot .icon-btn svg {
  width: 18px;
  height: 18px;
}

.sheet-tabs {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: 220px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-top: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sheet-tab span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-tab:hover {
  background: var(--panel-hover);
  color: var(--white);
}

.sheet-tab.on {
  border-top-color: var(--accent);
  background: var(--doc-page);
  color: var(--white);
}

.sheet-tab-more {
  font-size: 10px;
  opacity: 0.6;
  padding: 4px 0 4px 2px;
}

.sheet-tab-more:hover {
  opacity: 1;
}

.sheet-summary {
  margin-left: auto;
  padding-left: 12px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-summary.bad {
  color: var(--danger);
}

.sheet-pop {
  padding: 10px;
}

.sheet-palette {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-reset {
  width: 100%;
}

.sheet-swatches {
  display: grid;
  grid-template-columns: repeat(10, 22px);
  gap: 4px;
}

.sheet-chip {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #444;
  cursor: pointer;
}

.sheet-chip:hover,
.sheet-chip:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 1px;
}

.sheet-fnmodal input {
  width: 100%;
  height: 36px;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 1px solid #333;
  background: var(--bg);
  color: var(--white);
  font: inherit;
}

.sheet-fnlist {
  max-height: 50vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.sheet-fnlist button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.sheet-fnlist button:hover,
.sheet-fnlist button:focus-visible {
  background: var(--panel-active);
  outline: none;
}

.sheet-fnlist code {
  color: var(--white);
}

@media (max-width: 600px) {
  .sheet-formula,
  .sheet-grid,
  .sheet-find {
    margin-left: 8px;
    margin-right: 8px;
  }

  .sheet-namebox {
    width: 64px;
  }

  .sheet-summary {
    display: none;
  }
}

@media print {
  .collaboration-carets__caret {
    border: 0;
  }

  .collaboration-carets__label {
    display: none;
  }
}

@media (max-width: 600px) {
  .doc-head {
    padding: 12px 12px 8px;
  }

  .doc-toolbar {
    flex-wrap: nowrap;
    margin: 0 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .doc-scroll {
    padding: 12px 8px 16px;
  }

  .doc-body {
    padding: 20px 16px;
  }

  .doc-share span,
  .doc-presence {
    display: none;
  }
}

@media print {
  body,
  .layout,
  .content {
    background: #fff !important;
    color: #000 !important;
  }

  .topbar,
  .sidebar,
  .nav-background,
  .doc-head,
  .doc-toolbar,
  .doc-foot,
  .uploads,
  .toasts {
    display: none !important;
  }

  body {
    height: auto;
  }

  .layout {
    display: block;
    overflow: visible;
  }

  .content {
    padding: 0 !important;
    overflow: visible;
    border-radius: 0;
  }

  .doc-scroll,
  .doc-scroll.paged {
    margin: 0;
    padding: 0;
    background: none;
  }

  .doc-page-gap {
    display: none;
  }

  .doc-page.paged .doc-body {
    min-height: 0 !important;
    background: none;
  }

  .doc-page {
    max-width: none;
    min-height: 0;
    border: 0;
    background: #fff;
  }

  .doc-body {
    min-height: 0;
    padding: 0;
    color: #000;
  }

  .doc-body h1,
  .doc-body h2,
  .doc-body h3,
  .doc-body a,
  .doc-body blockquote {
    color: #000;
  }

  .doc-body code,
  .doc-body pre {
    background: #f2f2f2;
  }

  .doc-body mark {
    background: #fff59d;
    color: #000;
  }

  .doc-body td,
  .doc-body th {
    border-color: #999;
  }

  .doc-body th {
    background: #eee;
  }
}

body {
  --player-h: 0px;
}

body.has-player:has(.player:not([hidden])) {
  --player-h: 78px;
}

.music-search {
  width: 200px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.music-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.music-tabs a {
  padding: 8px 14px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.music-tabs a:hover {
  background: var(--panel-hover);
  color: var(--white);
}

.music-tabs a.on {
  background: var(--panel-active);
  color: var(--white);
}

.music-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}

.music-bar select.input.small {
  width: auto;
}

.music-note {
  margin: 0 0 14px;
  font-size: 12px;
}

.music-setup {
  margin: 12vh auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.music-setup p {
  margin: 0;
}

.music-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: start;
  flex: 1;
}

.music-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.music-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100dvh - 60px - 48px - var(--player-h));
  padding: 10px;
  border-radius: 18px;
  background: var(--row-alt);
}

.music-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 0 8px;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}

.music-side-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
}

.music-side-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 13px;
  flex-shrink: 0;
}

.music-side-row:hover {
  background: var(--panel-hover);
}

.music-side-row.on {
  background: var(--panel-active);
}

.music-side-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.music-side > p {
  margin: 4px 8px 6px;
  font-size: 12px;
  line-height: 1.5;
}

.music-tabs a.narrow-only {
  display: none;
}

.music-note.has-tip {
  align-self: flex-start;
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .music-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .music-side {
    display: none;
  }

  .music-tabs a.narrow-only {
    display: block;
  }
}

.art {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #2c2c35, #1d1d23);
  color: #5d5d6b;
}

.art svg {
  width: 45%;
  height: 45%;
  fill: currentColor;
}

.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.art.loaded img {
  opacity: 1;
}

.art.thumb {
  width: 40px;
  height: 40px;
}

.art.cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
}

.art.hero {
  width: 180px;
  height: 180px;
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.art.round,
.album-card.artist .art {
  border-radius: 50%;
}

.art.big {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.song-list .col-num {
  width: 1%;
  min-width: 44px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  position: relative;
}

.song-list .col-time {
  width: 1%;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.song-list th.col-time svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  vertical-align: middle;
}

.song-list .col-album {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-list td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.song-list tbody tr {
  cursor: pointer;
  user-select: none;
}

.song-list .row-play,
.song-list .eq {
  display: none;
}

.song-list .row-play {
  width: 16px;
  height: 16px;
  fill: var(--white);
  vertical-align: middle;
}

.song-list tbody tr:hover .num {
  display: none;
}

.song-list tbody tr:hover .row-play {
  display: inline-block;
}

.song-list tr.now .song-title {
  color: var(--accent);
}

.song-list tr.now .num,
.song-list tr.now:hover .row-play {
  display: none;
}

.song-list tr.now .eq {
  display: inline-flex;
}

.eq {
  gap: 2px;
  align-items: flex-end;
  height: 14px;
}

.eq i {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: var(--accent);
  transform: scaleY(0.4);
  transform-origin: bottom;
}


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

.song-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.song-title {
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-title .badge {
  margin-left: 8px;
}

.dl-mark:empty {
  display: none;
}

.dl-mark {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  vertical-align: middle;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.dl-mark svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.dl-mark.done {
  color: var(--ok);
}

.dl-btn.done svg {
  fill: var(--ok);
}

.offline-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 6px 6px 6px 14px;
  border-radius: 12px;
  background: rgba(255, 197, 110, 0.14);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}

body.offline #nav a:not([data-section="music"]),
body.offline .profile {
  opacity: 0.4;
}

body.offline .player-party {
  display: none;
}

@media (max-width: 600px) {
  .offline-banner {
    font-size: 12px;
    gap: 8px;
    padding-left: 10px;
  }
}

.song-artist {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-sentinel {
  height: 1px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px 16px;
  margin-bottom: 20px;
}

.album-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  text-decoration: none;
  min-width: 0;
  transition: background-color 0.15s ease;
}

.album-card:hover {
  background: var(--panel-hover);
}

.album-card:focus-visible,
.music-tabs a:focus-visible,
.player-now:focus-visible,
.queue-row:focus-visible,
.np-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.album-name {
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-artist {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-card.artist {
  text-align: center;
}

.music-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-bottom: 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.music-back:hover {
  color: var(--white);
}

.music-back svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.music-hero {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.music-hero-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 240px;
  font-size: 13px;
}

.music-hero-text h2 {
  margin: 0;
  color: var(--white);
  font-size: 1.9em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.music-hero-text p {
  margin: 0;
}

.music-hero-text .toolbar {
  margin-top: 10px;
  align-items: center;
}

.playlist-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}

.playlist-pick .btn {
  justify-content: flex-start;
}

.lyrics-modal {
  width: min(560px, 86vw);
}

.lyrics-edit {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--bg);
  color: var(--white);
  font: 13px/1.6 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

.lyrics-edit:focus {
  outline: none;
  border-color: var(--accent);
}

.player {
  position: relative;
  z-index: 36;
  flex-shrink: 0;
  height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: #131316;
  border-top: 2px solid #525ac9;
}

.player-now {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  justify-self: start;
  max-width: 100%;
}

.player-now:hover {
  background: var(--panel-hover);
}

.player-art .art.thumb {
  width: 48px;
  height: 48px;
}

.player-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.player-title {
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-artist {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player .icon-btn.player-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--white);
  color: #0c0c10;
}

.player .icon-btn.player-play:hover {
  background: var(--white);
  transform: scale(1.06);
}

.player .icon-btn.on {
  color: var(--accent);
}

.player-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 560px;
}

.player-time {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: center;
}

.player input[type="range"] {
  --fill: 0%;
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  height: 16px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.player input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) var(--fill), #3a3a42 var(--fill));
}

.player input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) var(--fill), #3a3a42 var(--fill));
}

.player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--white);
}

.player input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
}

.player input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.player-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.player-end .player-volume {
  flex: 0 1 96px;
}

.player .player-close {
  width: 36px;
  height: 36px;
  margin-left: 8px;
  font-size: 15px;
  background: var(--panel-active);
  color: var(--white);
}

.player .player-close:hover {
  background: rgba(255, 123, 123, 0.25);
  color: var(--danger);
}

body.has-player .uploads {
  bottom: calc(var(--player-h) + 20px);
}

body.has-player .toasts {
  margin-bottom: var(--player-h);
}

.np {
  --beat: 0;
  position: fixed;
  inset: 0 0 var(--player-h) 0;
  z-index: 35;
  background: #0b0b0f;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition:
  transform 0.3s cubic-bezier(0.4, 0, 1, 1),
  right 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.np.open {
  transform: none;
  transition:
  transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
  right 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.np.open .np-lyrics:not([hidden]),
.np.open .np-queue:not([hidden]) {
  animation: np-panel-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes np-panel-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.np-bg {
  position: absolute;
  inset: -80px;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(1.5) brightness(0.42);
  opacity: 0.9;
  pointer-events: none;
}

.np-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
}

.np-main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 5vw;
  padding: 56px 5vw 28px;
}

.np-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  text-align: center;
}

.np-frame {
  width: min(100%, 46vh);
  aspect-ratio: 1;
  border-radius: 22px;
  position: relative;
  flex-shrink: 1;
  min-height: 0;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.np-art {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  transform: scale(calc(1 + var(--art-beat, 0) * 0.018));
  will-change: transform;
}

.np-video {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: #000;
  object-fit: contain;
}

.np-stage.has-video .np-frame {
  box-shadow: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 60vh;
}

.np-stage.has-video .np-art {
  display: none;
}

.np-stage.has-video .np-video {
  display: block;
}

.np-title {
  margin: 14px 0 0;
  color: var(--white);
  font-size: 1.35em;
  overflow-wrap: anywhere;
  font-family: "DynaPuff";
}

.np-artist {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-family: "DynaPuff";
}

.np-artist a {
  color: inherit;
  text-decoration: none;
  font-family: "DynaPuff";
}

.np-artist a:hover {
  color: var(--white);
  text-decoration: underline;
}

.np-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.np-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 10px;
}

.np-tab {
  padding: 7px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.np-tab:hover {
  color: var(--white);
}

.np-tab.on {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.np-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.np-tools .check {
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.np-tools .btn.small {
  background: rgba(255, 255, 255, 0.12);
}

.np-lyrics,
.np-queue {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  scrollbar-width: none;
}

.np-lyrics {
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 600;
  line-height: 1.35;
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 82%, transparent);
  outline: none;
  font-family: "DynaPuff";
}

.np-lyrics::-webkit-scrollbar,
.np-queue::-webkit-scrollbar {
  display: none;
}

.ly-pad {
  height: 36%;
}

.ly-empty {
  margin: 0;
  padding: 18% 0 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
}

.ly-empty p {
  margin: 0 0 6px;
}

.ly-line {
  --dim: 0.48;
  --white: 0.16;
  margin: 0;
  padding: 0.3em 0;
  transform: scale(0.94);
  transform-origin: left center;
  transition: transform 0.35s ease;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.np-lyrics.plain {
  font-size: clamp(16px, 1.7vw, 22px);
  font-weight: 400;
  line-height: 1.5;
}

.np-lyrics.plain .ly-line {
  --dim: 0.12;
  cursor: default;
  transform: none;
  padding: 0.18em 0;
}

.np-lyrics.plain .ly-pad {
  height: 12%;
}

.ly-line.gap {
  margin-top: 1.1em;
}

.ly-line.past {
  --dim: 0.6;
  --white: 0.12;
}

.ly-line.active {
  --dim: 0.4;
  --white: calc(0.2 + var(--beat) * 0.22);
  transform: scale(1);
}

.ly-line.rest {
  font-size: 0.7em;
  letter-spacing: 0.2em;
}

.ly-line.rest:not(.active) {
  display: none;
}

.ly-w {
  --p: 0;
  --x: 0px;
  --edge: calc(var(--p) * 100%);
  white-space: pre-wrap;
  color: transparent;
  background-image:
  linear-gradient(90deg, rgb(255 255 255 / var(--beat)) var(--edge), rgb(255 255 255 / var(--white)) var(--edge)),
  linear-gradient(90deg, transparent var(--edge), rgb(0 0 0 / var(--dim)) var(--edge)),
  linear-gradient(90deg, var(--g1, #8a91ff), var(--g2, #e9a2fd) 50%, var(--g1, #8a91ff));
  background-size: 100% 100%, 100% 100%, 1440px 100%;
  background-position: 0 0, 0 0, calc(var(--x) + var(--drift, 0px)) 0;
  background-repeat: no-repeat, no-repeat, repeat;
  -webkit-background-clip: text;
  background-clip: text;
}

.ly-line.past .ly-w {
  --p: 0;
}

.np-queue {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.np-queue p {
  margin: 10px 8px;
  font-size: 12px;
}

.queue-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.queue-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.queue-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  border-radius: 12px;
}

.queue-item > .queue-row {
  flex: 1;
  min-width: 0;
}

.queue-grip,
.queue-spacer {
  width: 34px;
  height: 40px;
  flex-shrink: 0;
}

.queue-grip {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  opacity: 0.5;
  touch-action: none;
  transition: opacity 0.15s ease;
}

.queue-grip svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.queue-item:hover .queue-grip,
.queue-grip:focus-visible {
  opacity: 1;
}

.queue-grip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.queue-grip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.np-queue.reordering {
  cursor: grabbing;
  user-select: none;
}

.np-queue.reordering .queue-row:hover {
  background: transparent;
}

.queue-item.shifting {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.queue-item.dragging {
  z-index: 2;
  background: #25252d;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.queue-item.dragging .queue-grip {
  opacity: 1;
  color: var(--white);
  cursor: grabbing;
}

.queue-item.dragging.settle {
  transition: transform 0.16s ease-out;
}

@media (hover: none) {
  .queue-grip {
    opacity: 0.85;
  }
}

.queue-row.now {
  background: rgba(255, 255, 255, 0.12);
}

.queue-row.now .song-title {
  color: var(--accent);
}

@media (max-width: 760px) {
  .np-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    padding: 54px 18px 12px;
  }

  .np-stage {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 2px;
    text-align: left;
    align-items: center;
    justify-items: start;
  }

  .np-frame {
    width: 72px;
    grid-row: 1 / span 2;
    border-radius: 14px;
  }

  .np-art {
    border-radius: 14px;
  }

  .np-title {
    margin: 0;
    font-size: 1.05em;
    align-self: end;
  }

  .np-artist {
    align-self: start;
  }

  .np-stage.has-video {
    grid-template-columns: 1fr;
  }

  .np-stage.has-video .np-frame {
    grid-row: auto;
    max-height: 34vh;
  }

  .player {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 0 10px;
  }

  .player-progress {
    position: absolute;
    left: 0;
    right: 0;
    top: -8px;
    max-width: none;
  }

  .player-time,
  .player-volume,
  .player .player-buttons .player-toggle,
  .player-end > .icon-btn:not(.player-toggle):not(.player-close) {
    display: none;
  }

  .player .player-close {
    margin-left: 2px;
  }

  .player input.player-seek::-webkit-slider-thumb {
    width: 10px;
    height: 10px;
    margin-top: -3px;
  }
}

@media (max-width: 600px) {
  .music-search {
    width: 120px;
  }

  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 8px;
  }

  .art.hero {
    width: 120px;
    height: 120px;
  }

  .music-hero {
    gap: 14px;
  }

  .music-hero-text h2 {
    font-size: 1.4em;
  }

  .song-list .col-num {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .np-art {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .np,
  .np.open {
    transition: none;
  }

  .np.open .np-lyrics:not([hidden]),
  .np.open .np-queue:not([hidden]) {
    animation: none;
  }
}

.party-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(123, 220, 154, 0.2);
}

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

.player-start .player-now {
  flex: 0 1 auto;
}

.player-people {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  padding: 6px 8px 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.player-people:hover {
  background: var(--panel-hover);
}

.player-people:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.player-people[hidden] {
  display: none;
}

body.listening .player-people {
  cursor: default;
}

body.listening .player-people:hover {
  background: transparent;
}

.player-people .avatar {
  width: 28px;
  height: 28px;
  margin-left: -8px;
  font-size: 12px;
  box-shadow: 0 0 0 2px #131316;
}

.player-people .avatar.more {
  font-size: 11px;
  color: var(--muted);
}

.player-people-text {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .player-people {
    display: none;
  }
}

.party-modal {
  width: min(460px, calc(100vw - 32px));
  box-sizing: border-box;
}

.party-link-row {
  display: flex;
  gap: 8px;
}

.party-link {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #2c2c34;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.party-sub {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.party-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.party-people > .muted {
  margin: 0;
  font-size: 13px;
}

.party-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
}

.party-person .muted {
  font-size: 12px;
}

.party-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-page {
  width: 100%;
  max-width: 460px;
  margin: 32px auto;
  padding: 0 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.listen-cover {
  width: min(240px, 60vw);
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

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

.listen-cover svg {
  width: 72px;
  height: 72px;
  fill: var(--muted);
}

.listen-page h1 {
  margin: 14px 0 0;
  font-size: 1.4em;
  overflow-wrap: anywhere;
}

.listen-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.listen-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.listen-page .party-sub {
  align-self: flex-start;
}

.listen-page .party-people {
  align-self: stretch;
  max-height: none;
  text-align: left;
}

.queue-row.static {
  cursor: default;
}

.queue-row.static:hover {
  background: transparent;
}

body.listening .player-seek {
  pointer-events: none;
}

@media (max-width: 600px) {
  .party-link-row {
    flex-direction: column;
  }
}

.listen-signin {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.listen-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.listen-or::before,
.listen-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--panel-active);
}

.listen-sso {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  text-decoration: none;
}

.chat-btn {
  position: relative;
}

.btn.chat-btn.on {
  background-color: color-mix(in srgb, var(--accent) 24%, var(--panel-active));
}

.icon-btn.chat-btn.on {
  color: var(--accent);
}

.chat-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--panel);
  pointer-events: none;
}

.icon-btn.chat-btn .chat-badge {
  top: -3px;
  right: -5px;
  box-shadow: 0 0 0 2px #131316;
}

.chat-panel {
  position: fixed;
  z-index: 38;
  top: 72px;
  right: 16px;
  bottom: calc(var(--player-h) + 16px);
  width: min(380px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  background: #151517;
  border: 1px solid #2a2a2f;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 12px 16px;
  border-bottom: 1px solid #232327;
}

.chat-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-titles strong {
  color: var(--white);
  font-size: 15px;
}

.chat-sub {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-list {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 10px 14px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}

.chat-list.settling {
  overflow-y: hidden;
}

.chat-list:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.chat-spacer {
  flex: 1 0 0;
}

.chat-top {
  padding: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.chat-empty {
  padding: 24px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.chat-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 4px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.chat-day::before,
.chat-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #2a2a2f;
}

.chat-msg {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  margin-top: 8px;
  padding: 5px 6px;
  border-radius: 12px;
}

.chat-msg.cont {
  margin-top: 0;
  padding-top: 1px;
}

.chat-msg:hover {
  background: rgba(255, 255, 255, 0.035);
}

.chat-face .avatar {
  width: 32px;
  height: 32px;
}

.chat-main {
  min-width: 0;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 2px;
}

.chat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}

.chat-msg.mine .chat-name {
  color: var(--accent);
}

.chat-guest {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 6px;
  background: #26262b;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.chat-time {
  flex-shrink: 0;
  color: #7d7d86;
  font-size: 11px;
  white-space: nowrap;
}

.chat-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-text a {
  color: var(--accent);
}

.chat-verified {
  position: relative;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: #7db4ff;
  cursor: help;
  vertical-align: -2px;
  outline: none;
}

.chat-verified svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.chat-verified::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 3;
  top: calc(100% + 7px);
  left: 50%;
  padding: 6px 9px;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, -4px);
  transition:
  opacity 0.15s ease,
  transform 0.15s ease;
  pointer-events: none;
}

.chat-verified:hover::after,
.chat-verified:focus::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chat-verified:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

.chat-guest-face {
  overflow: hidden;
  background: #2b2b33;
  color: #9a9aa9;
}

.chat-guest-face svg {
  width: 74%;
  height: 74%;
  margin-top: 26%;
  fill: currentColor;
}

.chat-event {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 10px 0 2px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.chat-event > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-event strong {
  color: var(--text);
}

.chat-jump {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.chat-compose {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 10px 12px 12px;
  border-top: 1px solid #232327;
}

.chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 132px;
  padding: 10px 12px;
  border: 1px solid #2c2c32;
  border-radius: 12px;
  background: #0e0e10;
  color: var(--white);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-input:disabled {
  opacity: 0.6;
}

.icon-btn.chat-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
}

.icon-btn.chat-send:hover {
  background: var(--accent);
  color: var(--accent-ink);
  filter: brightness(1.1);
}

.icon-btn.chat-send:disabled {
  opacity: 0.4;
  filter: none;
  cursor: default;
}

.chat-count {
  position: absolute;
  right: 60px;
  bottom: 15px;
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

@media (min-width: 1100px) {
  body.chat-open .layout {
    margin-right: 380px;
  }

  .chat-panel {
    top: 60px;
    right: 0;
    bottom: var(--player-h);
    width: 380px;
    border: 0;
    border-left: 1px solid #2a2a2f;
    border-radius: 0;
    background: var(--panel);
    box-shadow: none;
  }

  body.np-open .chat-panel {
    top: 0;
    border-left-color: rgba(255, 255, 255, 0.08);
    background: #111114;
  }

  body.np-open.chat-open .np {
    right: 380px;
  }

  body.chat-open .toasts {
    left: calc((100% - 380px) / 2);
  }
}

@media (min-width: 601px) and (max-width: 1099px) {
  body.np-open .chat-panel {
    top: 0;
    right: 0;
    bottom: var(--player-h);
    width: min(340px, 45vw);
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    background: #111114;
    box-shadow: none;
  }

  body.np-open.chat-open .np {
    right: min(340px, 45vw);
  }

  body.np-open.chat-open .toasts {
    left: calc((100% - min(340px, 45vw)) / 2);
  }
}

@media (max-width: 600px) {
  .chat-panel {
    inset: 0 0 var(--player-h) 0;
    width: auto;
    border: 0;
    border-radius: 0;
  }

  .doc-head .chat-btn > span:not(.chat-badge) {
    display: none;
  }
}

.party-ping {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.party-ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a5a62;
}

.party-ping.good .party-ping-dot {
  background: var(--ok);
}

.party-ping.fair .party-ping-dot {
  background: var(--warn);
}

.party-ping.slow .party-ping-dot,
.party-ping.down .party-ping-dot {
  background: var(--danger);
}

.listen-page .party-ping {
  align-self: center;
  margin-top: 14px;
}

.content.cal-mode {
  padding: 0;
  overflow: hidden;
}

.cal-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.cal-day {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 24px 18px;
  overflow-y: auto;
  border-right: 1px solid #26262b;
  scrollbar-width: thin;
}

.cal-day-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-day-weekday {
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

.cal-day-date {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--white);
}

.cal-day-num {
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}

.cal-day-month {
  color: var(--text);
  font-size: 15px;
}

.cal-day-rel {
  color: var(--muted);
  font-size: 12px;
}

.cal-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-section {
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cal-empty {
  margin: 8px 2px 0;
  color: var(--text);
  font-size: 14px;
}

.cal-hint {
  margin: 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.cal-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px 12px 10px 10px;
  border: 0;
  border-radius: 12px;
  background: #202024;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.cal-item:hover {
  background: #27272c;
}

button.cal-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cal-item.holiday {
  background: rgba(232, 195, 90, 0.08);
  cursor: default;
}

.cal-item-bar {
  width: 4px;
  flex-shrink: 0;
  border-radius: 2px;
  background: var(--c);
}

.cal-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cal-item-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cal-item-title {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cal-item-notes {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.cal-item-repeat {
  color: #7d7d86;
  font-size: 11px;
}

.cal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px 22px;
}

.cal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cal-title {
  flex: 1;
  margin: 0;
  color: var(--white);
  font-size: 24px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-nav .btn.small {
  margin-right: 6px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 6px;
}

.cal-weekdays span {
  padding-left: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cal-grid-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(var(--weeks, 6), minmax(0, 1fr));
  gap: 6px;
  height: 100%;
  touch-action: pan-y;
}

.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  padding: 6px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: -106px;
  background: #00000042;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
}

.cal-cell:hover {
  background: #26262b;
}

.cal-cell.other {
  background: #1c1c1f;
  color: #66666e;
}

.cal-cell.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 800;
}

.cal-cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cal-num {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: -44%;
  font-size: 16px;
  font-weight: 800;
}

.cal-cell.today .cal-num {
  background: var(--accent);
  color: var(--accent-ink);
}

.cal-chip {
  display: block;
  flex-shrink: 0;
  padding: 2px 6px;
  overflow: hidden;
  border-left: none;
  border-radius: -48px;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  color: var(--white);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-cell.other .cal-chip {
  opacity: 0.55;
}

.cal-chip-time {
  margin-right: 4px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.cal-more {
  padding-left: 4px;
  color: var(--muted);
  font-size: 11px;
}

.cal-editor {
  width: min(460px, calc(100vw - 48px));
}

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

.cal-allday {
  margin-bottom: 12px;
}

.cal-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field textarea,
.field select {
  width: 100%;
}

.field textarea {
  min-height: 72px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 15px;
  background-color: var(--bg);
  color: var(--white);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}

.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.field input[type="date"],
.field input[type="time"] {
  color-scheme: dark;
}

.cal-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cal-swatch {
  position: relative;
  cursor: pointer;
}

.cal-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cal-swatch span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px var(--panel);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.cal-swatch input:checked + span {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--white);
}

.cal-swatch input:focus-visible + span {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent);
}

@media (max-width: 900px) {
  .content.cal-mode {
    overflow-y: auto;
  }

  .cal-layout {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: auto;
    min-height: auto;
  }

  .cal-main {
    order: -1;
    flex-shrink: 0;
    min-height: auto;
    padding: 14px 12px 10px;
  }

  .cal-grid-wrap {
    flex: none;
    height: min(64vh, 520px);
  }

  .cal-day {
    padding: 18px 14px 24px;
    overflow: visible;
    border-top: 1px solid #26262b;
    border-right: 0;
  }
}

@media (max-width: 600px) {
  .cal-title {
    font-size: 19px;
  }

  .cal-grid,
  .cal-weekdays {
    gap: 3px;
  }

  .cal-weekdays span {
    padding-left: 0;
    text-align: center;
  }

  .cal-cell {
    align-items: center;
    padding: 4px 3px;
    border-radius: 9px;
  }

  .cal-chip {
    width: 100%;
    height: 5px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: var(--c);
    font-size: 0;
  }

  .cal-more {
    padding: 0;
    font-size: 9px;
  }
}
