:root {
  color-scheme: dark;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  --black: #050201;
  --void: #100603;
  --deep: #1b0a04;
  --panel: #2a1007;
  --panel-2: #3b1909;
  --brown: #5d270b;
  --ink: #fff4d2;
  --muted: #d89d55;
  --gold: #ffb000;
  --gold-2: #ff7a00;
  --gold-3: #ffe073;
  --cream: #fff2c5;
  --line: #080201;
  --ok: #36d08e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 176, 0, .28), transparent 34%),
    radial-gradient(circle at 18% 28%, rgba(255, 122, 0, .18), transparent 24%),
    linear-gradient(180deg, #000 0%, var(--void) 42%, #080301 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 176, 0, .055) 1px, transparent 1px),
    linear-gradient(rgba(255, 176, 0, .055) 1px, transparent 1px);
  background-size: 12px 12px;
  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 18%, #ffb000 0 2px, transparent 3px),
    radial-gradient(circle at 78% 16%, #ffd35c 0 2px, transparent 3px),
    radial-gradient(circle at 86% 34%, #ff8a00 0 3px, transparent 4px),
    radial-gradient(circle at 12% 56%, #ffb000 0 2px, transparent 3px);
  opacity: .75;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  position: relative;
  display: block;
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(255, 176, 0, .09), transparent 210px),
    var(--deep);
  border-inline: 4px solid var(--line);
  box-shadow:
    0 0 0 5px #ffb000,
    0 0 0 9px #5d270b,
    0 0 40px rgba(255, 176, 0, .34);
}

.rail-button {
  min-width: 92px;
  min-height: 54px;
  padding: 8px 12px;
  border: 3px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, var(--cream), #ffb000 52%, #d66500);
  color: #2b0d03;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 4px 4px 0 #000, inset 0 0 0 3px rgba(255, 242, 197, .62);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .38);
  white-space: nowrap;
}

.rail-button.active {
  color: #fff2c5;
  background: linear-gradient(180deg, #8d3909, #2b0d03);
  box-shadow: 4px 4px 0 #000, 0 0 0 3px var(--gold), 0 0 18px rgba(255, 176, 0, .65);
}

.rail-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: #140604;
  color: var(--gold-3);
  border: 3px solid var(--gold);
  font-size: 15px;
  box-shadow: inset -3px -3px 0 #5f2609;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 12px;
  padding: 16px 16px 14px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 176, 0, .28), transparent 38%),
    linear-gradient(180deg, #2c1006, #130603);
  border-bottom: 5px solid var(--line);
  box-shadow: inset 0 -5px 0 var(--gold), 0 8px 0 #000;
}

.topbar-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
}

.mode-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.brand-logo {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border: 3px solid var(--gold);
  background: #000;
  box-shadow: 4px 4px 0 #000, 0 0 22px rgba(255, 176, 0, .58);
  image-rendering: pixelated;
}

h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(30px, 7vw, 48px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-shadow:
    3px 3px 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 0 16px rgba(255, 176, 0, .55);
}

p {
  margin: 9px 0 0;
  color: var(--gold-3);
  font-size: 14px;
  font-weight: 900;
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 3px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, var(--cream), #ff9b00);
  color: #2b0d03;
  font-size: 30px;
  line-height: 1;
  box-shadow: 4px 4px 0 #000, inset 0 0 0 3px rgba(255, 255, 255, .24);
}

.control-panel {
  padding: 22px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 176, 0, .12), rgba(255, 176, 0, .03)),
    var(--panel);
  border-bottom: 4px solid #000;
}

.map-panel {
  padding: 18px;
}

.map-frame {
  position: relative;
  border: 4px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 224, 115, .12), transparent),
    #120603;
  padding: 10px;
  box-shadow: 7px 7px 0 #000, 0 0 26px rgba(255, 176, 0, .35);
}

.map-tools {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.map-tool {
  min-width: 42px;
  height: 42px;
  border: 3px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, var(--cream), #ff9b00);
  color: #210902;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 3px 3px 0 #000;
}

.map-tool.reset {
  min-width: 62px;
  font-size: 15px;
}

.map-viewport {
  position: relative;
  height: calc(100vh - 178px);
  min-height: 430px;
  overflow: hidden;
  touch-action: none;
  border: 3px solid var(--gold);
  background: #000;
  cursor: grab;
}

.guide-viewport {
  min-height: 360px;
}

.map-viewport.dragging {
  cursor: grabbing;
}

.company-map {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
}

.guide-image {
  background: #f8c5df;
}

.image-open-tile {
  display: grid;
  grid-template-rows: minmax(260px, 62vh) auto;
  width: 100%;
  min-height: calc(100vh - 170px);
  padding: 12px;
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--panel-2);
  color: var(--line);
  box-shadow: 7px 7px 0 #000;
  text-align: left;
}

.image-open-tile img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border: 4px solid var(--line);
  background: #000;
}

.image-open-tile span {
  display: grid;
  gap: 6px;
  padding: 14px 4px 0;
}

.image-open-tile strong {
  font-size: 28px;
  font-weight: 950;
  color: var(--line);
}

.image-open-tile small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.image-open-tile:active {
  transform: translate(3px, 3px);
  box-shadow: 4px 4px 0 #000;
}

input[type="search"],
select {
  width: 100%;
  min-height: 60px;
  border: 3px solid var(--line);
  border-radius: 0;
  padding: 0 15px;
  background: #fff4d2;
  color: #1b0a04;
  font-size: 18px;
  font-weight: 850;
  outline: none;
  box-shadow: 6px 6px 0 #000, inset 0 -5px 0 #e58a00;
}

input[type="search"]:focus,
select:focus {
  border-color: var(--gold-3);
  box-shadow: 6px 6px 0 #000, 0 0 0 4px var(--gold), 0 0 22px rgba(255, 176, 0, .48);
}

.browse-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.browse-panel label {
  display: grid;
  gap: 8px;
  color: var(--gold-3);
  font-size: 14px;
  font-weight: 950;
  text-shadow: 2px 2px 0 #000;
}

.chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-top: 16px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  border: 3px solid var(--line);
  border-radius: 0;
  padding: 10px 13px;
  background: linear-gradient(180deg, #ffe073, #ff9b00 60%, #8a3608);
  color: #210902;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 4px 4px 0 #000;
}

.content {
  padding: 20px 18px 40px;
}

.result-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--gold-3);
  font-size: 15px;
  font-weight: 950;
  margin-bottom: 14px;
  text-shadow: 2px 2px 0 #000;
}

.results {
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 224, 115, .1), transparent 42%),
    linear-gradient(90deg, #3b1909, #1a0703);
  padding: 15px;
  text-align: left;
  box-shadow: 6px 6px 0 #000, inset 0 0 0 3px rgba(255, 176, 0, .22);
}

.result-card::before {
  content: "";
  width: 10px;
  align-self: stretch;
  background: linear-gradient(180deg, var(--gold-3), var(--gold-2));
}

.result-card {
  grid-template-columns: 10px minmax(0, 1fr) auto;
}

.result-card:active {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 #000;
}

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

.model {
  color: var(--cream);
  font-size: 21px;
  font-weight: 950;
  line-height: 1.25;
  text-shadow: 2px 2px 0 #000;
}

.meta {
  margin-top: 7px;
  color: var(--gold-3);
  font-size: 14px;
  font-weight: 950;
}

.dims {
  margin-top: 10px;
  color: #ffb000;
  font-size: 18px;
  font-weight: 950;
}

.curb-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 10px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.curb-badge.standard {
  background: rgba(77, 145, 91, .16);
  color: #4f6f43;
}

.curb-badge.nonstandard {
  background: rgba(178, 102, 28, .12);
  color: #8c531d;
}

.curb-badge.unknown {
  background: rgba(140, 140, 140, .12);
  color: #666;
}

.result-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.score-badge,
.verify-badge {
  border: 3px solid var(--line);
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: 3px 3px 0 #000;
}

.score-badge {
  background: #fff2c5;
  color: #2a1007;
}

.verify-badge {
  background: var(--ok);
  color: #031a0d;
}

.empty {
  padding: 32px 16px;
  border: 3px dashed var(--gold);
  background: rgba(255, 242, 197, .08);
  color: var(--cream);
  text-align: center;
  font-size: 17px;
  font-weight: 900;
  box-shadow: inset 0 0 22px rgba(255, 176, 0, .18);
}

.product-dialog {
  width: min(94vw, 860px);
  max-height: 88vh;
  padding: 0;
  border: 4px solid var(--line);
  border-radius: 0;
  box-shadow: 10px 10px 0 #000, 0 0 30px rgba(255, 176, 0, .45);
  background: var(--panel);
  color: var(--ink);
}

.product-dialog::backdrop {
  background: rgba(0, 0, 0, .74);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 5px solid var(--gold);
  background: linear-gradient(180deg, #3b1909, #160603);
}

.dialog-model {
  color: var(--cream);
  font-size: 26px;
  font-weight: 950;
  text-shadow: 2px 2px 0 #000;
}

.dialog-category {
  margin-top: 6px;
  color: var(--gold-3);
  font-weight: 950;
}

.dialog-basis {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.dialog-body {
  padding: 16px;
  overflow: auto;
  max-height: calc(88vh - 86px);
}

.spec-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.spec-list div {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
}

dt {
  color: var(--muted);
  font-weight: 950;
}

dd {
  margin: 0;
  font-weight: 850;
}

.image-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}

.image-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.image-label,
.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 #000;
  font-weight: 950;
}

.image-label {
  padding: 4px 10px;
  background: var(--gold);
  color: #2a1007;
}

.source-link {
  padding: 4px 12px;
  background: #fff2c5;
  color: #2a1007;
  text-decoration: none;
}

.source-link:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
}

.product-image {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: 5px 5px 0 #000;
}

.crop-dialog {
  width: min(96vw, 1180px);
  max-height: 92vh;
  padding: 0;
  border: 1px solid rgba(52, 37, 31, .16);
  border-radius: 16px;
  background: var(--paper);
  color: var(--line);
  box-shadow: 0 24px 66px rgba(25, 17, 13, .32);
}

.crop-dialog::backdrop {
  background: rgba(25, 17, 13, .76);
}

.crop-dialog-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.crop-status {
  margin: 0;
  color: var(--stone);
  font-size: 14px;
}

.crop-stage {
  position: relative;
  overflow: auto;
  max-height: 74vh;
  border: 1px solid rgba(52, 37, 31, .14);
  border-radius: 12px;
  background: #fff;
  touch-action: none;
  user-select: none;
}

.crop-source-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.crop-selection {
  position: absolute;
  border: 2px solid var(--teal);
  background: rgba(0, 128, 112, .16);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .24), 0 0 0 1px rgba(255, 255, 255, .8) inset;
  pointer-events: none;
}

.file-panel {
  padding: 18px;
  background: var(--panel);
}

.file-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.file-path-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 4px solid rgba(52, 37, 31, .12);
  background: rgba(255, 253, 244, .88);
  box-shadow: 4px 4px 0 rgba(83, 40, 32, .12);
  color: var(--muted);
  font-weight: 900;
}

.file-path-segment {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 211, 168, .48);
  color: var(--line);
}

.file-path-segment.current {
  background: var(--teal);
  color: #fff8df;
}

.file-path-segment.clickable {
  cursor: pointer;
}

.file-path-separator {
  color: rgba(52, 37, 31, .42);
}

