:root {
  --n:#102a43;
  --b:#1f5f8b;
  --g:#2f855a;
  --bg:#f3f7fa;
  --line:#dbe5ec
}

* {
  box-sizing:border-box
}

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

header {
  height:70px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 4%;
  position:sticky;
  top:0;
  z-index:5
}

.brand {
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--n)
}

.brand small {
  display:block;
  font-weight:400
}

.logo {
  background:var(--g);
  color:#fff;
  padding:10px;
  border-radius:10px
}

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

nav a {
  text-decoration:none
}

main {
  max-width:1200px;
  margin:auto;
  padding:30px 22px 70px
}

.hero {
  background:linear-gradient(125deg,var(--n),var(--b));
  color:#fff;
  padding:40px;
  border-radius:24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:25px
}

.hero h1 {
  font-size:40px;
  margin:8px 0
}

.eyebrow {
  color:#92e4bb;
  text-transform:uppercase;
  letter-spacing:2px;
  font-size:12px;
  font-weight:bold
}

.route {
  font-weight:bold
}

.kpis {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:15px;
  margin:18px 0
}

.kpis div,.card,.panel,.step {
  background:#fff;
  border:1px solid var(--line);
  border-radius:17px;
  padding:20px
}

.kpis b {
  display:block;
  font-size:30px;
  color:var(--n)
}

.filters {
  display:grid;
  grid-template-columns:1fr 220px 100px;
  gap:12px;
  margin:20px 0
}

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

.card {
  position:relative
}

.card h3 {
  color:var(--n)
}

.card p {
  min-height:50px;
  color:#637786
}

.rank {
  position:absolute;
  right:18px
}

.tag {
  background:#e5f5ed;
  color:var(--g);
  padding:5px 9px;
  border-radius:99px;
  font-size:11px;
  font-weight:bold
}

.btn {
  background:var(--g);
  color:#fff;
  border:0;
  padding:11px 16px;
  border-radius:10px;
  text-decoration:none;
  font-weight:bold;
  cursor:pointer
}

.btn.alt {
  background:#e7eef4;
  color:var(--n)
}

.wide {
  display:block;
  text-align:center;
  margin-top:16px
}

.two {
  display:grid;
  grid-template-columns:1fr 1.2fr;
  gap:18px;
  margin:18px 0
}

.panel iframe {
  width:100%;
  height:280px;
  border:0
}

.tram {
  text-align:center;
  font-size:60px;
  color:#92e4bb
}

.tram small {
  font-size:12px;
  display:block;
  color:#fff
}

.survey-title {
  text-align:center
}

.progress {
  max-width:650px;
  height:8px;
  margin:20px auto;
  background:#dbe5ec;
  border-radius:99px;
  overflow:hidden
}

.progress span {
  display:block;
  height:100%;
  background:var(--g)
}

.step {
  display:none;
  min-height:390px
}

.step.active {
  display:block
}

.fields {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:15px
}

.fields label,.flowgrid label {
  font-size:13px;
  font-weight:bold
}

.full {
  grid-column:1/-1
}

input,select,textarea {
  width:100%;
  padding:12px;
  margin-top:6px;
  border:1px solid #c8d5df;
  border-radius:9px
}

.nav {
  display:flex;
  justify-content:space-between;
  margin-top:14px
}

.flow {
  border:1px solid var(--line);
  padding:16px;
  border-radius:14px;
  margin:12px 0
}

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

.rail {
  background:var(--n);
  color:#fff;
  padding:18px;
  text-align:center;
  border-radius:12px;
  margin-bottom:20px
}

.thanks {
  text-align:center;
  background:#fff;
  border-radius:22px;
  padding:70px
}

.thanks div {
  font-size:60px;
  color:var(--g)
}

footer {
  text-align:center;
  padding:20px;
  color:#718493;
  font-size:12px
}

@media(max-width:800px) {
  .grid {
    grid-template-columns:1fr
  }
  .kpis {
    grid-template-columns:1fr 1fr
  }
  .hero {
    flex-direction:column;
    align-items:flex-start
  }
  .two,.fields,.flowgrid,.filters {
    grid-template-columns:1fr
  }
  .hero h1 {
    font-size:31px
  }
  .full {
    grid-column:auto
  }
}

