/* =========================
   Global sizing + wrapping safety
========================= */

*,
*::before,
*::after{
  box-sizing:border-box;
}

html,
body{
  max-width:100%;
  overflow-x:hidden;
}

h1,h2,h3,h4,p,div,span,a,td,th,label{
  overflow-wrap:break-word;
  word-wrap:break-word;
}

/* =========================
   Buttons
========================= */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:10px 18px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:#fff;
  text-decoration:none;
  font-weight:700;
  font-size:14px;
  line-height:1.2;
  cursor:pointer;
  transition:all .16s ease;
  max-width:100%;
  text-align:center;
  white-space:normal;
}

.btn:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.22);
}

.btn:active{
  transform:scale(.98);
}

.btn.orange{
  background:linear-gradient(180deg, #ff8a1f, #f97316);
  border-color:#f97316;
}

.btn.orange:hover{
  box-shadow:0 10px 20px rgba(249,115,22,.22);
}

.btn.dark{
  background:rgba(255,255,255,.04);
}

.btn.dark:hover{
  background:rgba(255,255,255,.08);
}

.btn.small{
  min-height:36px;
  padding:8px 14px;
  font-size:13px;
  line-height:1.2;
}

.btn.tuning{
  background:linear-gradient(180deg, rgba(59,130,246,.20), rgba(37,99,235,.16));
  border-color:rgba(59,130,246,.55);
  color:#dbe8ff;
  box-shadow:0 6px 18px rgba(37,99,235,.22);
}

.btn.tuning:hover{
  background:linear-gradient(180deg, rgba(59,130,246,.28), rgba(37,99,235,.22));
  border-color:rgba(96,165,250,.75);
  box-shadow:0 10px 24px rgba(37,99,235,.30);
}

/* =========================
   Cards / Panels
========================= */

.card,
.panel{
  background:linear-gradient(180deg, rgba(19,43,79,.96), rgba(12,29,56,.98));
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:18px;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
  color:#dce8ff;
  min-width:0;
  max-width:100%;
}

/* =========================
   Page header
========================= */

.page-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:24px;
}

.page-header h1{
  margin:0 0 4px;
  font-size:28px;
  line-height:1.1;
  color:#fff;
}

.subtitle{
  color:#aebfdf;
  font-size:15px;
  line-height:1.45;
}

/* =========================
   Forms
========================= */

label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  font-weight:700;
  color:#fff;
}

input,
select,
textarea{
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  color:#fff;
  border-radius:14px;
  padding:13px 14px;
  font-size:14px;
  line-height:1.4;
  outline:none;
  transition:all .15s ease;
  appearance:none;
  -webkit-appearance:none;
}

input::placeholder,
textarea::placeholder{
  color:#8ea3c7;
}

input:focus,
select:focus,
textarea:focus{
  border-color:rgba(59,130,246,.65);
  box-shadow:0 0 0 3px rgba(59,130,246,.14);
}

textarea{
  min-height:120px;
  resize:vertical;
}

select{
  background-color:rgba(255,255,255,.05);
  background-image:
    linear-gradient(45deg, transparent 50%, #aebfdf 50%),
    linear-gradient(135deg, #aebfdf 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
  padding-right:36px;
}

select option{
  background:#1b2f52;
  color:#fff;
}

select optgroup{
  background:#142746;
  color:#c7d5f2;
}

/* =========================
   Layout
========================= */

.page-shell-section{
  padding-bottom:32px;
}

.page-grid-2{
  display:grid;
  grid-template-columns:minmax(0, 1.2fr) minmax(300px, .9fr);
  gap:18px;
  min-width:0;
}

.form-row{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
  margin-bottom:16px;
}

.form-row > *{
  min-width:0;
}

.btn-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* =========================
   Shared content patterns
========================= */

.content-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}

.content-title-row h1{
  margin:0 0 8px;
  font-size:29px;
  line-height:1.06;
  color:#fff;
}

.content-meta{
  color:#9fb5d9;
  line-height:1.55;
  margin-bottom:12px;
  font-size:14px;
}

.content-meta a{
  color:#c7d5f2;
  text-decoration:none;
}

.content-meta a:hover{
  color:#fff;
}

.content-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}

.chip{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.06);
  color:#d8e6ff;
  font-size:12px;
  line-height:1;
  text-decoration:none;
}

