:root {
  --bg:#111418;
  --panel:#1b2026;
  --tile:#252b32;
  --orange:#ff791f;
  --text:#f4f5f6;
  --muted:#919ba5;
}

* { box-sizing:border-box; }

body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Arial,Helvetica,sans-serif;
}

.app {
  max-width:1200px;
  margin:auto;
  min-height:100vh;
}

header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:22px;
  border-bottom:1px solid #30363d;
  background:#171b20;
}

.brand {
  display:flex;
  align-items:center;
  gap:14px;
}

.brand-icon {
  width:52px;
  height:52px;
  border:2px solid var(--orange);
  border-radius:12px;
  display:grid;
  place-items:center;
  color:var(--orange);
  font-size:23px;
  font-weight:900;
}

h1 {
  margin:0;
  font-size:28px;
  letter-spacing:1px;
}

h1 span { color:var(--orange); }

.brand small {
  color:var(--muted);
  font-size:9px;
  letter-spacing:1.5px;
}

.status-dot {
  width:11px;
  height:11px;
  border-radius:50%;
  background:#36c878;
  box-shadow:0 0 10px #36c878;
}

main { padding:22px; }

.welcome h2 {
  margin:0;
  font-size:21px;
  letter-spacing:1px;
}

.welcome p {
  color:var(--muted);
  font-size:13px;
}

.search { margin:24px 0; }

.search input {
  width:100%;
  background:#242a31;
  border:1px solid #3b424a;
  color:white;
  border-radius:10px;
  padding:16px;
  font-size:15px;
}

.tiles {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
}