/* Mapbox company map */
.map-panel {
  overflow:hidden
}

.map-title-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem
}

.map-title-row h2 {
  margin:0
}

.map-title-row span {
  font-size:.82rem;
  color:#64748b;
  background:#f1f5f9;
  padding:.35rem .6rem;
  border-radius:999px
}

#company-map {
  width:100%;
  height:390px;
  border-radius:18px;
  margin-top:1rem;
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.08)
}

.map-note {
  font-size:.88rem;
  color:#64748b;
  margin:.8rem 0 0
}

.company-marker {
  width:42px;
  height:42px;
  border-radius:14px;
  background:white;
  display:grid;
  place-items:center;
  font-size:22px;
  box-shadow:0 8px 24px rgba(15,23,42,.3);
  border:3px solid #0f766e
}

.company-marker:after {
  content:"";
  position:absolute;
  bottom:-8px;
  border:8px solid transparent;
  border-top-color:#0f766e;
  border-bottom:0
}

.mapboxgl-popup-content {
  border-radius:12px;
  padding:12px 14px;
  box-shadow:0 10px 30px rgba(15,23,42,.2)
}

.map-status.warning {
  background:#fff3cd;
  color:#7a5200;
  border:1px solid #f1d27a
}

.map-status.approximate {
  background:#e8f1ff;
  color:#174a7e;
  border:1px solid #b8d3f2
}

.municipality-marker {
  background:#fff;
  border:3px solid #245c87;
  color:#245c87;
  border-radius:50%;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  font-weight:800;
  box-shadow:0 4px 14px rgba(0,0,0,.22)
}

/* Company editing */
.panel-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem
}

.panel-heading h2 {
  margin:0
}

.edit-pencil {
  width:42px;
  height:42px;
  border-radius:50%;
  border:1px solid var(--line);
  background:#f7fafc;
  color:var(--n);
  font-size:23px;
  cursor:pointer;
  transition:.2s
}

.edit-pencil:hover {
  background:var(--n);
  color:#fff;
  transform:translateY(-1px)
}

.company-data {
  display:grid;
  grid-template-columns:145px 1fr;
  gap:8px 14px;
  margin-top:24px
}

.company-data dt {
  font-weight:700;
  color:#607487
}

.company-data dd {
  margin:0;
  color:var(--n);
  overflow-wrap:anywhere
}

.last-update {
  font-size:12px;
  color:#7b8c98;
  margin-top:24px
}

.edit-dialog {
  width:min(760px,calc(100% - 30px));
  border:0;
  border-radius:22px;
  padding:0;
  box-shadow:0 24px 80px rgba(15,35,55,.35)
}

.edit-dialog::backdrop {
  background:rgba(11,27,43,.55);
  backdrop-filter:blur(3px)
}

.edit-form {
  padding:28px
}

.dialog-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start
}

.dialog-heading h2 {
  margin:4px 0 18px;
  color:var(--n)
}

.eyebrow.dark {
  color:var(--g)
}

.dialog-close {
  border:0;
  background:#eef3f7;
  width:38px;
  height:38px;
  border-radius:50%;
  font-size:25px;
  cursor:pointer
}

.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px
}

.map-actions {
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:12px
}

.map-actions form {
  margin:0
}

.map-status.verified {
  background:#e6f6ed;
  color:#17633d;
  border:1px solid #a9ddbd
}

@media(max-width:800px) {
  .company-data {
    grid-template-columns:1fr
  }
  .company-data dt {
    margin-top:8px
  }
  .dialog-actions {
    flex-direction:column-reverse
  }
  .dialog-actions .btn {
    width:100%
  }
}

/* ===== FOT Survey interview redesign ===== */
.survey-shell {
  max-width:1080px;
  margin:0 auto
}

.survey-head {
  text-align:center;
  margin-bottom:22px
}

.survey-head h1 {
  margin:10px 0 16px;
  color:var(--n);
  font-size:clamp(2rem,4vw,3rem);
  line-height:1.05
}

