* {
  box-sizing: border-box;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

html, body {
  height: auto;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  font-family: Arial, Helvetica, sans-serif;
  background-color: #084863;
}

/* Better mobile layout */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px;
}

.apptitle {
  width: 80%;
  text-align: center;
  font-size: 30px;
  font-weight: bold;
  color: aliceblue;
}

.reload_button {
  width: 10%;
  font-size: 35px;
  color: aliceblue;
  text-decoration: none;
  /*  float: right;
  margin-left: 5px;
  */
}

/* The grid: Three equal columns that floats next to each other */
.column {
  flex: 1 1 calc(50% - 6px);
  min-width: 280px;
  padding: 15px;
  margin: 0;
  text-align: left;
  font-size: 25px;
  min-height: 180px;
  color: white;
}

@media (max-width: 650px) {
  .row {
    flex-wrap: nowrap; /* keep both weather cards side-by-side */
    overflow-x: hidden; /* prevent horizontal scrolling in iOS standalone */
  }
  .column {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px;
    font-size: 18px;
    min-height: 0;
    overflow: hidden;
  }
  .inline-table { font-size: 14px; }

  .apptitle {
    font-size: 26px;
  }
  .reload_button {
    font-size: 30px;
  }
  .w3-input-l {
    width: 120px;
    padding: 8px;
    font-size: 14px;
  }

  .location,
  .time {
    font-size: 18px;
  }

  .containerTab {
    padding: 12px;
  }

  .accordion {
    padding: 12px;
    font-size: 14px;
  }

  .panel {
    padding: 0 12px;
  }

  .w3-input {
    width: calc(50% - 16px);
    margin-left: 0;
    margin-top: 6px;
    margin-bottom: 6px;
    padding: 12px;
    font-size: 18px;
  }

  /* iOS/mobile: keep location + time on one line */
  .inline-table { width: 100%; table-layout: fixed; }
  td.location, td.time { vertical-align: top; }
  td.time { width: 30%; white-space: nowrap; font-size: 16px; }
  td.location { width: 70%; font-size: 16px; }
  td.location span { 
    display: inline-block;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
  /* Make the two buttons fit without forcing wrap */
  #primaryLocationBtn, #compareLocationBtn { 
    font-size: 14px;
    padding: 6px 10px;
    margin-left: 8px;
  }

  /* Conversion tables: tighter + never trigger horizontal scroll */
  
.input-table {
  width: calc(100% - 20px);
  margin: 0 10px;
  color: aliceblue;
}
.grad-fahrenheit-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 14px;
  }
  .grad-fahrenheit-table td, .grad-fahrenheit-table th {
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .accordion {
    padding: 12px 14px;
    font-size: 16px;
  }
  .panel {
    padding: 10px 12px;
  }

}

.containerTab {
  padding: 20px;
  color: white;
}

/* NOTE: do not stack weather cards on very small screens.
   iOS standalone otherwise enables horizontal page scroll.
   Keep both cards in-view and let content wrap within. */

.inline-table {
  float: none;
  color: white;
  /* border: 1px solid;*/
  font-size: 12px;
  width: 100%;
  padding: 0px;
}

.inline-table td,
.inline-table th {
  word-break: break-word;
}

.location {
  font-size: 20px;
  word-break: break-word;
}

.time {
  font-size: 20px;
  text-align: right;
}

/* Accordion styles */

.accordion {
  background-color: #eee;
  color: #444;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 15px;
  transition: 0.4s;
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
}

.active,
.accordion:hover {
  background-color: #ccc;
  border-bottom-left-radius: 0px;
  border-bottom-right-radius: 0px;
}

.panel {
  padding: 0 18px;
  display: none;
  background-color: white;
  overflow: hidden;
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
}

.accordion:after {
  content: "\02795"; /* Unicode character for "plus" sign (+) */
  font-size: 13px;
  color: #777;
  float: right;
  margin-left: 5px;
}

.active:after {
  content: "\2796"; /* Unicode character for "minus" sign (-) */
}

/* Table Grad Fahrenheit */

.grad-fahrenheit-table {
  align-items: center;
  width: 100%;
  text-align: center;
}

.grad-fahrenheit-table .gf-border {
  border-bottom: 1px solid;
  border-color: rgb(200, 200, 200);
}

.w3-input {
  padding: 15px;
  margin-left: 35px;
  margin-top: 10px;
  margin-bottom: 10px;
  border: none;
  border-bottom: 1px solid #ccc;
  width: 35%;

  font-size: 20px;
}

.w3-div {
  align-items: center;
}

.w3-input-l {
  padding: 10px;
  margin-left: 5px;
  margin-top: 10px;
  margin-bottom: 10px;
  border: none;
  border-bottom: 1px solid #ccc;
  width: 100px;

  font-size: 16px;
}

/*
  .w3-margin-top{margin-top:16px!important} 
   .w3-half{width:49.99999%} 
  .w3-row-padding,.w3-row-padding>.w3-half,.w3-row-padding>.w3-third,.w3-row-padding>.w3-twothird,.w3-row-padding>.w3-threequarter,.w3-row-padding>.w3-quarter,.w3-row-padding>.w3-col{padding:0 8px}
  .w3-border{border:1px solid #ccc!important}
  */


/* Compare location picker (right weather card) */
.mini-btn{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  cursor: pointer;
}
.mini-btn.secondary{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.25);
}
.mini-btn:hover{ background: rgba(255,255,255,0.18); }

.compare-picker{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.compare-picker input{
  flex: 1 1 240px;
  min-width: 180px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}
.compare-picker input::placeholder{ color: rgba(255,255,255,0.7); }
.compare-status{
  flex: 1 1 100%;
  font-size: 12px;
  opacity: 0.9;
}
.compare-suggestions{
  flex: 1 1 100%;
  display: grid;
  gap: 6px;
  margin-top: 4px;
}
.compare-suggestions button{
  text-align: left;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  cursor: pointer;
}
.compare-suggestions button:hover{ background: rgba(255,255,255,0.12); }

.panel .grad-fahrenheit-table {
  width: calc(100% - 20px);
  margin: 0 10px;
}

.time-inline {
  float: right;
  font-size: 14px;
  opacity: 0.95;
  white-space: nowrap;
}
.time-cell {
  width: 72px;
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

@media (max-width: 650px) {
  .location { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .time { font-size: 14px; }
}

.inline-table { width: 100%; table-layout: fixed; }
.inline-table td { max-width: 100%; overflow: hidden; }


/* Weather card actions row (buttons moved to bottom) */
.weather-top-row .location { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-top-row .time-cell { text-align: right; white-space: nowrap; }
.weather-actions { padding-top: 8px; text-align: right; }
.weather-action-row .mini-btn { width: auto; }

/* Make right-side location label shorter display without overflowing */
.inline-table .location span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Slightly tighter actions on small screens */
@media (max-width: 480px) {
  .weather-actions { padding-top: 6px; }
}