.file-toolbar h2 {
  margin: 0;
  color: var(--line);
  font-size: 26px;
  text-shadow: 2px 2px 0 var(--gold-2);
}

.file-search,
.file-upload label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 900;
}

.file-search input,
.file-upload select,
.file-picker input {
  width: 100%;
  min-height: 44px;
  border: 4px solid var(--teal);
  border-radius: 0;
  background: #fffdf4;
  color: var(--line);
  padding: 8px 10px;
  box-shadow: 4px 4px 0 var(--line);
}

.file-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.folder-tree {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px;
  border: 4px solid rgba(52, 37, 31, .12);
  background: rgba(255, 253, 244, .92);
  box-shadow: 4px 4px 0 rgba(83, 40, 32, .12);
}

.folder-tree-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.folder-tree-head strong {
  color: var(--line);
  font-size: 18px;
}

.folder-tree-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.folder-tree-body {
  display: grid;
  gap: 8px;
}

.folder-node-wrap {
  display: grid;
  gap: 8px;
}

.folder-children {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  border-left: 2px solid rgba(52, 37, 31, .16);
  margin-left: 18px;
}

.folder-node {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 3px solid rgba(52, 37, 31, .16);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffef9, #f4eadf);
  box-shadow: 3px 3px 0 rgba(83, 40, 32, .14);
  text-align: left;
}

.folder-node.active {
  border-color: var(--teal);
  background: linear-gradient(180deg, #f1fffb, #dff7f3);
  box-shadow: 4px 4px 0 rgba(0, 90, 78, .18);
}

.folder-node-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(52, 37, 31, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  font-size: 18px;
}

.folder-node-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.folder-node-text strong {
  color: var(--line);
  font-size: 16px;
}

.folder-node-text em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.file-category {
  min-height: 74px;
  min-width: 148px;
  padding: 12px 14px;
  border: 4px solid var(--line);
  border-radius: 16px 16px 12px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(245, 211, 168, .24));
  color: var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  box-shadow: 5px 5px 0 var(--brown);
  font-weight: 950;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.file-category::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 54px;
  height: 14px;
  border-right: 4px solid var(--line);
  border-bottom: 4px solid var(--line);
  border-radius: 0 0 12px 0;
  background: rgba(245, 211, 168, .92);
}

.file-category-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(52, 37, 31, .26);
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  color: var(--teal);
  font-size: 18px;
  position: relative;
  z-index: 1;
}

.file-category-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.file-category strong {
  color: var(--teal);
  font-size: 19px;
  position: relative;
  z-index: 1;
}

.file-category-main span {
  overflow-wrap: anywhere;
}

.file-category.active {
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--line), inset 0 0 0 4px var(--gold-3);
}

.file-upload {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 16px;
  border: 4px solid var(--line);
  background: var(--panel-2);
  box-shadow: 5px 5px 0 var(--brown);
}

#fileFolderLabel {
  display: none !important;
}

.file-drop-zone {
  display: grid;
  place-items: center;
  min-height: 56px;
  margin-bottom: 16px;
  padding: 12px;
  border: 2px dashed rgba(52, 37, 31, .28);
  border-radius: 14px;
  background: rgba(245, 239, 230, .72);
  color: var(--muted);
  font-weight: 900;
  transition: .15s ease;
}

.file-drop-zone.hover {
  border-color: var(--gold);
  background: rgba(255, 243, 210, .92);
  color: var(--line);
}

.file-help {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.file-list {
  display: grid;
  gap: 10px;
  padding: 2px;
}

.registry-detail {
  display: grid;
  gap: 16px;
}

.registry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 4px solid var(--line);
  background: var(--panel-2);
  box-shadow: 5px 5px 0 var(--brown);
}

.registry-head h3 {
  margin: 0 0 4px;
  color: var(--line);
  font-size: 28px;
}

.registry-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.registry-row {
  align-items: start;
}

.registry-period-line {
  color: var(--line);
  font-weight: 900;
}

.registry-alert-card {
  border-left: 8px solid var(--gold);
}

.registry-alert-card.upcoming {
  border-left-color: #e3a423;
}

.registry-alert-card.today,
.registry-alert-card.overdue {
  border-left-color: #b63a1d;
}

.registry-reminder-dialog {
  width: min(760px, calc(100vw - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.registry-reminder-dialog::backdrop {
  background: rgba(20, 8, 4, .78);
}

.registry-reminder-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 5px solid #6d1e13;
  background:
    linear-gradient(180deg, #fff7ea, #f7ddbf);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35), 8px 8px 0 #3b140c;
}

.registry-reminder-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.registry-reminder-head strong {
  display: block;
  color: #7f1d12;
  font-size: 34px;
  font-weight: 950;
  line-height: 1.05;
}

.registry-reminder-head p {
  margin: 6px 0 0;
  color: #5c372b;
  font-weight: 900;
}

.registry-reminder-body {
  display: grid;
  gap: 10px;
  max-height: min(56vh, 560px);
  overflow: auto;
}

.registry-reminder-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 4px solid var(--line);
  background: #fffdf8;
  box-shadow: 4px 4px 0 rgba(83, 40, 32, .8);
}

.registry-reminder-card strong {
  color: var(--line);
  font-size: 22px;
}

.registry-reminder-card span {
  color: var(--muted);
  font-weight: 900;
}

.registry-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--line);
  font-weight: 900;
}

.registry-check-row.inline {
  margin-top: 0;
}

.registry-check-row input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.registry-reminder-card.upcoming {
  border-color: #d09a12;
  background: #fff6da;
}

.registry-reminder-card.today {
  border-color: #b25713;
  background: #ffe7c8;
}

.registry-reminder-card.overdue {
  border-color: #912116;
  background: #ffd7cf;
}

.registry-reminder-actions {
  display: flex;
  justify-content: flex-end;
}

.file-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 4px solid rgba(52, 37, 31, .9);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 239, 227, .98));
  box-shadow: 4px 4px 0 rgba(83, 40, 32, .72);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.file-row .file-action.open {
  background: #f0e4d7;
}

.file-type {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 4px solid var(--line);
  background: var(--teal);
  color: #fff8df;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--gold);
}

.file-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.file-info strong {
  overflow-wrap: anywhere;
  color: var(--line);
  font-size: 17px;
}

.file-info span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

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

.file-row:hover,
.file-row:focus-visible {
  transform: translateY(-1px);
  border-color: var(--teal);
  box-shadow: 6px 6px 0 rgba(83, 40, 32, .82);
}

.file-action {
  min-height: 40px;
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--cream);
  color: var(--line);
  padding: 7px 12px;
  box-shadow: 3px 3px 0 #120806;
  text-decoration: none;
  font-weight: 950;
}

.file-action.primary {
  background: var(--teal);
  color: #fff8df;
}

.file-action.danger {
  background: #fff0b8;
  color: #8c1f16;
}

.file-action.preview {
  background: var(--gold);
}

.file-preview {
  margin-bottom: 16px;
  padding: 12px;
  border: 4px solid var(--line);
  background: #fffdf4;
  box-shadow: 5px 5px 0 var(--brown);
}

.file-preview-summary {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 4px solid rgba(52, 37, 31, .15);
  background: rgba(255, 253, 244, .92);
}

.file-preview-summary-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 4px solid var(--line);
  background: var(--teal);
  color: #fff8df;
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.file-preview-summary-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.file-preview-summary-text strong {
  color: var(--line);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.file-preview-summary-text span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.preview-header strong {
  overflow-wrap: anywhere;
  color: var(--line);
  font-size: 18px;
}

.preview-image {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border: 4px solid var(--line);
  background: #fff;
}

.preview-frame {
  display: block;
  width: 100%;
  height: 62vh;
  min-height: 420px;
  border: 4px solid var(--line);
  background: #fff;
}

.fullscreen-preview-media,
.fullscreen-preview-audio {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.fullscreen-preview-media {
  max-height: 64vh;
  background: #000;
}

.fullscreen-preview-audio {
  padding: 8px 0;
}

.preview-text {
  max-height: 52vh;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 4px solid var(--line);
  background: #fff;
  color: var(--line);
  white-space: pre-wrap;
}

.file-preview-dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--black);
  color: var(--ink);
}

.file-preview-dialog::backdrop {
  background: rgba(0, 0, 0, .86);
}

.file-preview-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border-bottom: 5px solid var(--gold);
  background:
    linear-gradient(180deg, #3b1909, #140603);
  box-shadow: 0 6px 0 #000;
}

.file-preview-topbar strong {
  overflow-wrap: anywhere;
  color: var(--cream);
  font-size: 20px;
  font-weight: 950;
  text-shadow: 2px 2px 0 #000;
}

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

.file-preview-actions .file-action {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: none;
}

.file-preview-dialog-body {
  height: calc(100vh - 76px);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 176, 0, .08), transparent),
    #080301;
}

.fullscreen-preview-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  border: 4px solid var(--gold);
  background: #000;
  box-shadow: inset 0 0 0 4px var(--line);
  cursor: grab;
}

.fullscreen-preview-viewport.dragging {
  cursor: grabbing;
}

.fullscreen-preview-image {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}

.fullscreen-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 4px solid var(--gold);
  background: #fff;
}

.fullscreen-preview-text {
  width: 100%;
  height: 100%;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 4px solid var(--gold);
  background: #fffdf4;
  color: var(--line);
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.6;
}

.hidden {
  display: none;
}

@media (max-width: 480px) {
  .rail-button {
    min-width: 86px;
    min-height: 48px;
    padding: 6px 10px;
  }

  .topbar {
    gap: 10px;
    padding: 12px 10px 15px;
  }

  .topbar-main {
    grid-template-columns: 68px minmax(0, 1fr);
    min-height: 68px;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
  }

  .mode-tabs {
    gap: 8px;
  }

  .browse-panel {
    grid-template-columns: 1fr;
  }

  .result-card {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .result-side {
    grid-column: 2;
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
  }

  .file-toolbar,
  .file-upload,
  .file-row {
    grid-template-columns: 1fr;
  }

  .file-actions {
    flex-wrap: wrap;
  }

  .preview-frame {
    height: 54vh;
    min-height: 320px;
  }

  .image-open-tile {
    grid-template-rows: minmax(220px, 52vh) auto;
    min-height: calc(100vh - 138px);
    padding: 8px;
  }

  .image-open-tile strong {
    font-size: 22px;
  }

  .file-preview-topbar {
    grid-template-columns: 1fr;
    min-height: 118px;
  }

  .file-preview-actions {
    justify-content: start;
  }

  .file-preview-dialog-body {
    height: calc(100vh - 118px);
    padding: 8px;
  }

  .account-box {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Flat cadenside pixel theme: no gradients, chunkier layout blocks. */
:root {
  --black: #120806;
  --void: #2a1713;
  --deep: #4a261f;
  --panel: #fff8df;
  --panel-2: #ffe9b8;
  --brown: #532820;
  --ink: #2a1713;
  --muted: #876d52;
  --gold: #f5a800;
  --gold-2: #f2c04d;
  --gold-3: #fff0b8;
  --cream: #fff8df;
  --line: #3a211b;
  --ok: #007c66;
  --teal: #007c66;
  --teal-2: #00a889;
  --pink: #f1b4cf;
}

body {
  color: var(--ink);
  background: var(--brown);
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 240, 184, .12) 2px, transparent 2px),
    linear-gradient(rgba(255, 240, 184, .12) 2px, transparent 2px);
  background-size: 20px 20px;
  mix-blend-mode: multiply;
  opacity: .28;
}

body::after {
  display: none;
}

.app-shell {
  width: min(100%, 980px);
  background: var(--panel);
  border-inline: 6px solid var(--line);
  box-shadow: 0 0 0 8px var(--gold), 12px 0 0 #120806, -12px 0 0 #120806;
}

.mode-rail {
  background: var(--brown);
  border-right: 8px solid var(--gold);
  box-shadow: inset -4px 0 0 #120806;
}

.rail-button {
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--cream);
  color: var(--line);
  box-shadow: 4px 4px 0 #120806;
  text-shadow: none;
}