.survey-company-meta {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,260px));
  justify-content:center;
  gap:12px;
  margin:0 auto 14px
}

.meta-card {
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:13px 16px;
  text-align:left;
  box-shadow:0 8px 24px rgba(16,42,67,.05)
}

.meta-card span {
  display:block;
  color:#748694;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:5px
}

.meta-card strong {
  display:block;
  color:var(--n);
  font-size:15px;
  overflow-wrap:anywhere
}

.survey-activity {
  max-width:760px;
  margin:0 auto;
  color:#627684;
  font-size:14px;
  line-height:1.5
}

.survey-progress-wrap {
  max-width:720px;
  margin:22px auto 0
}

.survey-progress-copy {
  display:flex;
  justify-content:space-between;
  gap:20px;
  margin-bottom:8px;
  color:#647987;
  font-size:12px;
  font-weight:700
}

.survey-progress-copy span:last-child {
  color:var(--g)
}

.progress {
  max-width:none;
  margin:0;
  height:8px;
  background:#dbe5ec
}

.step {
  display:none;
  min-height:0;
  padding:28px;
  border-radius:22px;
  box-shadow:0 12px 34px rgba(16,42,67,.055)
}

.step.active {
  display:block
}

.step-heading {
  display:flex;
  align-items:flex-start;
  gap:14px;
  margin-bottom:22px
}

.step-number {
  flex:0 0 42px;
  width:42px;
  height:42px;
  border-radius:13px;
  display:grid;
  place-items:center;
  background:#e8f5ef;
  color:var(--g);
  font-weight:800;
  font-size:18px
}

.step-number.success {
  background:var(--g);
  color:#fff
}

.step-heading h2 {
  margin:1px 0 6px;
  color:var(--n);
  font-size:25px
}

.step-heading p {
  margin:0;
  color:#6b7e8a;
  line-height:1.5
}

.explain-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:22px
}

.explain-card {
  display:flex;
  gap:13px;
  padding:17px;
  border:1px solid var(--line);
  border-radius:17px;
  background:#f8fbfc
}

.explain-card.inbound {
  border-left:4px solid #2f855a
}

.explain-card.outbound {
  border-left:4px solid #1f5f8b
}

.explain-icon {
  width:36px;
  height:36px;
  border-radius:11px;
  background:#fff;
  display:grid;
  place-items:center;
  color:var(--n);
  font-size:20px;
  font-weight:800;
  box-shadow:0 5px 14px rgba(16,42,67,.08)
}

.explain-card h3 {
  margin:0 0 5px;
  color:var(--n);
  font-size:16px
}

.explain-card p {
  margin:0;
  color:#637786;
  line-height:1.45;
  font-size:13px
}

.survey-fields {
  gap:18px
}

.survey-fields label,.flowgrid label {
  display:flex;
  flex-direction:column;
  color:#344c5b;
  font-size:13px;
  font-weight:700
}

.field-help {
  display:block;
  margin:4px 0 1px;
  color:#82919b;
  font-size:11px;
  font-weight:400;
  line-height:1.35
}

.survey-fields input,.survey-fields select,.survey-fields textarea,.flowgrid input,.flowgrid select {
  margin-top:7px;
  background:#fff
}

.choice-guide {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:22px
}

.choice-guide article {
  padding:16px;
  border-radius:15px;
  background:#f7fafb;
  border:1px solid var(--line)
}

.choice-guide strong {
  color:var(--n)
}

.choice-guide p {
  margin:6px 0 0;
  color:#6d7f8b;
  font-size:13px;
  line-height:1.4
}

.flow-help {
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin-bottom:16px
}

.flow-help span {
  background:#eff5f7;
  color:#607582;
  border-radius:999px;
  padding:7px 10px;
  font-size:12px
}

.flow {
  padding:20px;
  border-radius:18px;
  margin:0 0 16px;
  background:#fbfcfd
}

.flow-in {
  border-left:4px solid var(--g)
}

.flow-out {
  border-left:4px solid var(--b)
}

.flow-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:17px
}

.flow-title-wrap {
  display:flex;
  gap:12px;
  align-items:flex-start
}