.chip:hover{
  border-color:rgba(255,255,255,.14);
}

.date-pill{
  display:inline-flex;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  color:#fff;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
}

.content-notes{
  color:#d4e0f8;
  line-height:1.6;
  font-size:15px;
  margin-top:6px;
}

.section-block{
  margin-top:16px;
}

.section-block h3{
  margin:0 0 10px;
  font-size:16px;
  line-height:1.2;
  color:#fff;
}

/* =========================
   Tables / detail rows
========================= */

.detail-table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.detail-table{
  width:100%;
  border-collapse:collapse;
  min-width:0;
  table-layout:fixed;
}

.detail-table td{
  padding:10px 10px;
  border-bottom:1px solid rgba(255,255,255,.08);
  vertical-align:top;
  word-break:break-word;
  color:#dce8ff;
}

.detail-table td:first-child{
  width:42%;
  color:#9fb5d9;
  font-weight:700;
}

/* =========================
   Side media blocks
========================= */

.side-image{
  width:100%;
  display:block;
  border-radius:12px;
  background:#081121;
  border:1px solid rgba(255,255,255,.06);
}

.side-block{
  margin-bottom:16px;
}

.side-block:last-child{
  margin-bottom:0;
}

.side-block h3{
  margin:0 0 10px;
  font-size:16px;
  color:#fff;
}

.side-help{
  margin-top:12px;
  color:#9fb5d9;
  font-size:13px;
  line-height:1.5;
}

/* =========================
   Summary / dashboard cards
========================= */

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

.summary-card{
  background:linear-gradient(180deg, rgba(19,43,79,.96), rgba(12,29,56,.98));
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:16px 18px;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
  min-width:0;
}

.summary-label{
  color:#9fb5d9;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:8px;
}

.summary-value{
  color:#fff;
  font-size:28px;
  font-weight:900;
  line-height:1;
}

.soft-card{
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  padding:16px;
  background:rgba(255,255,255,.03);
  color:#dce8ff;
}

.soft-card h4{
  margin:0 0 8px;
  font-size:18px;
  line-height:1.15;
  color:#fff;
}

/* =========================
   Helpers
========================= */

.back-link{
  display:inline-block;
  margin-bottom:12px;
  color:#c7d5f2;
  text-decoration:none;
}

.back-link:hover{
  color:#fff;
}

.small{
  color:#9fb5d9;
  font-size:13px;
  line-height:1.45;
}

/* =========================
   Footer
========================= */

.site-footer{
  position:relative;
  margin-top:40px;
  padding:24px 0 28px;
  border-top:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(10,22,45,.96), rgba(6,16,34,.98));
  box-shadow:0 -8px 24px rgba(0,0,0,.18);
}

.site-footer::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:1px;
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0),
    rgba(255,255,255,.12),
    rgba(255,255,255,0)
  );
}

.site-footer-inner{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.footer-brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.footer-logo{
  width:40px;
  height:auto;
  flex:0 0 auto;
}

.footer-title{
  color:#f4f7ff;
  font-size:20px;
  font-weight:900;
  line-height:1.1;
}

.footer-subtitle{
  color:#9fb5d9;
  font-size:14px;
  line-height:1.4;
}

.footer-links{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
}

.footer-links a{
  color:#aebfdf;
  text-decoration:none;
  font-size:14px;
  font-weight:700;
  opacity:.85;
  transition:all .15s ease;
}

.footer-links a:hover{
  color:#fff;
  opacity:1;
}

.footer-meta{
  color:#8ea3c7;
  font-size:12px;
  line-height:1.4;
}

/* =========================
   MOBILE NAV
========================= */

.mobile-bottom-nav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:2000;
  display:flex;
  justify-content:space-around;
  align-items:flex-end;
  padding:10px 6px calc(14px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg, rgba(8,18,38,.95), rgba(6,14,30,.98));
  border-top:1px solid rgba(255,255,255,.06);
  box-shadow:0 -6px 20px rgba(0,0,0,.25);
  backdrop-filter:blur(10px);
}

.mobile-bottom-nav,
.mobile-bottom-nav *{
  text-decoration:none !important;
  border-bottom:none !important;
}