.rail-button.active {
  color: var(--line);
  background: var(--gold);
  box-shadow: 4px 4px 0 #120806, inset 0 0 0 4px var(--gold-3);
}

.rail-icon {
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--teal);
  color: #fff8df;
  box-shadow: 2px 2px 0 #120806;
}

.rail-button.active .rail-icon {
  background: var(--teal);
  border-color: var(--line);
  color: #fff8df;
}

.topbar {
  background: var(--cream);
  border-bottom: 8px solid var(--teal);
  box-shadow: inset 0 -4px 0 var(--gold), 0 6px 0 var(--line);
}

.brand-logo {
  border: 4px solid var(--line);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--gold);
  image-rendering: pixelated;
}

h1 {
  color: var(--line);
  text-shadow: 3px 3px 0 var(--gold-2);
}

p,
.browse-panel label,
.result-summary {
  color: var(--muted);
  text-shadow: none;
}

.topbar p {
  color: var(--teal);
}

.icon-button,
.map-tool {
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--cream);
  color: var(--line);
  box-shadow: 4px 4px 0 #120806;
}

.control-panel {
  background: var(--panel-2);
  border-bottom: 6px solid var(--line);
  box-shadow: inset 0 -4px 0 var(--gold);
}

input[type="search"],
select {
  border: 4px solid var(--teal);
  border-radius: 0;
  background: #fffdf4;
  color: var(--line);
  box-shadow: 5px 5px 0 var(--line);
}

input[type="search"]:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 5px 5px 0 var(--line), 0 0 0 4px var(--teal-2);
}

.chip {
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--cream);
  color: var(--line);
  box-shadow: 4px 4px 0 var(--gold);
}

.content {
  background: var(--panel);
}

.result-card {
  border: 4px solid var(--line);
  border-radius: 0;
  background: #fffdf4;
  box-shadow: 6px 6px 0 rgba(83, 40, 32, .9);
}

.result-card::before {
  border-radius: 0;
  background: var(--teal);
}

.result-card:active {
  box-shadow: 3px 3px 0 rgba(83, 40, 32, .9);
}

.model {
  color: var(--line);
  text-shadow: none;
}

.meta {
  color: var(--teal);
}

.dims {
  color: #a15f00;
}

.score-badge,
.verify-badge,
.image-label,
.source-link {
  border: 3px solid var(--line);
  border-radius: 0;
  box-shadow: 3px 3px 0 #120806;
}

.score-badge {
  background: var(--gold-3);
}

.verify-badge {
  background: var(--teal);
  color: #fff8df;
}

.empty {
  border: 4px dashed var(--line);
  background: #fffdf4;
  color: var(--muted);
  box-shadow: inset 0 0 0 4px var(--gold-3);
}

.product-dialog {
  border: 6px solid var(--line);
  border-radius: 0;
  background: var(--cream);
  color: var(--line);
  box-shadow: 10px 10px 0 #120806;
}

.dialog-header {
  border-bottom: 6px solid var(--gold);
  background: var(--brown);
}

.dialog-model {
  color: var(--cream);
  text-shadow: none;
}

.dialog-category {
  color: var(--gold-3);
}

dt {
  color: var(--teal);
}

.image-label {
  background: var(--teal);
  color: #fff8df;
}

.source-link {
  background: var(--gold-3);
  color: var(--line);
}

.product-image {
  border: 4px solid var(--line);
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--gold);
}

.map-frame {
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--cream);
  box-shadow: 6px 6px 0 var(--gold);
}

.map-viewport {
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--brown);
}

/* TeamJoy Carbon Stone theme refresh */
:root {
  color-scheme: light;
  font-family: "Microsoft JhengHei", "Noto Sans TC", "Segoe UI", system-ui, sans-serif;
  --black: #19110d;
  --void: #2b201a;
  --deep: #34251f;
  --panel: #f7f3ea;
  --panel-2: #eee6d8;
  --brown: #3a2a22;
  --ink: #30231d;
  --muted: #8f7f70;
  --gold: #c76f32;
  --gold-2: #e68743;
  --gold-3: #f5d3a8;
  --cream: #fbf8f1;
  --line: #34251f;
  --ok: #73835b;
  --teal: #7b875f;
  --teal-2: #a7b082;
  --pink: #d7c8b6;
  --stone: #958b80;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(251, 248, 241, .96), rgba(238, 230, 216, .96)),
    var(--panel);
}

body::before {
  background:
    linear-gradient(90deg, rgba(52, 37, 31, .035) 1px, transparent 1px),
    linear-gradient(rgba(52, 37, 31, .035) 1px, transparent 1px);
  background-size: 34px 34px;
  mix-blend-mode: multiply;
  opacity: 1;
}

.app-shell {
  width: min(100%, 1040px);
  background: var(--panel);
  border-inline: 1px solid rgba(52, 37, 31, .12);
  box-shadow: 0 24px 70px rgba(43, 32, 26, .2);
}

.mode-rail {
  padding: 18px 9px;
  background: var(--brown);
  border-right: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset -8px 0 0 rgba(0, 0, 0, .12);
  gap: 12px;
}

.rail-button {
  width: 62px;
  min-height: 78px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(251, 248, 241, .08);
  color: #efe6d8;
  box-shadow: none;
  font-weight: 850;
  text-shadow: none;
}

.rail-button.active {
  color: var(--cream);
  background: var(--gold);
  border-color: rgba(255, 255, 255, .24);
  box-shadow: 0 10px 24px rgba(199, 111, 50, .28);
}

.rail-icon,
.rail-button.active .rail-icon {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: rgba(251, 248, 241, .16);
  color: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  font-size: 17px;
}

.topbar {
  grid-template-columns: 86px 1fr auto;
  min-height: 118px;
  gap: 16px;
  padding: 16px 18px;
  background: var(--cream);
  border-bottom: 1px solid rgba(52, 37, 31, .12);
  box-shadow: 0 10px 30px rgba(52, 37, 31, .08);
}

.brand-logo {
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(52, 37, 31, .22);
  image-rendering: auto;
}

h1 {
  color: var(--line);
  font-size: clamp(30px, 6vw, 45px);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: none;
}

p,
.browse-panel label,
.result-summary,
.file-help,
.file-info span,
.image-open-tile small {
  color: var(--muted);
  text-shadow: none;
}

.topbar p {
  color: var(--stone);
  font-weight: 700;
  letter-spacing: .08em;
}

.icon-button,
.map-tool,
.file-action {
  border: 1px solid rgba(52, 37, 31, .14);
  border-radius: 8px;
  background: var(--cream);
  color: var(--line);
  box-shadow: 0 8px 18px rgba(52, 37, 31, .12);
}

.control-panel,
.file-panel,
.map-panel,
.content {
  background: var(--panel);
}

.control-panel {
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(52, 37, 31, .1);
  box-shadow: none;
}

input[type="search"],
select,
.file-search input,
.file-upload select,
.file-picker input {
  min-height: 56px;
  border: 1px solid rgba(52, 37, 31, .18);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 8px 20px rgba(52, 37, 31, .08);
}

input[type="search"]:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(199, 111, 50, .18), 0 10px 24px rgba(52, 37, 31, .1);
}

.chip,
.file-category,
.file-row,
.result-card,
.file-upload,
.file-preview,
.image-open-tile,
.empty {
  border: 1px solid rgba(52, 37, 31, .14);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 12px 28px rgba(52, 37, 31, .1);
}

.chip {
  color: var(--line);
  background: var(--cream);
  font-weight: 750;
}

.result-card {
  grid-template-columns: 7px minmax(0, 1fr) auto;
}

.result-card::before {
  border-radius: 8px 0 0 8px;
  background: var(--gold);
}

.result-card:active,
.file-action:active,
.image-open-tile:active,
.icon-button:active {
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(52, 37, 31, .12);
}

.model,
.file-info strong,
.image-open-tile strong {
  color: var(--line);
  text-shadow: none;
}

.meta,
dt,
.file-category strong,
.topbar p {
  color: var(--teal);
}

.dims {
  color: var(--gold);
}

.score-badge,
.verify-badge,
.image-label,
.source-link,
.file-type {
  border: 0;
  border-radius: 7px;
  box-shadow: none;
}

.score-badge,
.image-label,
.file-action.preview {
  background: #f2ddc7;
  color: var(--line);
}

.verify-badge,
.file-action.primary,
.file-type {
  background: var(--teal);
  color: var(--cream);
}

.source-link,
.file-action {
  background: var(--cream);
  color: var(--line);
}

.empty {
  border-style: dashed;
  color: var(--muted);
}