.flow-direction-icon {
  width:36px;
  height:36px;
  border-radius:11px;
  background:#eef5f7;
  display:grid;
  place-items:center;
  color:var(--n);
  font-size:20px;
  font-weight:800
}

.flow-heading h3 {
  margin:0 0 4px;
  color:var(--n)
}

.flow-heading p {
  margin:0;
  color:#758690;
  font-size:12px;
  line-height:1.4
}

.flow-remove {
  border:0;
  background:#f5e9e9;
  color:#9f3434;
  padding:9px 12px;
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
  flex:0 0 auto
}

.flow-remove:hover {
  background:#eedada
}

.flowgrid {
  gap:14px
}

.flow-add-actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px
}

.flow-add {
  padding:11px 14px
}

.rail-journey {
  display:grid;
  grid-template-columns:auto 1fr auto 1fr auto 1fr auto;
  align-items:center;
  gap:10px;
  padding:22px;
  border-radius:18px;
  background:linear-gradient(135deg,#102a43,#1f5f8b);
  color:#fff;
  margin-bottom:20px
}

.journey-stop {
  text-align:center;
  min-width:120px
}

.journey-stop span {
  width:34px;
  height:34px;
  margin:0 auto 9px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#fff;
  color:#17395f;
  font-weight:800
}

.journey-stop strong {
  display:block;
  font-size:13px
}

.journey-stop small {
  display:block;
  margin-top:4px;
  color:rgba(255,255,255,.72);
  font-size:10px;
  line-height:1.3
}

.journey-line {
  height:3px;
  border-radius:999px;
  background:rgba(255,255,255,.45)
}

.rail-question {
  padding:17px 18px;
  margin-bottom:18px;
  border-radius:15px;
  background:#f3f8f6;
  border:1px solid #d9ece3
}

.rail-question h3 {
  margin:0 0 6px;
  color:var(--n);
  font-size:16px
}

.rail-question p {
  margin:0;
  color:#667b87;
  font-size:13px
}

.save-summary {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-bottom:20px
}

.save-summary article {
  display:flex;
  gap:12px;
  padding:17px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#f8fbfc
}

.save-summary article>span {
  font-size:22px
}

.save-summary strong {
  display:block;
  color:var(--n);
  margin-bottom:5px
}

.save-summary p {
  margin:0;
  color:#6d7e89;
  font-size:12px;
  line-height:1.45
}

.save-callout {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  padding:22px;
  border-radius:18px;
  background:linear-gradient(135deg,#edf7f3,#f7fbfa);
  border:1px solid #d7ebe2
}

.save-callout h3 {
  margin:6px 0;
  color:var(--n);
  font-size:21px
}

.save-callout p {
  margin:0;
  color:#6d7e89
}

.save-callout .btn.big {
  padding:14px 19px;
  white-space:nowrap
}

.survey-nav {
  align-items:center;
  margin-top:16px
}

.survey-nav .btn {
  min-width:105px;
  display:inline-flex;
  justify-content:center
}

@media(max-width:800px) {
  .survey-company-meta,.explain-grid,.choice-guide,.save-summary {
    grid-template-columns:1fr
  }
  .rail-journey {
    grid-template-columns:1fr;
    gap:8px
  }
  .journey-line {
    width:3px;
    height:22px;
    margin:auto
  }
  .journey-stop {
    min-width:0
  }
  .save-callout {
    align-items:flex-start;
    flex-direction:column
  }
  .save-callout .btn.big {
    width:100%
  }
  .step {
    padding:20px
  }
}

@media(max-width:560px) {
  .survey-progress-copy {
    align-items:flex-start;
    flex-direction:column;
    gap:3px
  }
  .flow-heading {
    flex-direction:column
  }
  .flow-remove {
    align-self:flex-end
  }
}

/* ===== Flexible load units ===== */
.load-details {
  margin-top:18px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  overflow:hidden
}

.load-details summary {
  cursor:pointer;
  list-style:none;
  padding:15px 17px;
  color:var(--n);
  font-weight:800;
  background:#f4f8fa;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px
}

.load-details summary::-webkit-details-marker {
  display:none
}

.load-details summary:after {
  content:"+";
  font-size:20px;
  color:var(--g)
}

.load-details[open] summary:after {
  content:"−"
}

.load-details summary span {
  margin-left:auto;
  margin-right:8px;
  color:#7b8d98;
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.06em
}

.load-details-intro {
  margin:16px 17px 4px;
  color:#6b7e8a;
  font-size:12px;
  line-height:1.45
}

.load-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:13px;
  padding:14px 17px 17px
}

.load-grid label {
  display:flex;
  flex-direction:column;
  color:#344c5b;
  font-size:12px;
  font-weight:700
}

.load-grid input {
  margin-top:7px
}

.tonnage-result {
  margin:0 17px 17px;
  padding:14px 16px;
  border-radius:13px;
  background:#f7fafb;
  border:1px dashed #ccd9e0;
  display:flex;
  flex-direction:column;
  gap:4px;
  color:#6d7e89
}

.tonnage-result strong {
  color:#536976
}

.tonnage-result span {
  font-size:11px;
  line-height:1.4
}

.tonnage-result.has-value {
  background:#edf8f2;
  border-style:solid;
  border-color:#b9dfca
}

.tonnage-result.has-value strong {
  color:#21734b;
  font-size:17px
}

.annual-units-field[hidden],.direct-tons-field[hidden] {
  display:none!important
}

@media(max-width:900px) {
  .load-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
}

@media(max-width:560px) {
  .load-grid {
    grid-template-columns:1fr
  }
  .load-details summary {
    align-items:flex-start;
    flex-wrap:wrap
  }
  .load-details summary span {
    margin-left:0
  }
}

/* Fix: avoid global header navbar styles on survey heading */
.survey-head {
  display:block;
  position:static;
  width:auto;
  height:auto;
  padding:0;
  background:transparent;
  border:0;
  z-index:auto;
}

/* Research notice on final survey step */
.research-notice {
  display:flex;
  gap:16px;
  align-items:flex-start;
  margin-bottom:20px;
  padding:20px;
  border:1px solid #d7e5ec;
  border-radius:17px;
  background:#f7fafc;
}

.research-notice-icon {
  flex:0 0 44px;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:#e8f5ef;
  font-size:22px;
}

.research-notice strong {
  display:block;
  margin-bottom:6px;
  color:var(--n);
  font-size:16px;
}

.research-notice p {
  margin:0;
  color:#657986;
  font-size:13px;
  line-height:1.55;
}

@media(max-width:560px) {
  .research-notice {
    flex-direction:column
  }
}

/* Branding Portale questionari FOT */
.brand-logo {
  width:42px;
  height:42px;
  object-fit:contain;
  flex:0 0 42px;
}

.brand b {
  display:flex;
  flex-direction:column;
  line-height:1.15;
}

.brand small {
  margin-top:3px;
  color:#607487;
  font-size:12px;
}

/* ===== Dashboard researcher redesign ===== */
.research-dashboard {
  display:grid;
  gap:16px
}

.dashboard-hero {
  display:block;
  padding:34px;
  border-radius:24px;
  color:#fff;
  background:linear-gradient(125deg,var(--n),var(--b));
  box-shadow:0 18px 42px rgba(16,42,67,.13);
}

.dashboard-hero h1 {
  max-width:760px;
  margin:8px 0 10px;
  color:#fff;
  font-size:clamp(2rem,4vw,2.8rem);
  line-height:1.08;
}

.dashboard-hero p {
  max-width:720px;
  margin:0;
  color:rgba(255,255,255,.82);
  font-size:15px;
}

.dashboard-kpis {
  margin:0
}

.dashboard-kpis div {
  min-height:98px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  box-shadow:0 8px 24px rgba(16,42,67,.04);
}

.dashboard-kpis span {
  margin-top:2px;
  color:#405768
}

.dashboard-toolbar {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:stretch;
  margin-top:2px;
}

.dashboard-filters {
  display:grid;
  grid-template-columns:minmax(260px,1fr) 220px 100px;
  gap:10px;
  margin:0;
}

.dashboard-filters input, .dashboard-filters select {
  height:46px;
  margin:0;
  background:#fff;
}

.dashboard-filters label {
  display:block
}

.filter-button, .export-action {
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.export-action {
  gap:8px;
  padding-left:18px;
  padding-right:18px;
  background:var(--n);
}

.export-action:hover {
  background:#183d5d
}

.active-filter-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:11px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:#617583;
  font-size:13px;
}

.active-filter-row a {
  color:var(--b);
  font-weight:700;
  text-decoration:none
}

.company-grid {
  margin-top:0
}

.company-list-card {
  display:flex;
  flex-direction:column;
  min-height:228px;
}

.company-card-top {
  min-height:25px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
}

.company-list-card h3 {
  margin:13px 0 9px;
  min-height:24px;
}

.company-list-card p {
  flex:1;
  min-height:0;
  margin:0 0 14px;
  line-height:1.35;
}

.company-card-meta {
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  color:#526978;
  font-size:12px;
  margin-bottom:2px;
}

.company-card-meta span+span:before {
  content:"·";
  margin-right:12px;
  color:#9aabb5;
}

.empty-dashboard-state {
  grid-column:1/-1;
  text-align:center;
  padding:50px 20px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
}

.empty-dashboard-state h2 {
  margin-top:0;
  color:var(--n)
}

.empty-dashboard-state p {
  color:#687d8a
}

.main-navigation a {
  color:var(--n);
  font-weight:700;
}

.sr-only {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

@media(max-width:900px) {
  .dashboard-toolbar {
    grid-template-columns:1fr
  }
  .export-action {
    justify-self:start
  }
}

@media(max-width:800px) {
  .dashboard-filters {
    grid-template-columns:1fr
  }
  .filter-button,.export-action {
    width:100%
  }
  .export-action {
    justify-self:stretch
  }
}

@media(max-width:560px) {
  .dashboard-hero {
    padding:25px
  }
  .active-filter-row {
    align-items:flex-start;
    flex-direction:column
  }
}

/* ===== Company archive and creation ===== */
.dashboard-primary-actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:0;
}

.form-page-shell {
  max-width:860px;
  margin:0 auto
}

.form-page-heading {
  text-align:center;
  margin-bottom:22px
}

.form-page-heading h1 {
  margin:8px 0;
  color:var(--n);
  font-size:clamp(2rem,4vw,2.8rem)
}

.form-page-heading p {
  margin:0;
  color:#687d8a
}

.company-create-card {
  padding:26px;
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  box-shadow:0 14px 36px rgba(16,42,67,.07);
}

.form-page-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px;
}

