@font-face {
  font-family: "Share Tech Mono";
  src: url("/fonts/share-tech-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #f5f2ef;
  --paper: #090807;
  --soft: #1d1714;
  --surface: #151110;
  --muted: #b3a9a3;
  --line: #352a24;
  --accent: #ff7a00;
  --accent-hover: #ff942e;
  --accent-soft: #27170c;
  --good: #65d998;
  --bad: #ff7c79;
  font-family: "Share Tech Mono", Consolas, "Liberation Mono", monospace;
  font-size: 16px;
}

body { background: var(--paper); color: var(--ink); }
button, .button {
  border-color: #6e5748;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-weight: 400;
}
button:hover, .button:hover { border-color: var(--accent); background: var(--accent-soft); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); font-weight: 600; }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { color: #9a8d83; border-color: var(--line); background: #191513; }
button:focus-visible, a:focus-visible, input:focus-visible, .drop:focus-visible { outline-color: var(--accent); }
input { background: var(--paper); color: var(--ink); border-color: #6e5748; border-radius: 4px; }
input::placeholder { color: #a5978c; opacity: 1; }
input:focus { border-color: var(--accent); }
label { font-weight: 400; }
h1 { font-size: clamp(30px, 3.2vw, 44px); letter-spacing: -.8px; line-height: 1.15; margin-bottom: 16px; text-transform: uppercase; }
h2 { font-size: 23px; letter-spacing: -.3px; font-weight: 400; }
h3 { font-size: 18px; font-weight: 400; }
.eyebrow { font-size: 13px; letter-spacing: 1.2px; color: var(--accent); margin-bottom: 12px; }
.brand { font-size: 27px; letter-spacing: -.7px; line-height: 1.2; }
.loading { color: var(--muted); }

.login { padding: 32px 20px; }
.login-panel { padding: 0; }
.login-form { max-width: 450px; padding: 40px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 6px; }
.login-form .brand { color: var(--accent); }
.login-form h2 { font-size: 32px; line-height: 1.2; text-transform: uppercase; margin-bottom: 30px; }
.form-error { color: #ffb073; font-weight: 400; }
.panel .password-status { color: var(--good); margin: 16px 0 0; font-size: 14px; }

.shell { grid-template-columns: 260px 1fr; }
.sidebar { background: #0f0c0a; padding: 36px 24px; }
.sidebar .brand { padding: 0 12px 24px; border-bottom: 1px solid var(--line); }
.nav button { color: var(--muted); }
.nav button:hover { color: var(--ink); background: var(--soft); }
.nav button.active { background: var(--accent); color: var(--paper); }
.toolbar { align-items: stretch; }
.toolbar .search { align-items: stretch; }
.toolbar button, .toolbar input { height: 54px; min-height: 54px; }
.toolbar button { padding: 0 18px; }
.side-bottom { padding-top: 36px; }
.service { padding: 16px 0; font-size: 13px; }
.service strong { font-size: 15px; font-weight: 400; }
.service p { color: var(--muted); line-height: 1.5; }
.sidebar-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; }
.sidebar-status > span { color: var(--muted); }
.sidebar-status strong { display: flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.sidebar-status .status-dot { margin-right: 0; }
/* A collection of media, with actions attached to the item they affect. */
.library-view-controls { display: flex; align-items: center; gap: 18px; }
select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.items.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; padding: 24px 0; border-bottom: 0; }
.media-grid .item { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.media-grid .item:hover { border-color: #805332; }
.media-grid .item-main { padding: 18px 18px 0; min-width: 0; }
.media-grid .item-name { display: block; font-size: 19px; line-height: 1.35; margin: 0; overflow-wrap: anywhere; text-transform: none; }
.media-grid .item-meta { display: block; margin-top: 8px; font-size: 12px; line-height: 1.5; }
.media-grid .item-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px; margin-top: auto; }
.media-grid .item-actions .button, .media-grid .item-actions button { font-size: 12px; padding: 8px 10px; min-height: 36px; }
.media-grid .empty { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; }
.library-avatar { display: grid; place-items: center; position: relative; aspect-ratio: 4 / 3; overflow: hidden; font-size: 58px; color: var(--accent); background: var(--soft); border-bottom: 1px solid var(--line); }
.library-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.library-members h2 { margin-bottom: 0; font-size: 24px; }
@media (max-width: 700px) {
  .sidebar .nav { display: grid; grid-template-columns: 1fr 1fr; }
  #nav-settings { grid-column: 1 / -1; }
}
.media-art { position: relative; aspect-ratio: 16 / 9; background: #211913; overflow: hidden; border-bottom: 1px solid var(--line); }
.preview-open { display: block; width: 100%; height: 100%; border: 0; border-radius: 0; padding: 0; background: transparent; position: relative; }
.preview-open:hover { background: #291e15; }
.card-video { width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.preview-ready .card-video { opacity: 1; }
.media-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; pointer-events: none; }
.media-symbol { font-size: 30px; color: #c98753; letter-spacing: 3px; }
.preview-ready .media-placeholder { display: none; }
.preview-play { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #090807b8; color: white; border: 1px solid #ffffff50; border-radius: 50%; padding: 14px 17px; font-size: 18px; }
.preview-ready .preview-play { display: block; }
.preview-open:hover .preview-play { color: var(--accent); border-color: var(--accent); }
.media-format { position: absolute; bottom: 12px; left: 12px; background: #090807df; color: var(--ink); border: 1px solid #6e5748; border-radius: 3px; padding: 4px 7px; font-size: 11px; pointer-events: none; }
.card-edit { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; min-height: 36px; padding: 8px; background: #090807e8; border-color: #6e5748; }
.card-edit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.card-path { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.folder-art { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; background: #20170f; border-bottom: 1px solid var(--line); color: #c98753; font-size: 11px; }
.folder-art svg { width: 62px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.media-grid.categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-grid.categories .item-main { padding: 24px 24px 0; }
.media-grid.categories .item-actions { padding: 24px; }
.media-grid.categories .item-name { font-size: 28px; text-transform: uppercase; }
.rename-input { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.rename-input input { min-width: 0; flex: 1; }
.rename-input span { color: var(--muted); }
dialog.video-dialog { width: min(900px, calc(100% - 32px)); max-width: 900px; }
.player-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.player-heading h2 { overflow-wrap: anywhere; }
#video-player { width: 100%; max-height: 65vh; background: #000; margin-bottom: 20px; }
.player-error { color: var(--bad); }
#upload-dialog { width: min(560px, calc(100% - 32px)); max-width: 560px; max-height: min(720px, 85vh); padding: 26px; }
.upload-overlay-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.upload-overlay-heading h2 { margin-bottom: 20px; }
.upload-overlay-heading .eyebrow { font-size: 11px; margin-bottom: 8px; }
#upload-dialog .queue { margin: 0; }
#upload-dialog .upload-item { padding: 18px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 6px; }
#upload-dialog .upload-title { align-items: flex-start; gap: 12px; font-size: 14px; }
#upload-dialog .upload-title strong { font-weight: 400; overflow-wrap: anywhere; min-width: 0; }
#upload-dialog .upload-title > span { white-space: nowrap; color: var(--muted); font-size: 12px; }
.upload-destination { font-size: 12px; color: var(--muted); margin: 8px 0 18px; }
.upload-state { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upload-state p { font-size: 13px; margin: 10px 0 0; }
.upload-state button { font-size: 12px; min-height: 34px; padding: 6px 10px; margin-top: 10px; }
#upload-dialog .upload-done { border-color: #65d99850; }
.upload-done .upload-state { color: var(--good); }
.upload-error .upload-state { color: var(--bad); }
#upload-dialog .upload-done progress { accent-color: var(--good); }
#upload-dialog .upload-done progress::-webkit-progress-value { background: var(--good); }
#upload-dialog .upload-done progress::-moz-progress-bar { background: var(--good); }
#upload-dialog .upload-error progress::-webkit-progress-value { background: var(--bad); }
#upload-dialog .upload-error progress::-moz-progress-bar { background: var(--bad); }
#upload-dialog .upload-done .upload-state p { color: var(--good); }
#upload-dialog .upload-error .upload-state p { color: var(--bad); }
.upload-overlay-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 18px 0 0; }
.upload-reopen { position: fixed; bottom: 24px; right: 24px; box-shadow: 0 8px 30px #0008; z-index: 5; background: var(--surface); border-color: var(--accent); }
@media (max-width: 700px) {
  .library-view-controls { gap: 12px; flex-wrap: wrap; }
  .section-line:has(#library-sort) { align-items: flex-start; flex-direction: column; gap: 14px; }
  .items.media-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
  .media-grid.categories { grid-template-columns: 1fr; }
  #upload-dialog { padding: 20px; }
  #upload-dialog .upload-title { flex-direction: row; }
  .upload-state { align-items: flex-start; }
}
.account { margin-top: 14px; }
.account p { font-size: 14px; color: var(--accent); margin-bottom: 16px; }

.main { padding: 32px clamp(24px, 4vw, 64px) 60px; width: 100%; max-width: 1450px; }
.topline { padding: 16px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin-bottom: 42px; }
.topline p { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.heading p { max-width: 680px; }
.heading .eyebrow { margin-bottom: 12px; }
.stats { grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; border: 0; }
.stat { padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.stat:last-child { border: 1px solid var(--line); }
.stat span { font-size: 13px; margin-bottom: 10px; }
.stat strong { font-size: 34px; font-weight: 400; color: var(--accent); line-height: 1.2; }
.stat:last-child strong { font-size: 27px; }

.breadcrumbs { font-size: 14px; }
.breadcrumbs button { color: var(--muted); text-underline-offset: 4px; }
.breadcrumbs button:hover { color: var(--accent); }
.breadcrumbs span[aria-hidden] { color: var(--accent); }
.breadcrumbs span[aria-current] { font-weight: 400; }
.section-line { border-color: var(--line); padding-bottom: 16px; }
.section-line h2 { font-size: 18px; text-transform: uppercase; letter-spacing: .4px; }
.section-line span { font-size: 13px; }
.item { padding: 24px 0; }
.item-name { font-size: 20px; font-weight: 400; }
.folder-link { text-underline-offset: 5px; }
.folder-link:hover { color: var(--accent); background: transparent; }
.item-meta { font-size: 13px; margin-top: 8px; }
.item-actions button, .item-actions .button { font-size: 14px; min-height: 44px; padding: 9px 14px; }
.item-actions [data-delete-file]:hover { color: #ffb073; }
.categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.categories .item { flex-direction: column; align-items: stretch; gap: 28px; padding: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.categories .item:hover { border-color: #a6500b; }
.categories .item-name { font-size: 30px; text-transform: uppercase; text-decoration: none; }
.categories .item-actions button { width: 100%; background: var(--accent); border-color: var(--accent); color: var(--paper); }
.categories .item-actions button:hover { background: var(--accent-hover); }
.empty { padding: 48px 24px; border: 1px solid var(--line); border-top: 0; background: var(--surface); border-radius: 0 0 6px 6px; }
.empty strong { font-weight: 400; font-size: 19px; }

.drop { border-color: #6e5748; border-top: 0; border-radius: 0 0 6px 6px; padding: 36px 30px; background: var(--surface); }
.drop.dragging { outline-color: var(--accent); background: var(--accent-soft); }
.drop p { margin: 18px auto 0; max-width: 650px; font-size: 14px; }
.drop h3 { margin-bottom: 20px; }
.upload-item { border-radius: 6px; background: var(--surface); padding: 20px; margin-top: 12px; }
.upload-title strong { font-weight: 400; }
.upload-item p { font-size: 14px; }
.upload-item progress { height: 8px; margin: 16px 0; accent-color: var(--accent); border: 0; background: var(--line); border-radius: 2px; overflow: hidden; }
.upload-item progress::-webkit-progress-bar { background: var(--line); }
.upload-item progress::-webkit-progress-value { background: var(--accent); }
.upload-item progress::-moz-progress-bar { background: var(--accent); }
.upload-item button { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.hint { font-size: 14px; }

.settings-grid { gap: 24px; }
.panel { border-radius: 6px; background: var(--surface); padding: 30px; max-width: 900px; }
.panel h2 { text-transform: uppercase; font-size: 22px; }
.panel p { max-width: 740px; color: var(--muted); }
.statuses { gap: 24px; padding-top: 24px; }
.statuses strong { font-weight: 400; margin-bottom: 8px; }
.statuses span { font-size: 14px; }
.notice { background: var(--surface); color: var(--ink); border-color: var(--accent); border-radius: 6px; box-shadow: none; }
.notice button { color: var(--accent); min-height: 32px; font-size: 14px; }
.notice.error { color: #ffb073; font-weight: 400; }
dialog { border-color: #6e5748; border-top: 3px solid var(--accent); border-radius: 6px; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: #000c; }
dialog h2 { text-transform: uppercase; }
dialog p { color: var(--muted); }
dialog .form-error { font-size: 14px; }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; margin-right: 10px; vertical-align: middle; background: #98867b; }
.status-dot.status-good { background: var(--good); }
.status-dot.status-warn, .status-dot.status-pending { background: var(--accent); }
.status-dot.status-bad { background: var(--bad); }
.connection-overview { display: flex; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.live-badge { display: inline-flex; align-items: center; padding: 5px 11px; border: 1px solid; border-radius: 4px; font-size: 14px; white-space: nowrap; }
.live-badge.status-good { color: var(--good); border-color: #315741; background: #111b15; }
.live-badge.status-warn, .live-badge.status-pending { color: #ffad62; border-color: #69411e; background: var(--accent-soft); }
.live-badge.status-bad { color: var(--bad); border-color: #6b3731; background: #231211; }
.live-caption { color: var(--muted); font-size: 13px; text-align: right; }
.status-row > span { display: block; padding-left: 19px; }
.status-row strong { display: flex; align-items: baseline; }
.status-row strong .status-dot { align-self: center; }
.check-spinner { width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid #6c4223; border-top-color: var(--accent); border-radius: 50%; animation: check-spin .8s linear infinite; }
#check-connections { gap: 12px; min-width: 255px; }
#check-connections[aria-busy=true] { color: var(--accent); border-color: #69411e; background: var(--accent-soft); cursor: wait; }
@keyframes check-spin { to { transform: rotate(360deg); } }
.nas-resources { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.resource-heading, .network-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.resource-heading h3, .network-heading h3 { margin: 0; text-transform: uppercase; }
.resource-heading > span, .network-heading > span { color: var(--muted); font-size: 13px; text-align: right; }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.resource-card { display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.resource-label { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.resource-card > strong { font-size: 30px; font-weight: 400; color: var(--ink); line-height: 1.3; white-space: nowrap; }
.resource-detail { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.resource-detail .status-dot { width: 7px; height: 7px; margin-right: 7px; }
.resource-bar { width: 100%; display: block; height: 6px; margin-top: 16px; border: 0; border-radius: 2px; overflow: hidden; background: var(--line); accent-color: var(--good); }
.resource-bar::-webkit-progress-bar { background: var(--line); }
.resource-bar::-webkit-progress-value { background: var(--good); }
.resource-bar::-moz-progress-bar { background: var(--good); }
.resource-bar.status-warn { accent-color: var(--accent); }
.resource-bar.status-warn::-webkit-progress-value { background: var(--accent); }
.resource-bar.status-warn::-moz-progress-bar { background: var(--accent); }
.resource-bar.status-bad { accent-color: var(--bad); }
.resource-bar.status-bad::-webkit-progress-value { background: var(--bad); }
.resource-bar.status-bad::-moz-progress-bar { background: var(--bad); }
.network-heading { margin-top: 26px; margin-bottom: 12px; }
.network-values { display: flex; flex-wrap: wrap; gap: 12px 28px; color: var(--muted); font-size: 14px; }
.network-values strong { font-weight: 400; color: var(--ink); margin-left: 8px; }
.chart-scale { margin-top: 18px; font-size: 12px; color: var(--muted); }
.network-chart { display: block; width: 100%; height: 104px; margin-top: 4px; }
.network-chart path { fill: none; vector-effect: non-scaling-stroke; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-receive { stroke: var(--good); stroke-width: 2; }
.chart-send { stroke: var(--accent); stroke-width: 2; }
.panel .chart-empty { margin: 18px 0 0; padding: 22px 16px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 14px; }
.panel .resource-footnote { font-size: 13px; margin: 16px 0 0; }
.panel .resource-unavailable { margin: 0; font-size: 14px; }
.connection-checked { margin-bottom: 0; padding-bottom: 20px; }

@media (prefers-reduced-motion: reduce) { .check-spinner { animation: none; border-style: dotted; } }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 224px 1fr; }
  .sidebar { padding: 28px 18px; }
  .main { padding: 26px 24px 60px; }
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .stat { padding: 20px 16px; }
}
@media (max-width: 700px) {
  .login-form { padding: 28px; }
  .sidebar { padding: 20px; }
  .sidebar .brand { padding: 0; border-bottom: 0; font-size: 25px; }
  .nav { gap: 8px; }
  .nav button { padding: 12px 8px; }
  .main { padding: 24px 20px 70px; }
  .topline { margin-bottom: 30px; padding: 14px 16px; }
  .topline p { font-size: 13px; max-width: none; }
  h1 { font-size: 31px; letter-spacing: -.8px; overflow-wrap: anywhere; }
  .heading .muted { font-size: 15px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; margin: 26px 0; }
  .stat { padding: 18px 16px; }
  .stat:nth-child(2) { border: 1px solid var(--line); }
  .stat:last-child { grid-column: 1 / -1; border: 1px solid var(--line); }
  .stat:last-child strong { font-size: 25px; }
  .categories { grid-template-columns: 1fr; gap: 16px; }
  .categories .item { padding: 24px; gap: 24px; }
  .drop { padding: 28px 18px; }
  .drop p { font-size: 13px; }
  .panel { padding: 24px; }
  .section-line span { text-align: right; }
  dialog .actions { flex-wrap: wrap; }
  .connection-overview { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .live-caption { text-align: left; }
  .resource-heading, .network-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .resource-heading > span, .network-heading > span { text-align: left; overflow-wrap: anywhere; }
  .resource-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .resource-card { padding: 16px; }
  .resource-card:last-child { grid-column: 1 / -1; }
  #check-connections { width: 100%; min-width: 0; }
}