.product-dialog,
.file-preview-dialog {
  border: 1px solid rgba(52, 37, 31, .16);
  border-radius: 10px;
  background: var(--cream);
  color: var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

.product-dialog::backdrop,
.file-preview-dialog::backdrop {
  background: rgba(25, 17, 13, .72);
}

.dialog-header,
.file-preview-topbar {
  background: var(--brown);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  box-shadow: none;
}

.dialog-model,
.file-preview-topbar strong {
  color: var(--cream);
  text-shadow: none;
}

.dialog-category {
  color: var(--gold-3);
}

.product-image,
.preview-image,
.preview-frame,
.fullscreen-preview-frame,
.fullscreen-preview-text,
.fullscreen-preview-viewport,
.image-open-tile img {
  border: 1px solid rgba(52, 37, 31, .14);
  border-radius: 8px;
  box-shadow: none;
}

.fullscreen-preview-viewport,
.fullscreen-preview-frame {
  background: #f4efe6;
}

.file-toolbar h2 {
  color: var(--line);
  text-shadow: none;
  letter-spacing: .04em;
}

.file-category.active {
  background: var(--brown);
  color: var(--cream);
  box-shadow: 0 12px 28px rgba(52, 37, 31, .22);
}

.file-category.active strong {
  color: var(--gold-3);
}

.file-upload {
  background: var(--panel-2);
}

.image-open-tile {
  min-height: calc(100vh - 170px);
  padding: 12px;
  text-align: left;
}

.image-open-tile img {
  background: #eee6d8;
}

.file-preview-dialog {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

@media (max-width: 480px) {
  .app-shell {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .mode-rail {
    padding: 10px 6px;
  }

  .rail-button {
    width: 56px;
    min-height: 74px;
  }

  .topbar {
    grid-template-columns: 66px 1fr auto;
    min-height: 104px;
    padding: 12px 10px;
  }

  .brand-logo {
    width: 62px;
    height: 62px;
    border-radius: 15px;
  }

  h1 {
    font-size: 30px;
    letter-spacing: .02em;
  }
}

/* Gentle editorial refresh: clean, calm, same Carbon Stone palette. */
:root {
  --paper: #fbf8f1;
  --paper-soft: #f5efe6;
  --paper-warm: #efe6d8;
  --coffee: #34251f;
  --coffee-soft: #59483f;
  --clay: #c76f32;
  --clay-soft: #e9b487;
  --leaf: #7b875f;
  --leaf-soft: #dbe0c9;
  --stone: #958b80;
  --hairline: rgba(52, 37, 31, .11);
  --shadow-soft: 0 10px 26px rgba(52, 37, 31, .075);
  --shadow-lift: 0 16px 36px rgba(52, 37, 31, .11);
}

body {
  background:
    radial-gradient(circle at 22% 8%, rgba(233, 180, 135, .2), transparent 28%),
    linear-gradient(180deg, #fffdf8 0%, var(--paper-soft) 100%);
}

body::before {
  opacity: .38;
  background-image:
    linear-gradient(90deg, rgba(52, 37, 31, .025) 1px, transparent 1px),
    linear-gradient(rgba(52, 37, 31, .025) 1px, transparent 1px);
  background-size: 42px 42px;
}

.app-shell {
  background: rgba(251, 248, 241, .94);
  border-inline: 1px solid rgba(52, 37, 31, .08);
  box-shadow: 0 18px 58px rgba(52, 37, 31, .13);
}

.mode-rail {
  background: linear-gradient(180deg, #3a2a22, #2f231e);
  border-right: 1px solid rgba(52, 37, 31, .08);
  box-shadow: 6px 0 22px rgba(52, 37, 31, .12);
}

.rail-button {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: transparent;
  color: rgba(251, 248, 241, .76);
  min-height: 74px;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.rail-button.active {
  background: rgba(251, 248, 241, .13);
  color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(251, 248, 241, .16);
}

.rail-button:active {
  transform: scale(.98);
}

.rail-icon,
.rail-button.active .rail-icon {
  border-radius: 10px;
  background: rgba(251, 248, 241, .12);
  box-shadow: none;
}

.topbar {
  background: rgba(251, 248, 241, .96);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 8px 22px rgba(52, 37, 31, .055);
}

.brand-logo {
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(52, 37, 31, .14);
}

h1 {
  color: var(--coffee);
  font-weight: 720;
  letter-spacing: .04em;
  text-transform: none;
}

.topbar p,
.result-summary,
p {
  color: var(--stone);
  font-weight: 650;
  letter-spacing: .03em;
}

.control-panel {
  background: rgba(245, 239, 230, .72);
  border-bottom: 1px solid var(--hairline);
}

input[type="search"],
select,
.file-search input,
.file-upload select,
.file-picker input {
  border: 1px solid rgba(52, 37, 31, .13);
  border-radius: 12px;
  background: rgba(255, 253, 248, .95);
  box-shadow: 0 8px 18px rgba(52, 37, 31, .055);
  font-weight: 700;
}

input[type="search"]:focus,
select:focus {
  border-color: rgba(199, 111, 50, .58);
  box-shadow: 0 0 0 4px rgba(199, 111, 50, .12), var(--shadow-soft);
}

.chips {
  gap: 9px;
}

.chip,
.file-action,
.icon-button,
.map-tool {
  border: 1px solid rgba(52, 37, 31, .12);
  border-radius: 999px;
  background: rgba(255, 253, 248, .86);
  box-shadow: 0 8px 18px rgba(52, 37, 31, .055);
  color: var(--coffee);
}

.result-card,
.file-row,
.file-category,
.file-upload,
.file-preview,
.image-open-tile,
.empty {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255, 253, 248, .9);
  box-shadow: var(--shadow-soft);
}

.result-card {
  grid-template-columns: 5px minmax(0, 1fr) auto;
  transition: transform .16s ease, box-shadow .16s ease;
}

.result-card::before {
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, var(--clay), var(--leaf));
}

.result-card:hover,
.file-row:hover,
.file-category:hover,
.image-open-tile:hover {
  box-shadow: var(--shadow-lift);
}

.model,
.file-info strong,
.image-open-tile strong,
.file-toolbar h2 {
  color: var(--coffee);
  font-weight: 780;
}

#fileLibraryStatus,
.file-search {
  display: none;
}

body.engineer-mode #fileLibraryStatus {
  display: block;
  margin: 4px 0 0;
  color: var(--clay);
  font-size: 12px;
}

.meta,
dt,
.file-category strong {
  color: var(--leaf);
}

.dims {
  color: var(--clay);
}

.score-badge,
.image-label,
.file-action.preview {
  background: #f4e5d6;
  color: #6d442d;
}

.verify-badge,
.file-action.primary,
.file-type {
  background: var(--leaf-soft);
  color: #445033;
}

.file-category.active {
  background: var(--coffee);
  color: var(--paper);
  box-shadow: var(--shadow-lift);
}

.file-upload,
.file-panel,
.map-panel,
.content {
  background: transparent;
}

.product-dialog,
.file-preview-dialog {
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 24px 66px rgba(25, 17, 13, .26);
}

.dialog-header,
.file-preview-topbar {
  background: #3a2a22;
}

.product-image,
.preview-image,
.preview-frame,
.fullscreen-preview-frame,
.fullscreen-preview-text,
.fullscreen-preview-viewport,
.image-open-tile img {
  border-radius: 12px;
  border-color: rgba(52, 37, 31, .1);
}

.image-open-tile {
  gap: 12px;
  background: rgba(255, 253, 248, .82);
}

.image-open-tile span {
  padding: 12px 2px 0;
}

.file-preview-dialog {
  border-radius: 0;
}

@media (max-width: 480px) {
  .topbar {
    min-height: 102px;
  }

  .brand-logo {
    border-radius: 18px;
  }

  h1 {
    font-size: 29px;
  }

  .result-card,
  .file-row,
  .file-category,
  .file-upload,
  .image-open-tile {
    border-radius: 12px;
  }
}

/* Header cleanup: quieter title and search-local clear button. */
#dataStatus {
  display: none;
}

.topbar {
  grid-template-columns: 86px minmax(0, 1fr);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
}

.search-clear {
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  font-size: 28px;
  line-height: 1;
}

@media (max-width: 480px) {
  .topbar {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .search-clear {
    width: 48px;
    height: 48px;
    min-height: 48px;
  }
}

/* Product cards: keep only product information, no status tags. */
.result-card {
  grid-template-columns: 5px minmax(0, 1fr);
}

.result-side,
.score-badge,
.verify-badge {
  display: none;
}

/* Data area expansion: boards and folder tools. */
.board-panel,
.folder-tools {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255, 253, 248, .9);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  margin-bottom: 16px;
}

.board-toolbar,
.folder-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.board-toolbar {
  margin-bottom: 12px;
}

.board-toolbar label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.board-toolbar input[type="color"] {
  width: 42px;
  height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--paper);
}

.board-editor {
  min-height: 320px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--coffee);
  line-height: 1.8;
  outline: none;
  overflow-wrap: anywhere;
}

.board-editor:focus {
  border-color: rgba(199, 111, 50, .58);
  box-shadow: 0 0 0 4px rgba(199, 111, 50, .12);
}

.board-updated {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.board-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  margin: 0;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}

.board-fullscreen .board-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 12px;
  background: var(--paper);
}

.board-fullscreen .board-editor {
  min-height: 0;
  height: 100%;
  overflow: auto;
  font-size: 18px;
}

.engineer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(199, 111, 50, .28);
  border-radius: 16px;
  background: #fff6eb;
  color: var(--coffee);
  box-shadow: var(--shadow-soft);
}

.users-panel {
  display: grid;
  gap: 14px;
}

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

.account-summary div {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
}

.account-summary strong {
  font-size: 24px;
  line-height: 1;
}

.account-summary span {
  color: var(--stone);
  font-size: 12px;
}

.engineer-users {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
}

.engineer-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(52, 37, 31, .08);
}

.engineer-user-row:last-child {
  border-bottom: 0;
}

.engineer-user-row span,
.engineer-user-row strong,
.engineer-user-row em {
  display: block;
  min-width: 0;
}

.engineer-user-row em {
  color: var(--stone);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.account-meta b {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.engineer-user-actions {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.permission-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-chip {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(52, 37, 31, .12);
  border-radius: 999px;
  background: #f6efe6;
  color: var(--coffee);
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.permission-chip.active {
  border-color: rgba(122, 87, 59, .38);
  background: #7a573b;
  color: #fff8f0;
}

.permission-chip.reset-access {
  background: #fff7ef;
}

.permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notification-tray {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.notification-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(199, 111, 50, .28);
  border-radius: 16px;
  background: #fff6eb;
  box-shadow: var(--shadow-soft);
}

.notification-card span {
  color: var(--stone);
  overflow-wrap: anywhere;
}

.notification-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.engineer-panel strong,
.engineer-panel span {
  display: block;
}

.engineer-panel strong {
  margin-bottom: 2px;
}

.engineer-panel span {
  color: var(--stone);
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.engineer-dialog {
  width: min(92vw, 360px);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--paper);
  color: var(--coffee);
  box-shadow: 0 24px 66px rgba(25, 17, 13, .26);
}

.engineer-dialog::backdrop {
  background: rgba(25, 17, 13, .62);
}

.engineer-dialog form {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
}

.engineer-dialog strong {
  font-size: 22px;
}

.engineer-dialog p {
  margin: 0;
}

.engineer-dialog input {
  min-height: 48px;
  border: 1px solid rgba(52, 37, 31, .13);
  border-radius: 12px;
  background: rgba(255, 253, 248, .95);
  color: var(--coffee);
  padding: 8px 12px;
  font-size: 20px;
  letter-spacing: .18em;
}

.engineer-message {
  min-height: 18px;
  color: var(--clay);
  font-size: 13px;
}

.engineer-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.folder-tools input {
  min-height: 42px;
  flex: 1 1 190px;
  border: 1px solid rgba(52, 37, 31, .13);
  border-radius: 12px;
  background: rgba(255, 253, 248, .95);
  color: var(--line);
  padding: 8px 12px;
}

.file-action.rename {
  background: var(--leaf-soft);
  color: #445033;
}

.quality-panel {
  padding: 18px;
}

.quality-tool {
  display: grid;
  gap: 16px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.quality-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quality-tool-head div {
  display: grid;
  gap: 4px;
}

.quality-tool-head strong {
  color: var(--coffee);
  font-size: 20px;
  font-weight: 850;
}

.quality-tool-head span,
.pressure-reference span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pressure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pressure-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pressure-field span {
  color: var(--coffee-soft);
  font-size: 13px;
  font-weight: 850;
}

.pressure-field input {
  width: 100%;
  min-height: 64px;
  border: 1px solid rgba(52, 37, 31, .13);
  border-radius: 14px;
  background: rgba(251, 248, 241, .92);
  color: var(--coffee);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62);
  padding: 12px 14px;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0;
}

.pressure-field input:focus {
  outline: none;
  border-color: rgba(199, 111, 50, .58);
  box-shadow: 0 0 0 4px rgba(199, 111, 50, .12), var(--shadow-soft);
}

.pressure-reference {
  display: grid;
  gap: 6px;
  border-left: 4px solid var(--clay);
  border-radius: 12px;
  background: rgba(245, 239, 230, .72);
  padding: 12px 14px;
}

.quality-records {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.quality-record-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
}

.quality-record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quality-record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.quality-record-list {
  display: grid;
  gap: 12px;
}

.quality-record-filter {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 2px;
}

.quality-month-field {
  min-width: 220px;
}

.quality-month-field select {
  appearance: none;
}

.quality-sub-tabs {
  margin: 14px 0 16px;
  align-items: center;
}

.sub-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.sub-tabs-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-right: 4px;
}

.sub-tabs::-webkit-scrollbar {
  height: 6px;
}

.sub-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(42, 55, 61, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.sub-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.quality-sub-pane {
  display: grid;
  gap: 16px;
}

.quality-source-panel {
  display: grid;
  gap: 14px;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid rgba(42, 55, 61, 0.08);
}

.quality-source-path {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.quality-source-list {
  display: grid;
  gap: 10px;
}

.quality-source-summary-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.quality-source-summary-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(42, 55, 61, 0.08);
}

.quality-source-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.quality-source-summary-head strong {
  font-size: 16px;
}

.quality-source-summary-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-source-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quality-month-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(42, 55, 61, 0.08);
  background: rgba(242, 248, 249, 0.98);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.quality-month-chip.empty {
  color: var(--muted);
}

.quality-source-summary-foot {
  display: flex;
  justify-content: flex-end;
}

.quality-source-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(42, 55, 61, 0.08);
}

.quality-source-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(47, 104, 114, 0.12);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.quality-source-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quality-source-info strong {
  font-size: 15px;
}

.quality-source-info span {
  color: var(--muted);
  font-size: 13px;
}

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

@media (max-width: 720px) {
  .quality-source-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .quality-source-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.quality-record-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
}

.quality-record-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  flex-wrap: wrap;
}

.quality-record-title {
  display: grid;
  gap: 4px;
}

.quality-record-title strong {
  color: var(--coffee);
  font-size: 19px;
  font-weight: 850;
}

.quality-record-title span,
.quality-record-results span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quality-record-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quality-record-results div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(245, 239, 230, .72);
}

.quality-record-results strong {
  color: var(--coffee);
  font-size: 22px;
  line-height: 1;
}

body.engineer-mode .quality-tool,
body.engineer-mode .pressure-field input,
body.engineer-mode .pressure-reference,
body.engineer-mode .quality-record-form,
body.engineer-mode .quality-record-card,
body.engineer-mode .quality-record-results div {
  background: rgba(4, 18, 27, .72);
}

body.engineer-mode .quality-tool-head strong,
body.engineer-mode .pressure-field span,
body.engineer-mode .pressure-field input,
body.engineer-mode .quality-record-title strong,
body.engineer-mode .quality-record-results strong {
  color: var(--coffee);
}

@media (max-width: 480px) {
  .board-toolbar,
  .folder-tools {
    align-items: stretch;
  }

  .board-toolbar .file-action,
  .folder-tools .file-action,
  .folder-tools input {
    flex: 1 1 100%;
  }

  .board-editor {
    min-height: 260px;
  }

  .engineer-panel {
    grid-template-columns: 1fr;
  }

  .engineer-actions {
    justify-content: stretch;
  }

  .engineer-actions .file-action,
  .engineer-user-row .file-action {
    flex: 1 1 100%;
  }

  .engineer-user-row {
    grid-template-columns: 1fr;
  }

  .account-summary {
    grid-template-columns: 1fr;
  }

  .board-fullscreen {
    padding: 10px;
  }

  .board-fullscreen .board-editor {
    font-size: 16px;
  }

  .quality-panel {
    padding: 12px;
  }

  .quality-tool-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pressure-grid,
  .quality-record-grid,
  .quality-record-results {
    grid-template-columns: 1fr;
  }
}

/* File library list mode: closer to a mobile file manager. */
.file-categories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
}