.archived-page {
  display:grid;
  gap:18px
}

.archived-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  padding:26px;
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
}

.archived-heading h1 {
  margin:7px 0;
  color:var(--n)
}

.archived-heading p {
  margin:0;
  color:#687d8a
}

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

.archived-search input {
  margin:0
}

.archived-company-card {
  display:flex;
  flex-direction:column;
  min-height:240px
}

.archive-date {
  color:#8999a3;
  font-size:11px
}

.archived-company-card h3 {
  margin:14px 0 9px
}

.archived-company-card p {
  flex:1
}

.archived-actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-top:14px;
}

.archived-actions form {
  margin:0
}

.archived-actions .btn {
  width:100%;
  display:flex;
  justify-content:center
}

@media(max-width:700px) {
  .archived-heading {
    flex-direction:column
  }
  .archived-search {
    grid-template-columns:1fr
  }
  .form-page-actions {
    flex-direction:column-reverse
  }
  .form-page-actions .btn {
    width:100%;
    text-align:center
  }
}

/* ===== Coherence, accessibility and final polish ===== */

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.btn,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(16, 42, 67, .12);
}

.btn:active {
  transform: translateY(0);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 95, 139, .18);
  outline-offset: 2px;
  border-color: var(--b);
}

textarea {
  resize: vertical;
}