.mobile-bottom-nav__item,
.mobile-bottom-nav__item:link,
.mobile-bottom-nav__item:visited,
.mobile-bottom-nav__item:hover,
.mobile-bottom-nav__item:active{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  gap:4px;
  color:#a9bbdf;
  font-size:12px;
  font-weight:700;
  line-height:1.1;
  text-decoration:none !important;
  border-bottom:none !important;
  padding:0 4px;
}

.mobile-bottom-nav__item.active{
  color:#fff;
}

.mobile-bottom-nav__item:active{
  transform:translateY(1px);
}

.mobile-bottom-nav__icon{
  font-size:18px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
}

.mobile-bottom-nav__label{
  display:block;
  font-size:12px;
  line-height:1.1;
  text-align:center;
  white-space:nowrap;
  text-decoration:none !important;
}

.mobile-bottom-nav__item--primary{
  position:relative;
  transform:translateY(-10px);
}

.mobile-bottom-nav__item--primary .mobile-bottom-nav__icon{
  width:48px;
  height:48px;
  border-radius:999px;
  background:linear-gradient(180deg, #ff8a1f, #f97316);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  box-shadow:
    0 10px 24px rgba(249,115,22,.35),
    0 0 0 4px rgba(8,18,38,.9);
  overflow:visible;
}

.mobile-bottom-nav__item--primary.active .mobile-bottom-nav__icon{
  box-shadow:
    0 14px 30px rgba(249,115,22,.45),
    0 0 0 4px rgba(8,18,38,.9);
}

/* =========================
   Responsive
========================= */

@media (min-width: 760px){
  .site-footer-inner{
    flex-direction:row;
    align-items:center;
  }

  .footer-brand{
    flex:1;
  }

  .footer-links{
    flex:1;
    justify-content:center;
  }

  .footer-meta{
    flex:1;
    text-align:right;
    white-space:nowrap;
  }
}

@media (max-width: 1000px){
  .page-grid-2{
    grid-template-columns:1fr;
  }
}

@media (max-width: 900px){
  body{
    padding-bottom:88px;
  }

  .btn{
    min-height:48px;
  }

  .mobile-bottom-nav__item{
    padding:6px 4px 2px;
  }

  .mobile-bottom-nav__icon{
    font-size:20px;
  }

  .mobile-bottom-nav__item--primary .mobile-bottom-nav__icon{
    width:54px;
    height:54px;
    font-size:26px;
  }
}

@media (max-width: 800px){
  .form-row{
    grid-template-columns:1fr;
  }
  
  .grid-summary-3{
    grid-template-columns:1fr;
  }

  .page-header{
    flex-direction:column;
  }
}

@media (max-width: 700px){
  .site-footer{
    padding:22px 0 90px;
  }

  .card,
  .panel{
    padding:16px;
    border-radius:16px;
  }

  .btn{
    padding:10px 14px;
  }

  .page-shell-section{
    padding-bottom:24px;
  }

  .page-header{
    margin-bottom:18px;
  }

  .page-header h1{
    font-size:24px;
  }

  .subtitle{
    font-size:14px;
  }

  .content-title-row{
    margin-bottom:10px;
    gap:10px;
    flex-direction:column;
    align-items:flex-start;
  }

  .content-title-row h1{
    font-size:24px;
    margin-bottom:6px;
  }

  .content-meta{
    font-size:14px;
    margin-bottom:10px;
    line-height:1.5;
  }

  .content-chips{
    gap:7px;
    margin-bottom:12px;
  }

  .chip{
    font-size:11px;
    padding:7px 9px;
  }

  .date-pill{
    font-size:12px;
    padding:8px 10px;
  }

  .content-notes{
    font-size:14px;
    line-height:1.55;
  }

  .section-block{
    margin-top:14px;
  }

  .section-block h3{
    font-size:15px;
    margin-bottom:8px;
  }

  .detail-table td{
    padding:9px 8px;
    font-size:14px;
  }

  .detail-table td:first-child{
    width:38%;
  }
  
  .summary-card{
    padding:16px;
    border-radius:16px;
  }

  .summary-value{
    font-size:24px;
  }

  .soft-card{
    padding:14px;
  }
}

@media (min-width: 900px){
  .mobile-bottom-nav{
    display:none;
  }
}

body[data-preview-view="mobile"] .mobile-bottom-nav{
  display:flex;
}

@media (min-width: 900px){
  body[data-preview-view="desktop"] .mobile-bottom-nav{
    display:none;
  }
}