.file-category {
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(52, 37, 31, .09);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--coffee);
  text-align: left;
}

.file-category:last-child {
  border-bottom: 0;
}

.file-category:hover,
.file-category.active {
  background: rgba(244, 229, 214, .62);
  box-shadow: none;
  color: var(--coffee);
}

.file-category.active {
  border-left: 5px solid var(--clay);
  padding-left: 9px;
}

.file-category-icon,
.file-type {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--leaf-soft);
  color: #445033;
  font-size: 14px;
  font-weight: 900;
}

.file-category-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.file-category-main > span,
.file-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-category-main em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.file-category strong {
  justify-self: end;
  min-width: 52px;
  color: var(--clay);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.file-upload {
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  box-shadow: none;
}

.file-help {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.file-list {
  display: block;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
}

.file-row {
  min-height: 68px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(52, 37, 31, .09);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover,
.file-row:focus-visible {
  background: rgba(244, 229, 214, .58);
  box-shadow: none;
  outline: none;
}

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

.file-info span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.file-actions .file-action {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 13px;
  white-space: nowrap;
}

.folder-tools {
  box-shadow: none;
}

@media (max-width: 600px) {
  .file-toolbar {
    margin-bottom: 10px;
  }

  .file-upload {
    grid-template-columns: 1fr;
  }

  .file-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .file-type,
  .file-category-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 12px;
  }

  .file-actions {
    grid-column: 2;
    justify-self: start;
    margin-top: 3px;
  }
}

/* Engineering mode: separate sci-fi maintenance console skin. */
.engineer-login-icon {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border: 1px solid rgba(0, 234, 255, .42);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255, 122, 24, .22),
    0 0 26px rgba(0, 204, 255, .28);
}

body.engineer-mode {
  color-scheme: dark;
  --paper: #061017;
  --paper-soft: #081923;
  --paper-warm: #102631;
  --ink: #e9fbff;
  --coffee: #e9fbff;
  --brown: #04080d;
  --deep: #07131d;
  --line: #00d8ff;
  --hairline: rgba(0, 216, 255, .34);
  --clay: #ff7a18;
  --clay-dark: #ff9d28;
  --gold: #7cff7b;
  --leaf: #49ff8f;
  --leaf-soft: rgba(73, 255, 143, .14);
  --stone: #8fefff;
  --muted: #86a7b5;
  --shadow-soft: 0 0 0 1px rgba(0, 216, 255, .18), 0 18px 48px rgba(0, 0, 0, .52);
  background:
    radial-gradient(circle at 50% 8%, rgba(73, 255, 143, .24), transparent 26%),
    radial-gradient(circle at 82% 26%, rgba(255, 122, 24, .18), transparent 24%),
    linear-gradient(180deg, #02060b 0%, #07131d 54%, #02060b 100%);
}

body.engineer-mode::before {
  opacity: .9;
  background-image:
    linear-gradient(90deg, rgba(0, 216, 255, .13) 1px, transparent 1px),
    linear-gradient(rgba(0, 216, 255, .1) 1px, transparent 1px),
    linear-gradient(135deg, transparent 0 22px, rgba(255, 122, 24, .18) 23px, transparent 24px),
    linear-gradient(45deg, transparent 0 34px, rgba(73, 255, 143, .16) 35px, transparent 36px);
  background-size: 26px 26px, 26px 26px, 130px 130px, 170px 170px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .26));
}

body.engineer-mode::after {
  display: block;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0 48%, rgba(0, 216, 255, .15) 49%, transparent 50%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  opacity: .34;
}

body.engineer-mode .app-shell {
  background: rgba(2, 8, 13, .82);
  border: 1px solid rgba(0, 216, 255, .36);
  box-shadow:
    0 0 0 1px rgba(73, 255, 143, .12),
    0 0 34px rgba(0, 216, 255, .24),
    inset 0 0 38px rgba(0, 216, 255, .08);
}

body.engineer-mode .rail-button {
  background: rgba(4, 18, 27, .95);
  border: 1px solid rgba(0, 216, 255, .3);
  color: #9eeeff;
  box-shadow: inset 0 0 16px rgba(0, 216, 255, .08);
}

body.engineer-mode .rail-button.active,
body.engineer-mode .rail-button:hover {
  background: rgba(0, 216, 255, .14);
  border-color: rgba(73, 255, 143, .72);
  color: #f4ffff;
  box-shadow:
    0 0 22px rgba(0, 216, 255, .34),
    inset 0 0 22px rgba(73, 255, 143, .12);
}

body.engineer-mode .rail-icon {
  background: #07131d;
  border-color: rgba(73, 255, 143, .58);
  color: #7cff7b;
  text-shadow: 0 0 10px rgba(73, 255, 143, .75);
}

body.engineer-mode .topbar,
body.engineer-mode .control-panel,
body.engineer-mode .browse-panel,
body.engineer-mode .map-panel,
body.engineer-mode .color-panel,
body.engineer-mode .files-panel,
body.engineer-mode .users-panel,
body.engineer-mode .content,
body.engineer-mode .engineer-panel,
body.engineer-mode .file-categories,
body.engineer-mode .file-list,
body.engineer-mode .folder-tools,
body.engineer-mode .board-panel {
  background:
    linear-gradient(180deg, rgba(6, 22, 33, .94), rgba(3, 10, 16, .94)),
    repeating-linear-gradient(90deg, rgba(0, 216, 255, .09) 0 1px, transparent 1px 18px);
  border: 1px solid rgba(0, 216, 255, .36);
  box-shadow: var(--shadow-soft), inset 0 0 24px rgba(0, 216, 255, .06);
}

body.engineer-mode .topbar {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(73, 255, 143, .45);
}

body.engineer-mode .brand-logo {
  border-radius: 18px;
  border: 1px solid rgba(0, 216, 255, .7);
  background: #02060b;
  object-fit: cover;
  box-shadow:
    0 0 0 2px rgba(73, 255, 143, .18),
    0 0 28px rgba(0, 216, 255, .5);
}

body.engineer-mode h2,
body.engineer-mode .section-title {
  color: #f4ffff;
  text-shadow: 0 0 18px rgba(0, 216, 255, .38);
}

body.engineer-mode #hint,
body.engineer-mode .muted,
body.engineer-mode .file-info span,
body.engineer-mode .file-category-main em {
  color: #86cfe0;
}

body.engineer-mode input,
body.engineer-mode select,
body.engineer-mode textarea,
body.engineer-mode .board-editor {
  background: rgba(1, 8, 13, .9);
  border: 1px solid rgba(0, 216, 255, .38);
  color: #ecfdff;
  box-shadow: inset 0 0 18px rgba(0, 216, 255, .08);
}

body.engineer-mode input:focus,
body.engineer-mode select:focus,
body.engineer-mode textarea:focus,
body.engineer-mode .board-editor:focus {
  border-color: rgba(73, 255, 143, .85);
  box-shadow:
    0 0 0 3px rgba(73, 255, 143, .12),
    0 0 22px rgba(0, 216, 255, .28),
    inset 0 0 18px rgba(0, 216, 255, .1);
}

body.engineer-mode .chip,
body.engineer-mode .file-action,
body.engineer-mode .map-tool,
body.engineer-mode .icon-button {
  background: rgba(7, 19, 29, .96);
  border: 1px solid rgba(0, 216, 255, .42);
  color: #eaffff;
  box-shadow: 0 0 16px rgba(0, 216, 255, .14);
}

body.engineer-mode .file-action.primary,
body.engineer-mode .chip:hover,
body.engineer-mode .map-tool:hover,
body.engineer-mode .icon-button:hover {
  background: rgba(0, 216, 255, .16);
  border-color: rgba(73, 255, 143, .7);
  color: #ffffff;
}

body.engineer-mode .file-action.danger {
  border-color: rgba(255, 122, 24, .75);
  color: #ffd0a8;
}

body.engineer-mode .file-category,
body.engineer-mode .file-row,
body.engineer-mode .engineer-user-row,
body.engineer-mode .account-summary div,
body.engineer-mode .result-card {
  background: rgba(4, 16, 24, .72);
  border-color: rgba(0, 216, 255, .25);
  color: #e9fbff;
}

