* {
  box-sizing: border-box;
}
html {
  color-scheme: dark;
}
body {
  min-width: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}
h3 {
  font-size: 15.5px;
  line-height: 22px;
}
a {
  color: var(--ink);
  text-decoration: none;
}
a:hover {
  color: var(--amber);
}
a.ps-btn--main:hover {
  color: var(--on-amber);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
button:disabled {
  cursor: not-allowed;
}
input,
textarea,
select {
  max-width: 100%;
}
button,
a,
summary {
  touch-action: manipulation;
}
.nd-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}
.ps-menu {
  position: sticky;
  top: 0;
  height: 100vh;
  gap: 2px;
}
.nd-logo {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  margin-bottom: 10px;
}
.nd-logo img {
  width: 238px;
  height: 32px;
}
.nd-signout {
  margin-top: auto;
}
.nd-signout button {
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  font: inherit;
}
.nd-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.nd-header {
  min-height: 64px;
  padding: 10px 32px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nd-header h1 {
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nd-subtitle {
  font-size: 14px;
  color: var(--ink-faint);
}
.nd-header .ps-test {
  margin-left: auto;
}
.nd-test-note {
  color: var(--ink-muted);
  font-size: 12.5px;
}
.nd-mobilebar,
.nd-menu-button {
  display: none;
}
.nd-content {
  padding: 24px 32px;
  flex: 1;
  min-width: 0;
}
.nd-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.nd-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.nd-between {
  justify-content: space-between;
}
.nd-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-panel);
}
.nd-muted {
  color: var(--ink-muted);
}
.nd-faint {
  color: var(--ink-faint);
}
.nd-small {
  font-size: 13.5px;
  line-height: 20px;
}
.nd-code {
  font-family: var(--font-mono);
  color: var(--ink-code);
  overflow-wrap: anywhere;
}
.nd-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
.nd-form {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}
.nd-form .ps-field {
  flex: 1;
  min-width: 150px;
}
.nd-control,
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
select {
  height: 48px;
  background: var(--surface-page);
  border: 1px solid var(--line-control);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--ink-bright);
  width: 100%;
  min-width: 0;
}
.nd-field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nd-field-label > span,
label:not(.ps-tick):not(.ps-choice) {
  color: var(--ink-muted);
}
input:disabled {
  color: var(--ink-faint) !important;
  border-style: dashed !important;
  border-color: var(--line-ghost) !important;
}
.nd-search-panel {
  padding: 0 32px 20px;
  background: var(--surface-rail);
  border-bottom: 1px solid var(--line-soft);
}
.nd-search-form {
  display: grid;
  gap: 16px;
  padding-top: 20px;
}
.nd-query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}
.nd-filter-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: end;
}
.nd-filter-row .nd-field-label {
  flex: 1;
  min-width: 140px;
}
.nd-filter-row .nd-number {
  max-width: 110px;
  min-width: 90px;
}
.nd-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ps-row {
  grid-template-columns: 44px 32px minmax(0, 1fr) 140px 100px 80px 84px;
}
.ps-row__title {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 22px;
  padding: 8px 12px 8px 0;
}
.nd-results-table-header {
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  cursor: default;
}
.nd-result-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nd-result-extra {
  display: none;
}
.ps-seg button {
  min-height: 44px;
  min-width: 44px;
}
.ps-bar {
  z-index: 3;
  min-height: 86px;
}
.nd-error {
  border-color: var(--alarm-line);
  background: var(--alarm-wash);
}
.nd-error-text,
.errorlist {
  color: var(--alarm);
}
.nd-searching {
  padding: 24px 32px;
}
.nd-skeletons {
  display: grid;
  gap: 16px;
  padding: 24px 0;
}
.nd-skeletons div {
  height: 32px;
}
.nd-paste-panel {
  padding: 20px 0;
}
.nd-mobile-edit {
  display: none;
}
.nd-auth-shell {
  min-height: 100vh;
}
.nd-auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line-soft);
  gap: 16px;
  flex-wrap: wrap;
}
.nd-auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px;
  gap: 20px;
}
.nd-auth-main > section {
  width: 440px;
  max-width: 100%;
}
.nd-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  gap: 8px;
}
.nd-hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.nd-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.nd-tablewrap {
  overflow-x: auto;
}
.nd-tablewrap table {
  width: 100%;
  border-collapse: collapse;
}
.nd-tablewrap th,
.nd-tablewrap td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.nd-tablewrap th {
  font: 500 11.5px/16px var(--font-mono);
  color: var(--ink-faint);
  text-transform: uppercase;
}
.nd-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.nd-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nd-item-main {
  flex: 1;
  min-width: 0;
}
.nd-item .ps-chip {
  flex-shrink: 0;
}
.nd-checkline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nd-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--line);
}
.nd-reading {
  max-width: 68ch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 400 18px/30px var(--font-sans);
  letter-spacing: 0.005em;
  color: var(--ink-reading);
}
.nd-reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 40px;
}
.nd-reading-surface {
  background: var(--surface-reading);
  padding: 24px;
  border-radius: 12px;
}
.nd-library {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
}
.nd-library-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.nd-trow {
  display: grid;
  grid-template-columns: 100px minmax(100px, 1fr) 100px minmax(120px, 1fr) 140px;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--surface-selected);
  position: relative;
}
.nd-trow > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.nd-trow a.nd-open::after {
  content: "";
  position: absolute;
  inset: 0;
}
.nd-trow .nd-acts {
  position: relative;
  z-index: 1;
}
.nd-trow details[open] {
  position: relative;
  z-index: 4;
}
.nd-trow details .ps-pop {
  position: absolute;
  right: 0;
  top: 44px;
  max-width: calc(100vw - 32px);
}
.nd-acts {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nd-acts summary {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nd-chiplink {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-ghost);
  border-radius: 8px;
}
.nd-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.nd-auth-form p {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nd-auth-form ul {
  padding-left: 20px;
}
.nd-auth-form .helptext {
  color: var(--ink-faint);
  font-size: 12.5px;
}
.nd-password {
  position: relative;
}
.nd-password input {
  padding-right: 64px !important;
}
.nd-password button {
  position: absolute;
  right: 2px;
  top: 2px;
  height: 44px;
  min-width: 54px;
  background: none;
  border: 0;
  color: var(--ink-muted);
}
dialog.ps-dialog {
  color: var(--ink);
  max-height: calc(100vh - 32px);
  overflow: auto;
}
dialog:not([open]) {
  display: none;
}
dialog::backdrop {
  background: var(--scrim);
}
.nd-export {
  width: 660px;
}
.nd-error-text {
  overflow-wrap: anywhere;
}
.ps-btn {
  white-space: normal;
  height: auto;
  min-height: 44px;
  text-align: center;
}
.ps-btn--main,
.ps-btn--search {
  min-height: 48px;
}
.ps-tag {
  max-width: 100%;
}
.nd-steps {
  padding: 20px 32px;
  border-bottom: 1px solid var(--line-soft);
}
.nd-summary {
  margin-bottom: 24px;
}
.nd-bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nd-phone-status {
  display: none;
}
.nd-nojs {
  padding: 8px 32px;
  color: var(--ink-muted);
}
@media (max-width: 1150px) {
  .ps-row {
    grid-template-columns: 44px 28px minmax(0, 1fr) 120px 84px 72px;
  }
  .ps-row > .nd-duration {
    display: none;
  }
  .nd-trow {
    grid-template-columns: 90px minmax(100px, 1fr) 80px 140px;
  }
  .nd-trow > .nd-origin {
    display: none;
  }
  .nd-library {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}
@media (max-width: 850px) {
  .nd-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .nd-mobilebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-rail);
    border-bottom: 1px solid var(--line-soft);
  }
  .nd-mobilebar .nd-logo {
    margin: 0;
    padding: 0;
  }
  .nd-menu-button {
    display: inline-flex;
  }
  .ps-menu {
    position: static;
    height: auto;
    width: auto;
    display: none;
  }
  .ps-menu.nd-open-menu {
    display: flex;
  }
  .ps-menu .nd-logo {
    display: none;
  }
  .nd-signout {
    margin-top: 16px;
  }
  .nd-header {
    padding: 16px;
  }
  .nd-header h1 {
    font-size: 24px;
    line-height: 30px;
  }
  .nd-header .ps-test {
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 4px 0;
  }
  .nd-content {
    padding: 20px 16px;
  }
  .nd-search-panel {
    padding: 0 16px 20px;
  }
  .nd-grid-2 {
    grid-template-columns: 1fr;
  }
  .nd-library {
    grid-template-columns: 1fr;
  }
  .nd-library-side {
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
  }
  .nd-reader {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .nd-reader aside {
    order: -1;
  }
  .nd-reader .ps-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .nd-reader .ps-meta__row {
    padding: 8px 0;
  }
  .nd-searching {
    padding: 20px 16px;
  }
  .nd-footer,
  .nd-steps {
    padding: 20px 16px;
  }
  .ps-bar {
    padding: 12px 16px;
    gap: 12px;
  }
  .ps-bar__ids {
    display: none;
  }
  .nd-trow {
    grid-template-columns: 90px minmax(100px, 1fr) 90px 140px;
  }
  .nd-mobile-edit {
    display: inline-flex;
  }
  .nd-form-folded {
    display: none !important;
  }
}
@media (max-width: 620px) {
  .nd-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .nd-filter-row .nd-field-label {
    min-width: 0;
  }
  .nd-query-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .ps-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 0;
    gap: 8px;
    overflow: visible;
  }
  .ps-seg button {
    border: 1px solid var(--line-control) !important;
    border-radius: 10px;
    white-space: normal;
  }
  .nd-filter-row > .nd-seg-field {
    grid-column: 1/-1;
  }
  .ps-row {
    grid-template-columns: 44px 24px minmax(0, 1fr) 68px;
    gap: 4px;
    padding: 8px 0;
  }
  .ps-row > .ps-row__id,
  .ps-row > .nd-posted,
  .ps-row > .nd-duration {
    display: none;
  }
  .nd-results-table-header {
    display: none;
  }
  .nd-result-extra {
    display: block;
    font: 400 12.5px/20px var(--font-mono);
    color: var(--ink-faint);
  }
  .ps-row__title {
    font-size: 15px;
    padding: 4px 0;
  }
  .ps-bar__note {
    display: none;
  }
  .ps-bar__actions {
    margin-left: 0;
    flex: 1;
  }
  .ps-bar__actions .ps-btn--main {
    width: 100%;
  }
  .ps-bar__count {
    font-size: 13.5px;
  }
  .ps-bar__count strong {
    font-size: 22px;
  }
  .nd-trow {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 12px 0;
    align-items: center;
  }
  .nd-trow > .nd-origin {
    display: block;
    width: calc(100% - 150px);
  }
  .nd-trow .nd-acts {
    margin-left: auto;
  }
  .nd-trow .nd-open {
    min-height: 44px;
  }
  .nd-trow .nd-lang {
    width: 100%;
  }
  .nd-panel {
    padding: 20px;
  }
  .nd-reading-surface {
    padding: 16px;
  }
  .nd-reading {
    font-size: 17px;
    line-height: 28px;
  }
  .nd-reader .ps-meta {
    grid-template-columns: 1fr;
  }
  .nd-auth-header {
    padding: 12px 16px;
  }
  .nd-auth-header .nd-row {
    gap: 4px;
  }
  .nd-auth-main {
    padding-top: 24px;
  }
  .ps-auth {
    padding: 24px 20px;
  }
  .nd-header .nd-subtitle {
    display: none;
  }
  .nd-header .ps-test {
    font-size: 12.5px;
  }
  .nd-header {
    gap: 8px;
  }
  .nd-summary .ps-summary {
    grid-template-columns: 1fr 1fr;
  }
  .nd-summary .ps-summary__cell {
    padding: 16px;
  }
  .ps-summary__fig strong {
    font-size: 24px;
  }
  .nd-item {
    gap: 8px;
  }
  .nd-item-main {
    flex-basis: 100%;
  }
  .nd-bottom-actions .ps-btn {
    width: 100%;
  }
  .ps-choices {
    grid-template-columns: 1fr;
  }
  .ps-plan {
    padding: 20px;
  }
  .nd-tablewrap {
    margin: 0;
  }
  .ps-bar {
    flex-wrap: wrap;
  }
  .nd-bottom-actions {
    align-items: stretch;
  }
  .nd-auth-header .nd-logo img {
    width: 193px;
  }
}
/* Match the board's single desktop input row; mobile reflows deliberately. */
.nd-seg-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nd-query-row {
  grid-template-columns: minmax(180px, 1fr) 148px 148px auto;
  align-items: end;
}
.nd-query-row:has(#nd-limit) {
  grid-template-columns: minmax(160px, 1fr) 90px 90px 148px 148px auto;
}
.nd-query-row .nd-number {
  min-width: 0;
}
.nd-query-row #nd-find {
  height: 48px;
  white-space: nowrap;
}
.nd-search-form > .ps-help {
  margin: 0;
}
.nd-stack {
  justify-content: flex-start;
}
.nd-stack .nd-list {
  flex: none;
}
@media (max-width: 1150px) {
  .nd-query-row:has(#nd-limit) {
    grid-template-columns: minmax(160px, 1fr) 90px 90px;
  }
  .nd-query-row {
    grid-template-columns: minmax(180px, 1fr) 148px 148px;
  }
  .nd-query-row #nd-find {
    grid-column: 1/-1;
    justify-self: start;
  }
}
@media (max-width: 620px) {
  .nd-query-row,
  .nd-query-row:has(#nd-limit) {
    grid-template-columns: 1fr 1fr;
  }
  .nd-query-row > div:first-child {
    grid-column: 1/-1;
  }
  .nd-query-row #nd-find {
    width: 100%;
  }
  .nd-query-row > label {
    min-width: 0;
  }
  .nd-results-head {
    margin-bottom: 0;
  }
  .nd-content.nd-stack {
    gap: 16px;
  }
}
.nd-runtime-note {
  padding: 8px 32px;
}
.nd-library-summary {
  display: none;
  min-height: 44px;
  cursor: pointer;
}
.nd-library-side-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  accent-color: var(--ink);
  background: var(--surface-selected);
}
progress::-webkit-progress-bar {
  background: var(--surface-selected);
  border-radius: 999px;
}
progress::-webkit-progress-value {
  background: var(--ink);
  border-radius: 999px;
}
progress[aria-label="Videos processed"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 850px) {
  .nd-runtime-note {
    padding: 8px 16px;
  }
  .nd-library-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .nd-library-summary:after {
    content: "+";
    color: var(--ink-muted);
  }
  .nd-library-details[open] .nd-library-summary:after {
    content: "−";
  }
  .nd-library-side-body {
    padding-top: 16px;
  }
  .nd-library-side {
    padding-bottom: 12px;
  }
}
#nd-discovery-output {
  gap: 12px;
}
.nd-results-head {
  margin-bottom: 0;
}
.nd-library .nd-stack {
  gap: 16px;
}
.nd-library .nd-form label:has(select[data-segment]) {
  flex-basis: 100%;
}
.nd-library .ps-seg {
  display: flex;
  flex-wrap: wrap;
  border: 0;
  gap: 4px;
  overflow: visible;
}
.nd-library .ps-seg button {
  border: 1px solid var(--line-control);
  border-radius: 8px;
}
@media (max-width: 620px) {
  .nd-library .ps-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .nd-trow details[open] .ps-pop {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 5;
    border-radius: 12px 12px 0 0;
    padding: 16px;
  }
  .nd-library .nd-form {
    align-items: stretch;
  }
  .nd-library .nd-form .ps-field {
    flex-basis: 100%;
  }
  .nd-library .nd-form > .ps-btn {
    width: 100%;
  }
}
/* Container reflow also handles browser zoom and narrow embedded windows. */
.nd-main {
  container-type: inline-size;
}
@container (max-width:850px) {
  .nd-query-row,
  .nd-query-row:has(#nd-limit) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .nd-query-row > div:first-child {
    grid-column: 1/-1;
  }
  .nd-query-row #nd-find {
    grid-column: 1/-1;
    width: 100%;
  }
  .nd-library {
    grid-template-columns: minmax(0, 1fr);
  }
  .nd-library-summary {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  .nd-library-side {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
  }
  .ps-row {
    grid-template-columns: 44px 24px minmax(0, 1fr) 68px;
    gap: 4px;
  }
  .ps-row > .ps-row__id,
  .ps-row > .nd-posted,
  .ps-row > .nd-duration,
  .nd-results-table-header {
    display: none;
  }
  .nd-result-extra {
    display: block;
    font: 400 12.5px/20px var(--font-mono);
    color: var(--ink-faint);
  }
  .nd-trow {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 12px 0;
  }
  .nd-trow .nd-lang {
    width: 100%;
  }
  .nd-trow .nd-acts {
    margin-left: auto;
  }
  .nd-trow > .nd-origin {
    display: block;
  }
  .nd-form .ps-field {
    min-width: 0;
  }
  .ps-bar__ids {
    display: none;
  }
  .ps-bar__actions {
    margin-left: 0;
  }
  .ps-bar__note {
    display: none;
  }
  .ps-bar {
    padding: 12px 16px;
  }
}