header {
  box-shadow: 0 2px 12px rgba(16, 42, 67, .04);
}

.main-navigation a {
  padding: 8px 10px;
  border-radius: 9px;
}

.main-navigation a:hover {
  background: #eef4f7;
}

.company-card-top .rank {
  position: static;
  right: auto;
}

.card {
  box-shadow: 0 8px 24px rgba(16, 42, 67, .045);
}

.company-list-card,
.archived-company-card {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.company-list-card:hover,
.archived-company-card:hover {
  transform: translateY(-2px);
  border-color: #cbd9e1;
  box-shadow: 0 14px 34px rgba(16, 42, 67, .08);
}

.dashboard-primary-actions {
  justify-content: flex-end;
}

.dashboard-primary-actions .btn.alt {
  border: 1px solid #d7e2e8;
}

.archived-actions form,
.archive-company-form,
.delete-interview-form {
  margin: 0;
}

footer {
  margin-top: auto;
}

@media (max-width: 800px) {
  header {
    height: auto;
    min-height: 70px;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand b {
    min-width: 0;
  }

  .main-navigation {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .dashboard-primary-actions {
    justify-content: stretch;
  }

  .dashboard-primary-actions .btn {
    flex: 1 1 180px;
  }
}

@media (max-width: 560px) {
  header {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-navigation {
    width: 100%;
    justify-content: flex-start;
  }

  main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
}


/* ===== Dashboard action cards and company danger zone ===== */
.dashboard-action-cards{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.dashboard-action-card{
  display:flex;
  align-items:center;
  gap:15px;
  min-height:92px;
  padding:18px 20px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  color:var(--n);
  text-decoration:none;
  box-shadow:0 8px 24px rgba(16,42,67,.045);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.dashboard-action-card:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 32px rgba(16,42,67,.08);
  border-color:#c8d8e1;
}
.dashboard-action-icon{
  flex:0 0 48px;
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:15px;
  font-size:24px;
  font-weight:800;
}
.create-card .dashboard-action-icon{
  background:#e6f5ed;
  color:var(--g);
}
.archive-card .dashboard-action-icon{
  background:#edf2f5;
  color:var(--n);
}
.dashboard-action-card strong{
  display:block;
  margin-bottom:4px;
  font-size:16px;
}
.dashboard-action-card small{
  display:block;
  color:#687d8a;
  line-height:1.4;
  font-size:12px;
}

.content-grid{
  align-items:start;
}
.company-danger-zone{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:15px;
  align-items:center;
  margin-top:14px;
  padding:18px;
  border:1px solid #efcaca;
  border-radius:18px;
  background:#fff7f7;
  box-shadow:0 10px 28px rgba(126,42,42,.05);
}
.danger-zone-icon{
  flex:0 0 44px;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:#f9dede;
  font-size:21px;
}
.danger-zone-copy h3{
  margin:0 0 5px;
  color:#8f2f2f;
  font-size:16px;
}
.danger-zone-copy p{
  margin:0;
  color:#765858;
  font-size:12px;
  line-height:1.48;
}
.danger-action-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:10px 14px;
  border:1px solid #b93d3d;
  border-radius:11px;
  background:#b93d3d;
  color:#fff;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
  transition:background .16s ease,transform .16s ease,box-shadow .16s ease;
}
.danger-action-button:hover{
  background:#982f2f;
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(126,42,42,.16);
}
@media(max-width:800px){
  .dashboard-action-cards{
    grid-template-columns:1fr;
  }
  .company-danger-zone{
    grid-template-columns:auto 1fr;
  }
  .company-danger-zone form{
    grid-column:1/-1;
  }
  .danger-action-button{
    width:100%;
  }
}
@media(max-width:560px){
  .company-danger-zone{
    grid-template-columns:1fr;
  }
  .danger-zone-icon{
    width:40px;
    height:40px;
  }
}


/* Fix company two-column layout: profile + delete box on the left, map on the right */
.profile-column{
  display:grid;
  gap:14px;
  align-content:start;
}
.profile-column .company-danger-zone{
  margin-top:0;
}
.content-grid>.map-card{
  grid-column:2;
  grid-row:1;
}
@media(max-width:980px){
  .content-grid>.map-card{
    grid-column:auto;
    grid-row:auto;
  }
}