body.engineer-mode .file-category:hover,
body.engineer-mode .file-category.active,
body.engineer-mode .file-row:hover,
body.engineer-mode .file-row:focus-visible,
body.engineer-mode .result-card:hover {
  background: rgba(0, 216, 255, .13);
  box-shadow: inset 4px 0 0 #49ff8f, 0 0 18px rgba(0, 216, 255, .16);
}

body.engineer-mode .file-category-icon,
body.engineer-mode .file-type {
  background: rgba(73, 255, 143, .13);
  border: 1px solid rgba(73, 255, 143, .42);
  color: #91ff9d;
}

body.engineer-mode .engineer-panel {
  color: #ecfdff;
  border-color: rgba(73, 255, 143, .55);
  box-shadow:
    0 0 0 1px rgba(73, 255, 143, .14),
    0 0 28px rgba(73, 255, 143, .12),
    inset 0 0 28px rgba(73, 255, 143, .06);
}

body.engineer-mode .engineer-panel strong::before {
  content: "SYS ";
  color: #49ff8f;
  font-family: Consolas, "Cascadia Mono", monospace;
}

body.engineer-mode .engineer-panel span,
body.engineer-mode .engineer-message {
  color: #8fefff;
}

body.engineer-mode .engineer-dialog {
  background:
    linear-gradient(180deg, rgba(5, 17, 26, .98), rgba(2, 8, 13, .98)),
    repeating-linear-gradient(90deg, rgba(0, 216, 255, .08) 0 1px, transparent 1px 20px);
  border: 1px solid rgba(0, 216, 255, .52);
  color: #e9fbff;
  box-shadow:
    0 0 0 1px rgba(73, 255, 143, .18),
    0 0 44px rgba(0, 216, 255, .38),
    inset 0 0 28px rgba(0, 216, 255, .08);
}

body.engineer-mode .engineer-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 35%, rgba(0, 216, 255, .18), transparent 35%),
    rgba(0, 0, 0, .78);
}

body.engineer-mode .file-preview-topbar,
body.engineer-mode .dialog-header {
  background: #06131d;
  border-bottom: 1px solid rgba(0, 216, 255, .38);
}

body.engineer-mode .crop-dialog {
  background:
    linear-gradient(180deg, rgba(6, 22, 33, .98), rgba(3, 10, 16, .98)),
    repeating-linear-gradient(90deg, rgba(0, 216, 255, .09) 0 1px, transparent 1px 18px);
  border-color: rgba(0, 216, 255, .36);
  color: #e9fbff;
}

body.engineer-mode .crop-stage {
  border-color: rgba(0, 216, 255, .3);
  background: rgba(4, 16, 24, .72);
}

body.engineer-mode .crop-status {
  color: #9eeeff;
}

body.engineer-mode .crop-selection {
  border-color: #49ff8f;
  background: rgba(73, 255, 143, .16);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .34), 0 0 18px rgba(73, 255, 143, .36);
}

body.engineer-mode .empty {
  background: rgba(0, 216, 255, .08);
  border-color: rgba(0, 216, 255, .34);
  color: #9eeeff;
}

@media (max-width: 700px) {
}

/* Account login entrance. */
.account-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-box span {
  flex: 1 1 100%;
  color: var(--stone);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.account-box .file-action {
  min-height: 34px;
  padding: 6px 12px;
  box-shadow: none;
  white-space: nowrap;
}

.account-dialog,
.security-gate-dialog {
  width: min(92vw, 390px);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 0;
  background: var(--paper);
  color: var(--coffee);
  box-shadow: 0 24px 66px rgba(25, 17, 13, .26);
}

.security-gate-dialog {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  right: auto;
  bottom: auto;
  margin: 0;
  transform: translateX(-50%);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px);
  overflow: auto;
  z-index: 2147483647;
}

.account-dialog::backdrop,
.security-gate-dialog::backdrop {
  background: rgba(25, 17, 13, .62);
}

.account-dialog form,
.security-gate-dialog form {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
}

.account-login-logo {
  justify-self: center;
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(52, 37, 31, .14);
}

.account-dialog strong,
.security-gate-dialog strong {
  font-size: 22px;
}

.account-dialog p,
.security-gate-dialog p {
  margin: 0;
}

.security-gate-bind {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255, 253, 248, .84);
}

.security-gate-bind-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.security-gate-hint {
  color: var(--stone);
  font-size: 13px;
  line-height: 1.5;
}

.security-gate-qr-wrap {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.security-gate-qr {
  width: 220px;
  height: 220px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #fff;
  object-fit: cover;
}

.security-gate-bind-meta {
  display: grid;
  gap: 4px;
  width: 100%;
  color: var(--stone);
}

.security-gate-bind-meta small {
  word-break: break-all;
  line-height: 1.45;
}

.security-gate-details {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .6);
}

.security-gate-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--coffee);
}

.security-gate-details ol {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--stone);
  line-height: 1.5;
}

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255, 253, 248, .72);
}

.account-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--stone);
  font-weight: 900;
}

.account-tabs button.active {
  background: var(--leaf-soft);
  color: #445033;
}

.account-dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.account-dialog small {
  color: var(--stone);
  line-height: 1.45;
}

.account-dialog input[type="text"],
.account-dialog input[type="password"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(52, 37, 31, .13);
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(255, 253, 248, .94);
  color: var(--coffee);
  outline: none;
}

.remember-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.remember-row input {
  width: 18px;
  height: 18px;
}

body.engineer-mode .account-dialog {
  background:
    linear-gradient(180deg, rgba(5, 17, 26, .98), rgba(2, 8, 13, .98)),
    repeating-linear-gradient(90deg, rgba(0, 216, 255, .08) 0 1px, transparent 1px 20px);
  border: 1px solid rgba(0, 216, 255, .52);
  color: #e9fbff;
}

body.engineer-mode .account-tabs,
body.engineer-mode .account-dialog input[type="text"],
body.engineer-mode .account-dialog input[type="password"] {
  background: rgba(1, 8, 13, .9);
  border-color: rgba(0, 216, 255, .38);
  color: #ecfdff;
}

body.engineer-mode .account-tabs button.active {
  background: rgba(0, 216, 255, .16);
  color: #ffffff;
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .account-box {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .account-box span {
    flex: 0 1 auto;
    text-align: left;
  }
}

.purchase-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.purchase-form {
  display: grid;
  gap: 14px;
}

.purchase-toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.purchase-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 3px solid var(--line);
  background: rgba(18, 6, 3, .86);
  box-shadow: 6px 6px 0 #000;
}

.purchase-grid,
.purchase-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.purchase-section-head,
.purchase-item-head,
.purchase-actions,
.purchase-output {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.purchase-card label,
.purchase-cell {
  display: grid;
  gap: 6px;
}

.purchase-card span,
.purchase-cell span,
.purchase-section-head span {
  color: var(--gold-3);
  font-size: 13px;
  font-weight: 900;
}

.purchase-card input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 3px solid var(--line);
  background: #fff7de;
  color: #2b0d03;
}

.purchase-items {
  display: grid;
  gap: 12px;
}

.purchase-item-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--gold);
  background: rgba(255, 242, 197, .08);
}

.purchase-output {
  align-items: flex-start;
}

.purchase-output p {
  margin: 0;
}

@media (max-width: 760px) {
  .purchase-grid,
  .purchase-item-grid {
    grid-template-columns: 1fr;
  }
}

.app-shell {
  display: block;
  width: min(100%, 1240px);
}

.topbar {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.topbar-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
}

.mode-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.mode-tabs .rail-button {
  min-width: 92px;
  min-height: 54px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.mode-tabs .rail-icon {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

body.engineer-mode .topbar {
  gap: 14px;
  border-bottom: 1px solid rgba(73, 255, 143, .45);
  box-shadow:
    0 0 0 1px rgba(73, 255, 143, .14),
    0 0 24px rgba(0, 216, 255, .18),
    inset 0 0 24px rgba(0, 216, 255, .06);
}

body.engineer-mode .topbar-main {
  grid-template-columns: 92px minmax(0, 1fr) auto;
  min-height: 92px;
}

body.engineer-mode .mode-tabs {
  gap: 10px;
}

body.engineer-mode .mode-tabs .rail-button {
  background: rgba(4, 18, 27, .96);
  border: 1px solid rgba(0, 216, 255, .34);
  color: #bdf8ff;
  box-shadow:
    inset 0 0 16px rgba(0, 216, 255, .08),
    0 0 0 1px rgba(73, 255, 143, .06);
}

body.engineer-mode .mode-tabs .rail-button.active,
body.engineer-mode .mode-tabs .rail-button:hover {
  background: linear-gradient(180deg, rgba(0, 216, 255, .2), rgba(4, 18, 27, .98));
  border-color: rgba(73, 255, 143, .82);
  color: #ffffff;
  box-shadow:
    0 0 20px rgba(0, 216, 255, .28),
    inset 0 0 18px rgba(73, 255, 143, .12);
}

body.engineer-mode .mode-tabs .rail-icon {
  background: #07131d;
  border-color: rgba(73, 255, 143, .58);
  color: #7cff7b;
  text-shadow: 0 0 10px rgba(73, 255, 143, .75);
}

body.engineer-mode .account-box span {
  color: #86cfe0;
}

body.engineer-mode .account-box .file-action {
  background: rgba(7, 19, 29, .96);
  border: 1px solid rgba(0, 216, 255, .42);
  color: #eaffff;
  box-shadow: 0 0 16px rgba(0, 216, 255, .14);
}

@media (max-width: 760px) {
  .topbar-main {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .account-box {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  body.engineer-mode .topbar-main {
    grid-template-columns: 68px minmax(0, 1fr);
  }
}

.hidden {
  display: none !important;
}

/* Final top navigation art direction override */
.app-shell .topbar {
  padding: 18px 18px 14px !important;
  background:
    radial-gradient(circle at 14% 16%, rgba(214, 140, 74, .12), transparent 26%),
    linear-gradient(180deg, #2b1812, #1a0f0c 72%, #160c09) !important;
  border-bottom: 1px solid rgba(222, 185, 146, .18) !important;
  box-shadow:
    inset 0 -1px 0 rgba(255, 240, 214, .06),
    0 18px 34px rgba(0, 0, 0, .22) !important;
  position: relative !important;
}

.app-shell .topbar-main {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 58px !important;
  padding-right: 240px !important;
}

.app-shell .topbar-account-slot {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  max-width: calc(100% - 36px);
}

.app-shell .topbar-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 58px;
}

.app-shell .topbar-meta p,
.app-shell #dataStatus {
  margin: 0 !important;
  color: #cfb8a4 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: .01em !important;
}

.app-shell .brand-logo {
  width: 58px !important;
  height: 58px !important;
  border: 1px solid rgba(222, 185, 146, .28) !important;
  border-radius: 8px !important;
  background: rgba(255, 248, 239, .94) !important;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, .18),
    inset 0 0 0 1px rgba(255, 255, 255, .42) !important;
  image-rendering: auto !important;
}

.app-shell .mode-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  width: calc(100% - 72px) !important;
  margin-left: 72px !important;
  padding: 8px 8px 2px 0 !important;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  align-items: center;
}

.app-shell .mode-tabs::-webkit-scrollbar {
  display: none;
}

.app-shell .mode-tabs .rail-button {
  flex: 0 0 auto !important;
  min-width: 104px !important;
  min-height: 46px !important;
  padding: 0 15px !important;
  border: 1px solid rgba(222, 185, 146, .18) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(255, 249, 242, .92), rgba(243, 228, 210, .84)) !important;
  color: #4a3328 !important;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, .16),
    inset 0 1px 0 rgba(255, 255, 255, .7) !important;
  text-shadow: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  gap: 9px !important;
  scroll-snap-align: start;
}