.tiles button {
  background:linear-gradient(145deg,#2c333b,#1d2228);
  border:1px solid #424a52;
  color:white;
  border-radius:14px;
  min-height:130px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:9px;
  cursor:pointer;
}

.tiles button:active { border-color:var(--orange); }

.tile-icon {
  font-size:32px;
  color:var(--orange);
}

.tiles strong {
  font-size:15px;
  letter-spacing:1px;
}

.tiles small {
  color:var(--muted);
  font-size:11px;
}

.panel {
  margin-top:24px;
  background:var(--panel);
  border:1px solid #30363d;
  border-radius:13px;
  padding:17px;
}

.panel h3 {
  margin:0 0 15px;
  font-size:13px;
  letter-spacing:1px;
  color:var(--orange);
}

.file-row {
  padding:14px 5px;
  border-bottom:1px solid #30363d;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  gap:12px;
}

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

.file-row small {
  color:var(--muted);
}

footer {
  display:flex;
  justify-content:space-between;
  padding:18px 22px;
  color:var(--muted);
  font-size:10px;
  border-top:1px solid #30363d;
}

footer span:first-child { color:#39c77b; }

@media(min-width:750px) {
  .tiles { grid-template-columns:repeat(4,1fr); }
  main { padding:35px; }
  .tiles button { min-height:170px; }
  .welcome h2 { font-size:28px; }
}

/* FIELDKIT FILE VIEWER */

.viewer {
  position:fixed;
  inset:0;
  background:#111418;
  z-index:100;
  display:flex;
  flex-direction:column;
}

.viewer.hidden {
  display:none;
}

.viewer-header {
  background:#1b2026;
  border-bottom:1px solid #353c44;
  padding:15px;
  display:flex;
  align-items:center;
  gap:15px;
}

.viewer-back {
  background:#ff791f;
  color:#111;
  border:none;
  border-radius:8px;
  padding:11px 16px;
  font-weight:bold;
  cursor:pointer;
}

.viewer-title {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:14px;
}

.viewer-body {
  flex:1;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:auto;
}

.viewer-body iframe {
  width:100%;
  height:100%;
  border:none;
  background:white;
}

.viewer-body video {
  width:100%;
  max-height:100%;
  background:black;
}

.viewer-message {
  padding:30px;
  color:#919ba5;
  text-align:center;
}


/* STEP 6 NAVIGATION */

.brand {
  cursor:pointer;
}

.panel-heading {
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:15px;
}

.panel-heading h3 {
  margin:0;
}

.nav-back {
  background:#303740;
  border:1px solid #48515b;
  color:white;
  border-radius:8px;
  padding:10px 13px;
  font-size:13px;
  cursor:pointer;
}

.nav-back:active {
  background:#ff791f;
  color:#111;
}

.hidden {
  display:none !important;
}

.file-row {
  min-height:49px;
  align-items:center;
}


/* =====================================================
   FIELDKIT — INDUSTRIAL PREMIUM UI
   STEP 8D — VISUAL FOUNDATION
   ===================================================== */

:root {
  --bg: #0a0e13;
  --panel: #19212b;
  --tile: #202b37;
  --orange: #ff8b2c;
  --text: #f4f6f8;
  --muted: #9ba8b5;
}

body {
  background:
    radial-gradient(ellipse at 50% 0%, #283747 0%, transparent 55%),
    #0a0e13;
  font-family: "Arial", sans-serif;
}

.app {
  max-width: 1450px;
  background: linear-gradient(180deg, #151d26, #0c1117 75%);
  box-shadow: 0 0 80px #0008;
}

/* CINEMATIC HEADER */

header {
  position: relative;
  min-height: 155px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 78% 90%, #ff791f30, transparent 28%),
    repeating-radial-gradient(
      ellipse at 78% 105%,
      transparent 0 20px,
      #61708020 21px 24px,
      transparent 25px 46px
    ),
    linear-gradient(125deg, #263543, #0b1016 70%);
  border-bottom: 2px solid #754b2b;
  box-shadow: inset 0 -12px 25px #0008, 0 8px 22px #0007;
}

header::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: -60px;
  width: 260px;
  height: 230px;
  border: 16px solid #43505c;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 12px #121921,
    inset 0 0 45px #ff791f40,
    0 0 0 4px #111820,
    0 0 35px #ff791f20;
  opacity: .55;
  pointer-events: none;
}

.brand {
  position: relative;
  z-index: 1;
}

.brand-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid #76838f;
  color: #ff9c47;
  background:
    radial-gradient(circle at 35% 25%, #536373, #111923 65%);
  box-shadow:
    inset 0 3px 5px #ffffff40,
    inset 0 -7px 12px #000,
    0 5px 12px #000a,
    0 0 20px #ff791f30;
  text-shadow: 0 2px 4px #000;
}

h1 {
  font-size: clamp(28px, 5vw, 43px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 2px;
  color: #e5edf3;
  text-shadow:
    0 1px #fff8,
    0 3px 1px #596775,
    0 5px 8px #000;
}

h1 span {
  color: #ff8b2c;
  text-shadow: 0 2px #9a4114, 0 5px 9px #000;
}

/* DASHBOARD */

main {
  position: relative;
}

.welcome h2 {
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 3px 8px #000;
}

.search input {
  background: linear-gradient(#121921, #25313d);
  border: 1px solid #53606c;
  border-radius: 12px;
  box-shadow: inset 0 3px 8px #0009, 0 2px 0 #ffffff0c;
}

.search input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px #ff8b2c22;
}

/* 3D NAVIGATION TILES */

.tiles {
  gap: 16px;
}

.tiles button {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, #ffffff13, transparent 35%),
    linear-gradient(155deg, #344454, #17212c 65%, #0f151c);
  border: 1px solid #617080;
  border-bottom: 4px solid #0b1015;
  box-shadow:
    inset 0 2px 2px #ffffff25,
    inset 0 -8px 16px #0005,
    0 9px 16px #0007;
  transition: transform .15s ease, box-shadow .15s ease;
}

.tiles button::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid #ffffff12;
  border-radius: 11px;
  pointer-events: none;
}

.tiles button:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 2px 3px #ffffff30,
    0 12px 24px #0009,
    0 0 18px #ff8b2c18;
}

.tiles button:active {
  transform: translateY(2px);
  border-color: #ff8b2c;
}

.tile-icon {
  font-size: 43px;
  font-weight: 900;
  line-height: 1.1;
  color: #ff9a3e;
  text-shadow:
    0 2px 0 #a94d17,
    0 4px 0 #70310e,
    0 7px 10px #000;
  filter: drop-shadow(0 0 8px #ff8b2c35);
}

.tiles strong {
  font-size: 15px;
  text-shadow: 0 2px 5px #000;
}

.tiles small {
  color: #aab7c4;
}

/* BEVELED FILE PANELS */

.panel {
  background:
    linear-gradient(155deg, #ffffff08, transparent 35%),
    linear-gradient(180deg, #26323e, #151d26);
  border: 1px solid #52606d;
  border-bottom: 3px solid #0b1016;
  border-radius: 15px;
  box-shadow:
    inset 0 2px 2px #ffffff18,
    0 9px 20px #0007;
}

.panel h3 {
  color: #ff9a3e;
  letter-spacing: 1.5px;
}

.file-row {
  padding: 16px 10px;
  border-bottom: 1px solid #ffffff13;
  border-radius: 6px;
  transition: background .15s ease;
}

.file-row:hover {
  background: #ff8b2c12;
}

.file-row:active {
  background: #ff8b2c25;
}

.nav-back {
  background: linear-gradient(#485767, #25313d);
  border: 1px solid #657382;
  box-shadow: inset 0 1px #ffffff22, 0 3px 7px #0007;
}

footer {
  background: #0e151c;
  border-top: 1px solid #4a5662;
}

/* PHONE REFINEMENTS */

@media (max-width: 749px) {
  header {
    min-height: 130px;
    padding: 20px 16px;
  }

  header::after {
    right: -65px;
    transform: scale(.8);
  }

  .brand-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }

  .brand small {
    letter-spacing: .7px;
  }

  main {
    padding: 18px 14px;
  }

  .tiles {
    gap: 12px;
  }

  .tiles button {
    min-height: 135px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tiles button,
  .file-row {
    transition: none;
  }
}

/* FIELDKIT STEP 8E — CUSTOM NAVIGATION ART */
.tile-art {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 5px 5px #0008);
  transition: transform .15s ease;
}

.tiles button:hover .tile-art {
  transform: translateY(-3px) scale(1.04);
}

.tiles button {
  padding: 14px 8px;
  gap: 5px;
}

.tiles strong {
  position: relative;
  z-index: 1;
}

@media (max-width: 749px) {
  .tile-art {
    width: 76px;
    height: 76px;
  }
}


/* ==================================================
   FIELDKIT STEP 8F — CINEMATIC TUNNEL HEADER
   ================================================== */

.fieldkit-hero {
  isolation: isolate;
  position: relative;
  min-height: 185px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(
      ellipse at 79% 75%,
      #ff9c3b88 0%,
      #9d461a55 9%,
      #101820 23%,
      transparent 37%
    ),
    repeating-radial-gradient(
      ellipse at 79% 76%,
      transparent 0 25px,
      #74818d44 27px 31px,
      #10171f88 33px 47px
    ),
    linear-gradient(
      115deg,
      #273746 0%,
      #121c26 45%,
      #070b10 100%
    );
  border-bottom: 3px solid #ad632c;
  box-shadow:
    inset 0 3px 2px #ffffff22,
    inset 0 -20px 40px #000b,
    0 12px 25px #0008;
}

.fieldkit-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  right: 8%;
  top: -45px;
  border-radius: 50%;
  border: 18px solid #586571;
  background:
    radial-gradient(
      ellipse at 50% 65%,
      #ff9a3255,
      #2b221d 22%,
      #06090d 65%
    );
  box-shadow:
    inset 0 0 0 12px #222e39,
    inset 0 0 0 18px #596570,
    inset 0 0 70px #000,
    0 0 0 5px #141d26,
    0 0 50px #ff8b2c33;
  opacity: .88;
}

.fieldkit-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      #111a25 0%,
      #111a25cc 35%,
      transparent 72%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 5px,
      #ffffff03 6px 7px
    );
  pointer-events: none;
}

.fieldkit-hero .brand {
  gap: 18px;
}

.fieldkit-hero h1 {
  font-size: clamp(31px, 4vw, 52px);
  letter-spacing: 2.5px;
}

.fieldkit-hero .brand small {
  display: block;
  margin-top: 6px;
  color: #c4cdd5;
  font-size: 10px;
  letter-spacing: 2px;
  text-shadow: 0 2px 5px #000;
}

.fieldkit-hero .brand-icon {
  width: 76px;
  height: 76px;
  border: 5px ridge #8b9ba7;
  font-size: 27px;
}

@media (max-width: 749px) {
  .fieldkit-hero {
    min-height: 145px;
    padding: 20px 16px;
  }

  .fieldkit-hero::before {
    width: 210px;
    height: 210px;
    right: -90px;
    top: -15px;
    border-width: 13px;
  }

  .fieldkit-hero .brand {
    gap: 12px;
  }

  .fieldkit-hero .brand-icon {
    width: 57px;
    height: 57px;
    border-width: 3px;
    font-size: 21px;
  }

  .fieldkit-hero h1 {
    font-size: clamp(27px, 7vw, 35px);
    letter-spacing: 1px;
  }

  .fieldkit-hero .brand small {
    font-size: 8px;
    letter-spacing: .7px;
  }
}

/* STEP 8G — REAL TUNNEL ARTWORK */

.fieldkit-hero {
  background:
    linear-gradient(
      90deg,
      #101923 0%,
      #101923ee 30%,
      #10192355 65%,
      #10192322 100%
    ),
    url("/static/images/fieldkit-tunnel.webp")
      center right / cover no-repeat;
}

.fieldkit-hero::before {
  display: none;
}

.fieldkit-hero::after {
  background: linear-gradient(
    0deg,
    #080d14aa,
    transparent 45%
  );
}



/* =====================================================
   FIELDKIT STEP 8H — PREMIUM DASHBOARD PANELS
   ===================================================== */

.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 26px;
}

.dashboard-panels .panel {
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
}

.dashboard-panels .panel-heading {
  min-height: 28px;
  padding-bottom: 13px;
  border-bottom: 1px solid #ffffff19;
}

.dashboard-panels .panel-heading h3 {
  font-size: 13px;
  letter-spacing: 1.6px;
  color: #ff9c43;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  min-height: 68px;
  padding: 10px 8px;
  border-bottom: 1px solid #ffffff12;
  cursor: pointer;
}

.file-row-icon {
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px #0009);
}

.file-row-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.file-row-text strong {
  font-size: 13px;
  font-weight: 700;
  color: #f0f4f7;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.file-row-text small {
  font-size: 11px;
  color: #a3b0bd;
  overflow-wrap: anywhere;
}

.file-row-arrow {
  flex-shrink: 0;
  color: #ff9840;
  font-size: 25px;
  font-weight: bold;
  padding: 0 4px;
}

.file-row:hover {
  background:
    linear-gradient(90deg, #ff8b2c16, transparent);
  box-shadow: inset 3px 0 #ff8b2c;
}

.file-row:focus-visible {
  outline: 2px solid #ff9c43;
  outline-offset: -2px;
}

@media (min-width: 750px) {
  .dashboard-panels {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 749px) {
  .dashboard-panels {
    gap: 16px;
    margin-top: 20px;
  }

  .file-row-icon {
    width: 40px;
    height: 40px;
  }

  .file-row {
    min-height: 62px;
  }
}


/* STEP 8I — INDUSTRIAL SIDEBAR */

.fk-sidebar {
  display: none;
}

@media (min-width: 900px) {
  .fk-shell {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    min-height: 100vh;
    max-width: 1800px;
    margin: auto;
  }

  .fk-shell > .app {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
  }

  .fk-sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    background:
      linear-gradient(145deg, #ffffff09, transparent 35%),
      linear-gradient(180deg, #263442, #111922 70%);
    border-right: 2px solid #566574;
    box-shadow: inset -8px 0 18px #0006, 8px 0 22px #0005;
    padding: 26px 15px 18px;
  }

  .fk-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 4px 30px;
    cursor: pointer;
  }

  .fk-sidebar-emblem {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 4px ridge #8b9ba7;
    background: radial-gradient(circle at 30% 20%, #526373, #101820 70%);
    box-shadow: inset 0 2px 4px #ffffff44, 0 5px 10px #000a;
    color: #ff9c43;
    font-size: 20px;
    font-weight: 900;
  }

  .fk-sidebar-brand strong {
    display: block;
    font-size: 20px;
    font-style: italic;
    letter-spacing: 1px;
    color: #f1f4f7;
  }

  .fk-sidebar-brand strong span {
    color: #ff9237;
  }

  .fk-sidebar-brand small {
    display: block;
    margin-top: 5px;
    font-size: 9px;
    letter-spacing: 1px;
    color: #a5b2bf;
  }

  .fk-sidebar-label {
    padding: 0 14px 12px;
    color: #ff9c43;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
  }

  .fk-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .fk-sidebar-nav button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 51px;
    padding: 10px 14px;
    text-align: left;
    color: #dce4eb;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(145deg, #354452, #1b2631);
    border: 1px solid #4d5d6c;
    border-bottom: 3px solid #0a1118;
    border-radius: 10px;
    box-shadow: inset 0 1px #ffffff17, 0 4px 8px #0005;
    cursor: pointer;
  }

  .fk-sidebar-nav button:hover,
  .fk-sidebar-nav button:focus-visible {
    border-color: #ff9237;
    background: linear-gradient(145deg, #465360, #26323e);
  }

  .fk-sidebar-nav button span {
    width: 25px;
    text-align: center;
    color: #ff9c43;
    font-size: 23px;
  }

  .fk-sidebar-bottom {
    margin-top: auto;
    padding: 18px 10px 4px;
    border-top: 1px solid #ffffff19;
    color: #9eacb9;
    font-size: 10px;
    letter-spacing: 1px;
  }

  .fk-sidebar-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: #40cb83;
    box-shadow: 0 0 9px #40cb83;
  }
}


/* STEP 8J — ACTIVE SIDEBAR */

@media (min-width: 900px) {
  .fk-sidebar-nav button.fk-nav-active {
    background: linear-gradient(145deg, #684020, #30271f);
    border-color: #ff9a3e;
    border-left: 4px solid #ff9a3e;
    box-shadow:
      inset 0 1px #ffc08055,
      0 0 15px #ff8b2c20,
      0 5px 10px #0007;
    color: #ffffff;
  }

  .fk-sidebar-nav button.fk-nav-active span {
    color: #ffc078;
  }
}


/* STEP 8K — FILE BROWSER POLISH */

#view-title {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.file-row-text strong {
  letter-spacing: .1px;
}

.file-row-text small {
  color: #b4c0cc;
}

.file-row-arrow {
  opacity: .75;
}

.file-row:hover .file-row-arrow {
  opacity: 1;
  transform: translateX(2px);
}

@media (max-width: 749px) {
  #view-title {
    font-size: 11px;
    letter-spacing: .7px;
  }
}


/* STEP 8L — PREMIUM VIEWER TOOLBAR */

.fk-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #354554, #17222d);
  border-bottom: 2px solid #ff9237;
  box-shadow: 0 4px 16px #0008;
}

.fk-viewer-toolbar .viewer-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fk-viewer-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

.fk-viewer-actions button {
  min-width: 39px;
  min-height: 39px;
  border: 1px solid #657483;
  border-radius: 8px;
  background: linear-gradient(145deg, #455565, #1c2834);
  color: #ffad61;
  font-size: 19px;
  font-weight: bold;
  cursor: pointer;
}

.fk-viewer-actions button:hover {
  border-color: #ff9237;
  background: #394653;
}

@media (max-width: 600px) {
  .fk-viewer-toolbar {
    gap: 6px;
    padding: 8px;
  }

  .fk-viewer-actions {
    gap: 4px;
  }

  .fk-viewer-actions button {
    min-width: 34px;
    min-height: 36px;
  }
}


/* ==============================================
   STEP 8O — RESPONSIVE NAVIGATION CLEANUP
   ============================================== */

/* iPhone / narrow screens: dashboard tiles */
@media (max-width: 899px) {
  .fk-sidebar {
    display: none !important;
  }

  .tiles {
    display: grid;
  }
}

/* iPad / desktop: sidebar replaces tiles */
@media (min-width: 900px) {
  .fk-sidebar {
    display: flex;
  }

  .tiles {
    display: none !important;
  }

  /* More breathing room without duplicate tiles */
  .dashboard-panels {
    margin-top: 20px;
  }
}

/* Prevent panels from appearing like nested folders */
.dashboard-panels .panel {
  box-shadow:
    inset 0 1px 0 #ffffff20,
    0 5px 16px #0005;
}

/* Tighter file browser rows */
.file-row {
  min-height: 58px;
}

.file-row-icon {
  width: 36px;
  height: 36px;
}


/* STEP 8R — CLEAN IPAD PROJECT BROWSER */

@media (min-width: 900px) {
  .dashboard-panels {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
  }

  .dashboard-panels .recent-panel {
    display: none !important;
  }

  .projects-panel {
    width: 100%;
  }

  .projects-panel .file-row {
    min-height: 68px;
    padding: 12px 16px;
  }

  .projects-panel .file-row-icon {
    width: 44px;
    height: 44px;
  }
}


/* STEP 8S — IPAD SPLIT VIEW */

.fk-split-browser {
  display: none;
}

@media (min-width: 900px) {
  .projects-panel #content {
    display: none;
  }

  .fk-split-browser {
    display: grid;
    grid-template-columns: minmax(180px, 32%) minmax(0, 1fr);
    gap: 14px;
    min-height: 380px;
    margin-top: 12px;
  }

  .fk-split-folders,
  .fk-split-files {
    min-width: 0;
    padding: 12px;
    border: 1px solid #526171;
    border-radius: 12px;
    background: linear-gradient(145deg, #263542, #121d27);
  }

  .fk-split-label {
    margin-bottom: 12px;
    color: #ff9d47;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    overflow-wrap: anywhere;
  }

  .fk-split-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 55px;
    margin-bottom: 8px;
    padding: 9px 12px;
    text-align: left;
    border: 1px solid #455666;
    border-radius: 9px;
    background: linear-gradient(#354654, #1b2834);
    color: #edf2f6;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    overflow-wrap: anywhere;
  }

  .fk-split-item img {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    object-fit: contain;
  }

  .fk-split-item span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .fk-split-item:hover,
  .fk-split-item.selected {
    border-color: #ff983c;
    background: linear-gradient(#534331, #292923);
  }

  .fk-split-back {
    width: 100%;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid #5c6975;
    border-radius: 8px;
    background: #1b2935;
    color: #ffab60;
    font-weight: 800;
    cursor: pointer;
  }
}


/* STEP 8T — SHOW SEARCH RESULTS WHEN NEEDED */

@media (min-width: 900px) {
  .projects-panel.fk-show-standard-list #content {
    display: block !important;
  }

  .projects-panel.fk-show-standard-list
  #fk-split-browser {
    display: none !important;
  }

  .projects-panel:not(.fk-show-standard-list)
  #content {
    display: none !important;
  }

  .projects-panel .panel-heading {
    margin-bottom: 12px;
  }
}


/* STEP 8X — IPAD UI POLISH */

@media (min-width: 900px) {

  .fk-split-browser {
    grid-template-columns: minmax(200px, 30%) minmax(0, 1fr);
    gap: 12px;
    min-height: 440px;
  }

  .fk-split-folders,
  .fk-split-files {
    padding: 15px;
    border-color: #536474;
    box-shadow:
      inset 0 1px 0 #ffffff15,
      0 6px 16px #0005;
  }

  .fk-split-item {
    min-height: 54px;
    margin-bottom: 7px;
    padding: 9px 11px;
    line-height: 1.4;
    transition:
      background .15s ease,
      border-color .15s ease;
  }

  .fk-split-item.selected {
    border: 1px solid #ff9c43;
    border-left: 4px solid #ff9c43;
    background: linear-gradient(110deg, #63442b, #282c30);
    box-shadow: inset 0 1px #ffffff18;
  }

  .fk-split-files .fk-split-item {
    min-height: 64px;
    background: linear-gradient(145deg, #30404e, #192530);
  }

  .fk-split-files .fk-split-item:hover {
    border-color: #ff9c43;
    background: linear-gradient(145deg, #46505a, #26323d);
  }

  .fk-split-files .fk-split-item span {
    overflow-wrap: anywhere;
    font-weight: 600;
  }

  .fk-split-label {
    padding-bottom: 11px;
    border-bottom: 1px solid #ffffff20;
    margin-bottom: 14px;
  }
}


/* FIELDKIT PDF.JS VIEWER */
.viewer-body.fk-pdf-mode {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  overflow:hidden;
}

.fk-pdf-controls {
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 12px;
  background:#222a32;
  color:white;
  flex-shrink:0;
}

.fk-pdf-controls button {
  background:#ff791f;
  border:0;
  border-radius:6px;
  padding:6px 15px;
  font-weight:bold;
  font-size:20px;
}

.fk-pdf-controls span:last-child {
  margin-left:auto;
  font-size:12px;
  color:#b9c3cd;
}

.fk-pdf-scroll {
  flex:1;
  min-height:0;
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-x pan-y;
}

.fk-pdf-stack {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  padding:14px;
  min-width:max-content;
}

.fk-pdf-page {
  display:block;
  background:white;
  box-shadow:0 4px 15px #0008;
  max-width:none;
}

/* FIELDKIT APPROVED BRANDING */
.fieldkit-hero .fieldkit-brand-logo {
  display:block;
  width:min(100%, 570px);
  height:auto;
  max-height:105px;
  object-fit:contain;
  object-position:left center;
}
@media(max-width:600px) {
  .fieldkit-hero .fieldkit-brand-logo {
    width:min(100%, 350px);
    max-height:75px;
  }
}


/* FIELDKIT HEADER BRANDING REFINEMENT */

/* Remove decorative circle overlay */
.fieldkit-hero::before,
.fieldkit-hero::after {
    content: none !important;
    display: none !important;
}

/* Increase transparent logo size */
.fieldkit-hero .fieldkit-brand-logo {
    width: min(100%, 800px) !important;
    max-height: 145px !important;
    height: auto !important;
    object-fit: contain;
    object-position: left center;
}

/* Keep logo positioned over tunnel */
.fieldkit-hero .brand {
    position: relative;
    z-index: 2;
}

/* iPad / smaller screens */
@media (max-width: 900px) {
    .fieldkit-hero .fieldkit-brand-logo {
        width: min(100%, 620px) !important;
        max-height: 115px !important;
    }
}

/* iPhone */
@media (max-width: 600px) {
    .fieldkit-hero .fieldkit-brand-logo {
        width: min(100%, 420px) !important;
        max-height: 90px !important;
    }
}


/* FIELDKIT SIDEBAR BRANDING */
.fk-sidebar-brand {
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px 10px;
    min-height:90px;
}

.fk-sidebar-logo {
    display:block;
    width:100%;
    max-width:235px;
    height:auto;
    max-height:100px;
    object-fit:contain;
}


/* MANHOLE-ONLY SIDEBAR EMBLEM */
.fk-sidebar-brand {
    justify-content:center;
    padding:12px 10px;
}

.fk-sidebar-logo {
    width:115px;
    height:115px;
    max-width:100%;
    max-height:none;
    object-fit:contain;
}


/* FIELDKIT — FIXED IPAD APPLICATION VIEWPORT */
@media (min-width: 900px) {

    html, body {
        height: 100%;
        height: 100dvh;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body {
        max-height: 100dvh;
    }

    /* Keep the main application inside the viewport */
    main {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Allow dashboard panels to shrink rather than extend the page */
    .dashboard-panels,
    .projects-panel,
    .fk-split-browser,
    .fk-split-folders,
    .fk-split-files {
        min-height: 0 !important;
    }

    /* Project and file lists scroll independently */
    #fk-split-folder-list,
    #fk-split-file-list {
        min-height: 0 !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* Sidebar remains stationary */
    .fk-sidebar {
        max-height: 100dvh;
        overflow-y: auto;
    }
}