.app-shell .mode-tabs .rail-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 250, 245, .96), rgba(247, 234, 218, .9)) !important;
}

.app-shell .mode-tabs .rail-button.active {
  background: linear-gradient(180deg, #6b4537, #4b3026) !important;
  color: #fff6ef !important;
  border-color: rgba(233, 205, 177, .32) !important;
  box-shadow:
    0 12px 22px rgba(0, 0, 0, .2),
    inset 0 1px 0 rgba(255, 255, 255, .08) !important;
}

.app-shell .mode-tabs .rail-icon {
  width: 24px !important;
  height: 24px !important;
  border: 1px solid rgba(191, 146, 105, .32) !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, rgba(198, 145, 88, .2), rgba(128, 87, 53, .08)) !important;
  color: #8a5b37 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45) !important;
  font-size: 13px !important;
}

.app-shell .mode-tabs .rail-button.active .rail-icon {
  background: rgba(255, 244, 232, .14) !important;
  border-color: rgba(255, 239, 218, .14) !important;
  color: #f6d3b0 !important;
  box-shadow: none !important;
}

.app-shell .account-box {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  align-self: center;
  margin-left: 0 !important;
  justify-self: auto !important;
}

.app-shell .account-box span {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 180px !important;
  color: #dbc6b3 !important;
  text-align: right !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.app-shell .account-box .file-action {
  flex: 0 0 auto !important;
  min-height: 36px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(222, 185, 146, .18) !important;
  border-radius: 999px !important;
  background: rgba(255, 249, 242, .9) !important;
  color: #4a3328 !important;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, .14),
    inset 0 1px 0 rgba(255, 255, 255, .75) !important;
  font-weight: 700 !important;
}

.app-shell .account-box .file-action.hidden {
  display: none !important;
}

body.engineer-mode .app-shell .topbar {
  background:
    linear-gradient(180deg, rgba(10, 21, 28, .98), rgba(6, 14, 18, .98)),
    radial-gradient(circle at 14% 18%, rgba(0, 216, 255, .08), transparent 28%) !important;
  border-bottom: 1px solid rgba(111, 231, 255, .22) !important;
  box-shadow:
    inset 0 -1px 0 rgba(111, 231, 255, .08),
    0 18px 34px rgba(0, 0, 0, .22) !important;
}

body.engineer-mode .app-shell #dataStatus,
body.engineer-mode .app-shell .topbar-meta p {
  color: #8fefff !important;
}

body.engineer-mode .app-shell .brand-logo {
  background: #061118 !important;
  border-color: rgba(111, 231, 255, .28) !important;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, .22),
    inset 0 0 0 1px rgba(111, 231, 255, .12) !important;
}

body.engineer-mode .app-shell .mode-tabs .rail-button {
  background: linear-gradient(180deg, rgba(12, 28, 36, .96), rgba(9, 20, 26, .94)) !important;
  border: 1px solid rgba(111, 231, 255, .18) !important;
  color: #bdf8ff !important;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, .22),
    inset 0 1px 0 rgba(111, 231, 255, .08) !important;
}

body.engineer-mode .app-shell .mode-tabs .rail-button.active {
  background: linear-gradient(180deg, rgba(20, 73, 88, .96), rgba(10, 35, 42, .98)) !important;
  border-color: rgba(111, 231, 255, .34) !important;
  color: #ffffff !important;
}

body.engineer-mode .app-shell .mode-tabs .rail-icon {
  background: rgba(111, 231, 255, .08) !important;
  border-color: rgba(111, 231, 255, .2) !important;
  color: #85ffe3 !important;
  box-shadow: none !important;
}

body.engineer-mode .app-shell .account-box span {
  color: #98d9e4 !important;
}

body.engineer-mode .app-shell .account-box .file-action {
  background: linear-gradient(180deg, rgba(19, 42, 51, .96), rgba(10, 24, 31, .96)) !important;
  border: 1px solid rgba(111, 231, 255, .22) !important;
  color: #eaffff !important;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, .2),
    inset 0 1px 0 rgba(111, 231, 255, .08) !important;
}

@media (max-width: 760px) {
  .app-shell .topbar {
    padding: 12px 12px 10px !important;
    min-height: 116px !important;
  }

  .app-shell .topbar-main {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 10px !important;
    min-height: 48px !important;
    padding-right: 168px !important;
  }

  .app-shell .brand-logo {
    width: 48px !important;
    height: 48px !important;
  }

  .app-shell .mode-tabs {
    width: calc(100% - 16px) !important;
    margin-left: 16px !important;
    padding-top: 10px !important;
    gap: 10px !important;
  }

  .app-shell .topbar-account-slot {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    margin-top: 0 !important;
    width: auto !important;
    max-width: calc(100% - 24px) !important;
    display: flex !important;
    justify-content: flex-end !important;
  }

  .app-shell .account-box {
    justify-content: flex-end !important;
    max-width: 168px !important;
    padding-top: 0 !important;
    gap: 8px !important;
  }

  .app-shell .account-box span {
    max-width: 96px !important;
    text-align: right !important;
    font-size: 12px !important;
  }

  .app-shell .account-box .file-action {
    min-height: 34px !important;
    padding: 0 12px !important;
  }

  .app-shell .topbar-meta {
    min-height: 48px !important;
  }

  .app-shell .topbar-meta p,
  .app-shell #dataStatus {
    display: none !important;
  }
}

/* Human-centered layout refresh */
.app-shell {
  width: min(100%, 1180px) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .28)),
    var(--panel) !important;
}

.main-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.app-shell .topbar {
  position: sticky;
  top: 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: stretch !important;
  gap: 12px !important;
  min-height: 0 !important;
  padding: 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.topbar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.app-shell .topbar-main {
  display: grid !important;
  grid-template-columns: 60px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 0 !important;
  padding-right: 0 !important;
}

.app-shell .brand-logo {
  width: 60px !important;
  height: 60px !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 22px rgba(52, 37, 31, .12) !important;
}

.app-shell .topbar-meta {
  display: grid !important;
  gap: 4px;
  min-height: 0 !important;
}

.topbar-eyebrow {
  color: #9b826d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
}

.app-shell .topbar-meta p,
.app-shell #dataStatus {
  display: block !important;
  margin: 0 !important;
  color: #6d6054 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: .02em !important;
}

.app-shell .topbar-account-slot {
  position: static !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  justify-self: end;
}

.app-shell .account-box {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(52, 37, 31, .08) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .58) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78) !important;
}

.app-shell .account-box span {
  max-width: none !important;
  color: #5f5348 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.topbar-nav-band {
  display: grid;
  gap: 8px;
}

.topbar-nav-label {
  color: #8a7767;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
}

.app-shell .mode-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  width: 100% !important;
  margin-left: 0 !important;
  padding: 0 2px 4px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.app-shell .mode-tabs::after {
  content: "";
  flex: 0 0 4px;
}

.app-shell .mode-tabs .rail-button {
  min-width: 104px !important;
  min-height: 46px !important;
  padding: 0 16px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, .68) !important;
  color: #4d3d32 !important;
  box-shadow: 0 10px 20px rgba(52, 37, 31, .08) !important;
}

.app-shell .mode-tabs .rail-button.active {
  background: linear-gradient(135deg, #715244, #50372d) !important;
  color: #fff7ef !important;
  box-shadow: 0 14px 24px rgba(80, 55, 45, .22) !important;
}

.app-shell .mode-tabs .rail-icon {
  width: 24px !important;
  height: 24px !important;
  border-radius: 8px !important;
  background: rgba(199, 111, 50, .12) !important;
  color: #986643 !important;
}

.app-shell .topbar-shell,
.app-shell .topbar-nav-band {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(52, 37, 31, .08) !important;
  border-radius: 22px !important;
  background: linear-gradient(135deg, rgba(255, 251, 247, .98), rgba(244, 236, 227, .96)) !important;
  box-shadow:
    0 10px 22px rgba(52, 37, 31, .08),
    inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}

.app-shell .topbar-nav-label {
  display: none !important;
}

body.engineer-mode .app-shell .topbar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.engineer-mode .app-shell .topbar-shell,
body.engineer-mode .app-shell .topbar-nav-band {
  background: linear-gradient(180deg, rgba(10, 21, 28, .98), rgba(6, 14, 18, .98)) !important;
  border: 1px solid rgba(111, 231, 255, .18) !important;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, .22),
    inset 0 1px 0 rgba(111, 231, 255, .06) !important;
}

.app-shell .mode-tabs .rail-button.active .rail-icon {
  background: rgba(255, 255, 255, .14) !important;
  color: #f5d3a8 !important;
}

.notification-tray,
.control-panel,
.file-panel,
.map-panel,
.quality-panel,
.purchase-panel,
.users-panel,
.content {
  border: 1px solid rgba(52, 37, 31, .09);
  border-radius: 24px;
  background: rgba(251, 248, 241, .84) !important;
  box-shadow: 0 18px 36px rgba(52, 37, 31, .08);
}

.control-panel,
.file-panel,
.map-panel,
.quality-panel,
.purchase-panel,
.users-panel,
.content {
  padding: 20px 22px !important;
}

.search-shell {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.search-copy {
  display: grid;
  gap: 6px;
}

.search-copy strong {
  color: var(--line);
  font-size: 22px;
  font-weight: 800;
}

.search-copy span {
  color: var(--muted);
  font-size: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 12px;
}

.chips {
  margin-top: 16px;
  padding-top: 0 !important;
}

.chip {
  min-height: 42px;
  padding: 0 16px !important;
  border-radius: 999px !important;
  background: #fff !important;
}

.result-summary {
  align-items: center;
  margin-bottom: 18px !important;
  padding: 14px 18px;
  border: 1px solid rgba(52, 37, 31, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
}

.result-summary span:first-child {
  color: var(--line);
  font-size: 18px;
  font-weight: 800;
}

.result-summary span:last-child {
  color: var(--stone);
  font-size: 14px;
}

.results {
  gap: 16px !important;
}

.result-card,
.quality-tool,
.quality-records,
.purchase-card,
.registry-detail,
#engineerPanel,
#boardPanel,
.file-upload,
.file-preview,
.registry-head,
.image-open-tile {
  border-radius: 22px !important;
  border: 1px solid rgba(52, 37, 31, .1) !important;
  box-shadow: 0 16px 30px rgba(52, 37, 31, .08) !important;
}

.result-card {
  padding: 18px !important;
}

.result-card::before {
  width: 8px !important;
  border-radius: 999px !important;
}

.file-toolbar,
.quality-tool-head,
.purchase-section-head {
  align-items: center !important;
  gap: 16px !important;
}

.file-toolbar h2,
.registry-head h3 {
  font-size: 28px !important;
  font-weight: 800 !important;
}

.quality-panel,
.purchase-panel {
  display: grid;
  gap: 18px;
}

.quality-tool,
.quality-records {
  padding: 18px;
  background: rgba(255, 255, 255, .72);
}

.pressure-grid,
.quality-record-grid,
.purchase-grid {
  gap: 14px !important;
}

.pressure-field input,
.purchase-grid input,
.purchase-grid select,
.quality-record-form input,
.purchase-form textarea {
  min-height: 52px;
  border: 1px solid rgba(52, 37, 31, .16);
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.quality-record-list {
  display: grid;
  gap: 14px;
}

.quality-record-card {
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 26px rgba(52, 37, 31, .08);
}

.quality-record-results {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
  gap: 12px !important;
}

.quality-record-results > div {
  padding: 12px 14px;
  border: 1px solid rgba(52, 37, 31, .08);
  border-radius: 16px;
  background: #fcfaf6;
}

.purchase-toolbar-actions,
.purchase-actions,
.quality-record-actions,
.file-actions,
.engineer-actions {
  flex-wrap: wrap;
  gap: 10px !important;
}

.purchase-form {
  display: grid;
  gap: 18px;
}

.purchase-card {
  padding: 18px;
  background: rgba(255, 255, 255, .78);
}

.purchase-output {
  display: grid;
  gap: 10px;
}

.file-categories,
.account-summary {
  gap: 14px !important;
}

.file-category,
.file-row {
  border-radius: 18px !important;
}

.image-open-tile {
  min-height: 0 !important;
  padding: 14px !important;
}

body.engineer-mode .app-shell .topbar {
  background:
    linear-gradient(135deg, rgba(8, 20, 25, .98), rgba(8, 13, 17, .98)) !important;
}

body.engineer-mode .topbar-eyebrow,
body.engineer-mode .topbar-nav-label,
body.engineer-mode .app-shell .topbar-meta p,
body.engineer-mode .app-shell #dataStatus {
  color: #90d8e4 !important;
}

body.engineer-mode .notification-tray,
body.engineer-mode .control-panel,
body.engineer-mode .file-panel,
body.engineer-mode .map-panel,
body.engineer-mode .quality-panel,
body.engineer-mode .purchase-panel,
body.engineer-mode .users-panel,
body.engineer-mode .content {
  background: rgba(10, 18, 23, .9) !important;
  border-color: rgba(111, 231, 255, .14) !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .2) !important;
}

body.engineer-mode .search-copy strong,
body.engineer-mode .result-summary span:first-child,
body.engineer-mode .file-toolbar h2,
body.engineer-mode .registry-head h3 {
  color: #f1fdff !important;
}

body.engineer-mode .search-copy span,
body.engineer-mode .result-summary span:last-child {
  color: #8ccad4 !important;
}

body.engineer-mode .result-summary,
body.engineer-mode .quality-tool,
body.engineer-mode .quality-records,
body.engineer-mode .purchase-card,
body.engineer-mode .registry-head,
body.engineer-mode .file-upload,
body.engineer-mode .file-preview,
body.engineer-mode .result-card,
body.engineer-mode .quality-record-card {
  background: rgba(12, 24, 31, .88) !important;
  border-color: rgba(111, 231, 255, .14) !important;
  box-shadow: 0 16px 28px rgba(0, 0, 0, .22) !important;
}

@media (max-width: 760px) {
  .main-panel {
    gap: 12px;
    padding: 10px;
  }

  .app-shell .topbar {
    gap: 12px !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }

  .topbar-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .app-shell .topbar-main {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .app-shell .brand-logo {
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
  }

  .app-shell .topbar-account-slot {
    justify-self: end;
    align-self: start;
  }

  .app-shell .account-box {
    min-height: 34px !important;
    padding: 4px 6px !important;
    gap: 6px !important;
    border-radius: 999px !important;
  }

  .app-shell .account-box span {
    max-width: 72px !important;
    font-size: 11px !important;
  }

  .app-shell .account-box .file-action {
    min-height: 30px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }

  .topbar-eyebrow,
  .topbar-nav-label {
    display: none !important;
  }

  .app-shell .topbar-meta {
    gap: 2px !important;
  }

  .app-shell .topbar-meta p,
  .app-shell #dataStatus {
    display: block !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .topbar-nav-band {
    gap: 0 !important;
  }

  .app-shell .mode-tabs {
    width: 100% !important;
    margin-left: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 2px !important;
    gap: 8px !important;
  }

  .app-shell .mode-tabs .rail-button {
    min-width: 88px !important;
    min-height: 42px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    gap: 8px !important;
  }

  .app-shell .mode-tabs .rail-icon {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
  }

  .search-shell {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-copy strong {
    font-size: 17px;
  }

  .search-copy span {
    font-size: 13px;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 10px;
  }

  .chips {
    gap: 8px !important;
    margin-top: 12px !important;
  }

  .chip {
    min-height: 38px;
    padding: 0 14px !important;
    font-size: 14px !important;
  }

  .control-panel,
  .file-panel,
  .map-panel,
  .quality-panel,
  .purchase-panel,
  .users-panel,
  .content {
    padding: 14px !important;
    border-radius: 18px;
  }

  .result-summary {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px;
    padding: 12px 14px !important;
    border-radius: 16px !important;
  }

  .result-summary span:first-child {
    font-size: 16px;
  }

  .result-summary span:last-child {
    font-size: 13px;
  }

  .results {
    gap: 12px !important;
  }

  .result-card,
  .quality-tool,
  .quality-records,
  .purchase-card,
  .registry-detail,
  #engineerPanel,
  #boardPanel,
  .file-upload,
  .file-preview,
  .registry-head,
  .image-open-tile {
    border-radius: 18px !important;
  }

  .result-card {
    padding: 14px !important;
    gap: 10px !important;
  }

  .model {
    font-size: 17px !important;
    line-height: 1.35 !important;
  }

  .meta,
  .dims {
    font-size: 14px !important;
  }

  .file-toolbar,
  .quality-tool-head,
  .purchase-section-head,
  .registry-head {
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }

  .file-toolbar h2,
  .registry-head h3 {
    font-size: 22px !important;
  }

  .quality-tool,
  .quality-records,
  .purchase-card {
    padding: 14px !important;
  }

  .pressure-grid,
  .quality-record-grid,
  .purchase-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .quality-record-actions,
  .purchase-toolbar-actions,
  .purchase-actions,
  .file-actions,
  .engineer-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .quality-record-actions .file-action,
  .purchase-toolbar-actions .file-action,
  .purchase-actions .file-action,
  .file-actions .file-action,
  .engineer-actions .file-action {
    width: 100% !important;
    justify-content: center !important;
  }

  .file-category,
  .file-row,
  .quality-record-card {
    border-radius: 16px !important;
  }

  .image-open-tile {
    padding: 10px !important;
  }

  .image-open-tile strong {
    font-size: 20px !important;
  }

  .image-open-tile small {
    font-size: 13px !important;
  }
}

.dev-log-panel {
  display: grid;
  gap: 18px;
}

.dev-log-grid {
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
  gap: 18px;
}

.dev-log-form,
.dev-log-feed {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(52, 37, 31, .1);
  border-radius: 22px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 16px 30px rgba(52, 37, 31, .08);
}

.dev-log-toolbar-actions,
.dev-log-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.dev-log-preset-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dev-log-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dev-log-fields label,
.dev-log-textarea,
.dev-log-filter-row label {
  display: grid;
  gap: 6px;
}

.dev-log-fields span,
.dev-log-textarea span,
.dev-log-filter-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dev-log-textarea textarea {
  min-height: 92px;
  resize: vertical;
}

.dev-log-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dev-log-list {
  display: grid;
  gap: 14px;
}

.dev-log-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid rgba(52, 37, 31, .08);
  border-radius: 18px;
  background: #fffdf8;
}

.dev-log-card-head {
  display: grid;
  gap: 8px;
}

.dev-log-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dev-log-card-title strong {
  color: var(--line);
  font-size: 18px;
  font-weight: 800;
}

.dev-log-card-title span {
  color: var(--stone);
  font-size: 13px;
}

.dev-log-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dev-log-card-meta span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f2ddc7;
  color: var(--line);
  font-size: 12px;
  font-weight: 700;
}

.dev-log-card-body {
  display: grid;
  gap: 8px;
}

.dev-log-card-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.dev-log-card-body strong {
  display: inline-block;
  min-width: 4em;
  margin-right: 8px;
  color: var(--teal);
}

@media (max-width: 760px) {
  .dev-log-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dev-log-form,
  .dev-log-feed {
    padding: 14px;
    border-radius: 18px;
  }

  .dev-log-fields,
  .dev-log-filter-row {
    grid-template-columns: 1fr;
  }

  .dev-log-card-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .dev-log-toolbar-actions,
  .dev-log-actions {
    justify-content: stretch;
  }

  .dev-log-toolbar-actions .file-action,
  .dev-log-actions .file-action,
  .dev-log-preset-row .file-action {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .app-shell .topbar {
    padding: 10px !important;
  }

  .app-shell .topbar-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "main account"
      "nav nav" !important;
    align-items: start !important;
    gap: 8px 10px !important;
  }

  .app-shell .topbar-main {
    grid-area: main !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
  }

  .app-shell .brand-logo {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
  }

  .app-shell .topbar-meta {
    display: none !important;
  }

  .app-shell .topbar-account-slot {
    grid-area: account !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    justify-self: end !important;
    align-self: start !important;
  }

  .app-shell .account-box {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 8px !important;
    max-width: calc(100vw - 96px) !important;
  }

  .app-shell .account-box span {
    max-width: 92px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
  }

  .app-shell .account-box .file-action {
    min-height: 30px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }

  .app-shell .topbar-nav-band {
    grid-area: nav !important;
    width: 100% !important;
  }

  .app-shell .topbar-nav-label {
    display: none !important;
  }

  .app-shell .mode-tabs {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 0 2px !important;
    gap: 8px !important;
  }

  .app-shell .mode-tabs .rail-button {
    min-width: 86px !important;
    min-height: 42px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
  }

  .app-shell .mode-tabs .rail-icon {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 760px) {
  .app-shell .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: stretch !important;
    gap: 10px !important;
    padding: 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .app-shell .topbar-shell {
    grid-area: auto / 1 / auto / -1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(52, 37, 31, .08) !important;
    border-radius: 22px !important;
    background: linear-gradient(135deg, rgba(255, 251, 247, .98), rgba(244, 236, 227, .96)) !important;
    box-shadow:
      0 10px 22px rgba(52, 37, 31, .10),
      inset 0 1px 0 rgba(255, 255, 255, .76) !important;
  }

  .app-shell .topbar-main {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  .app-shell .brand-logo {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    flex: 0 0 auto !important;
  }

  .app-shell .topbar-meta,
  .app-shell .topbar-eyebrow,
  .app-shell #dataStatus {
    display: none !important;
  }

  .app-shell .topbar-account-slot {
    position: static !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    justify-self: end !important;
    flex: 0 0 auto !important;
  }

  .app-shell .account-box {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    max-width: calc(100vw - 110px) !important;
  }

  .app-shell .account-box span {
    display: none !important;
  }

  .app-shell .account-box .file-action {
    min-height: 32px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
  }

  .app-shell .topbar-nav-band {
    grid-area: auto / 1 / auto / -1 !important;
    display: grid !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(52, 37, 31, .08) !important;
    border-radius: 22px !important;
    background: linear-gradient(135deg, rgba(255, 251, 247, .98), rgba(244, 236, 227, .96)) !important;
    box-shadow:
      0 10px 22px rgba(52, 37, 31, .08),
      inset 0 1px 0 rgba(255, 255, 255, .72) !important;
  }

  .app-shell .topbar-nav-label {
    display: none !important;
  }

  .app-shell .mode-tabs {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
  }

  .app-shell .mode-tabs .rail-button {
    min-width: 82px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
  }

  .app-shell .mode-tabs .rail-icon {
    width: 20px !important;
    height: 20px !important;
    font-size: 11px !important;
  }

  .app-shell .notification-tray {
    border-radius: 16px !important;
  }
}
