/* HeatSafe — base styles */

* {
 box-sizing: border-box;
 margin: 0;
 padding: 0;
}

body {
 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
 background: #f7f7f5;
 color: #1a1a1a;
 line-height: 1.5;
 padding: 20px;
 min-height: 100vh;
}

main {
 max-width: 600px;
 margin: 0 auto;
}

header {
 margin-bottom: 20px;
}

h1 {
 font-size: 30px;
 font-weight: 600;
 letter-spacing: -0.5px;
}

.tagline {
 font-size: 14px;
 color: #444;
 margin-top: 10px;
 line-height: 1.5;
 max-width: 95%;
}

#location {
 font-size: 15px;
 color: #555;
 margin-top: 10px;
}

.loc-country-in {
 color: #555;
}

.loc-country-out {
 color: #b8860b;
 font-weight: 600;
}

/* Cards */

.card {
 background: #fff;
 border-radius: 12px;
 padding: 20px;
 border: 1px solid #e5e5e5;
 transition: background 0.6s ease, color 0.6s ease, border-color 0.6s ease;
}

.card .label {
 font-size: 14px;
 text-transform: lowercase;
 letter-spacing: 0.03em;
 color: #555;
 margin-bottom: 14px;
 font-weight: 500;
}

.card .value-row {
 display: flex;
 align-items: flex-end;
 gap: 6px;
}

.card .value {
 font-size: 68px;
 font-weight: 500;
 line-height: 1;
 letter-spacing: -2px;
}

.card .value .unit {
 font-size: 26px;
 font-weight: 400;
 opacity: 0.65;
 letter-spacing: 0;
 margin-left: 2px;
 vertical-align: baseline;
}

.card .trend {
 font-size: 36px;
 line-height: 1;
 margin-bottom: 6px;
}

.card .value-f {
 font-size: 22px;
 font-weight: 400;
 opacity: 0.7;
 margin-top: 6px;
 letter-spacing: -0.5px;
}

.card .value-f .unit-small {
 font-size: 15px;
 opacity: 0.85;
 margin-left: 1px;
 vertical-align: baseline;
}

.card .sub {
 font-size: 15px;
 margin-top: 12px;
 opacity: 0.85;
 font-weight: 500;
}

/* Primary section — survival card */

.primary {
 margin-bottom: 10px;
}

/* Survival card color states — stronger saturation */

.survival {
 text-align: center;
}   

.survival .temp-group {
 display: inline-block;
 text-align: left;
}

.survival .temp-group .value-f {
 text-align: left;
 margin-left: 2px;
}

.survival .value-row {
 justify-content: center;
}

.survival .threshold-bar {
 justify-content: center;
}

.survival.safe {
 background: #D8EBC2;
 color: #1E4008;
 border-color: #a9c884;
}

.survival.caution {
 background: #F6DFB3;
 color: #4A2A04;
 border-color: #d4b878;
}

.survival.danger {
 background: #F5D3C3;
 color: #5A1F0C;
 border-color: #d4a78e;
}

.survival.high-danger {
 background: #F5C5C5;
 color: #5E1515;
 border-color: #d49696;
}

.survival.critical {
 background: #E87575;
 color: #3B0A0A;
 border-color: #c95555;
}

/* Threshold bar inside survival card */

.threshold-bar {
 display: flex;
 gap: 6px;
 margin-top: 14px;
 padding-top: 14px;
 border-top: 1px solid rgba(0, 0, 0, 0.15);
 font-size: 12px;
 flex-wrap: wrap;
}

.threshold-bar span {
 padding: 3px 8px;
 border-radius: 4px;
 background: rgba(255, 255, 255, 0.6);
 color: inherit;
 opacity: 0.9;
 white-space: nowrap;
 font-weight: 500;
}

/* Context cards — outdoor and body, smaller */

.context {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 8px;
 margin-bottom: 20px;
 max-width: 90%;
 margin-left: auto;
 margin-right: auto;
}

.context .card {
 padding: 14px 16px;
}

.label-small {
 font-size: 13px;
 text-transform: lowercase;
 letter-spacing: 0.03em;
 color: #555;
 margin-bottom: 10px;
 font-weight: 500;
}

.value-medium {
 font-size: 34px;
 font-weight: 500;
 line-height: 1;
 letter-spacing: -1px;
}

.value-medium .unit {
 font-size: 16px;
 font-weight: 400;
 opacity: 0.6;
 margin-left: 2px;
 vertical-align: baseline;
}

.value-f-small {
 font-size: 16px;
 color: #666;
 margin-top: 4px;
 letter-spacing: -0.3px;
}

.value-f-small .unit-small {
 font-size: 13px;
 margin-left: 1px;
 vertical-align: baseline;
}

.sub-small {
 font-size: 13px;
 color: #666;
 margin-top: 8px;
 font-style: italic;
}

.body-ref-card {
 background: #fafaf8;
}

.body-temp-c,
.body-temp-f {
 color: #444;
}

/* Search */

.search {
 display: flex;
 gap: 8px;
 margin-bottom: 10px;
}

.search input {
 flex: 1;
 padding: 12px 14px;
 border: 1px solid #c5c5c5;
 border-radius: 8px;
 font-size: 16px;
 font-family: inherit;
}

.search input:focus {
 outline: none;
 border-color: #666;
}

.search button {
 padding: 12px 20px;
 border: 1px solid #1a1a1a;
 background: #1a1a1a;
 color: #fff;
 border-radius: 8px;
 font-size: 15px;
 font-family: inherit;
 cursor: pointer;
 font-weight: 500;
}

.search button:hover {
 background: #333;
}

.search button#my-location {
 background: #fff;
 color: #1a1a1a;
 padding: 12px 14px;
 font-size: 18px;
}

.search button#my-location:hover {
 background: #f0f0f0;
}

/* Suggestions */

.suggestions {
 display: flex;
 flex-wrap: wrap;
 gap: 6px;
 align-items: center;
 margin-bottom: 12px;
 min-height: 0;
}

.suggest-intro {
 font-size: 13px;
 color: #555;
 margin-right: 4px;
}

.suggest-chip {
 font-size: 13px;
 padding: 7px 12px;
 border-radius: 16px;
 border: 1px solid #c5c5c5;
 background: #fff;
 cursor: pointer;
 font-family: inherit;
 color: #222;
}

.suggest-chip:hover {
 background: #f0f0f0;
 border-color: #888;
}

.error {
 font-size: 14px;
 color: #a0302d;
 min-height: 20px;
 margin-bottom: 20px;
 font-weight: 500;
}

footer {
 margin-top: 40px;
 padding-top: 20px;
 border-top: 1px solid #e5e5e5;
}

.credit {
 font-size: 12px;
 color: #888;
}

/* Location differentiation from tagline */

#location {
 font-size: 16px;
 color: #333;
 margin: 20px auto;
 font-weight: 500;
 text-align: center;
 padding: 10px 16px;
 background: #fff;
 border: 1px solid #e5e5e5;
 border-radius: 8px;
 display: inline-block;
 width: auto;
}

.header-location-wrap {
 text-align: center;
 margin-bottom: 16px;
}

.loc-pin {
 font-size: 14px;
 margin-right: 4px;
}

.loc-text {
 vertical-align: middle;
}

/* Trend word next to arrow */

.card .trend {
 font-size: 32px;
 line-height: 1;
 margin-bottom: 6px;
}

.trend-word {
 font-size: 16px;
 font-weight: 500;
 margin-left: 6px;
 vertical-align: middle;
 opacity: 0.85;
}

/* Humidity prominence with color coding */

.humidity-display {
 display: flex;
 flex-direction: column;
 gap: 2px;
 margin-top: 14px;
 padding: 10px 12px;
 border-radius: 8px;
 font-size: 16px;
 font-weight: 500;
 transition: background 0.3s, color 0.3s;
}

.hum-label {
 font-size: 13px;
 opacity: 0.8;
 text-transform: lowercase;
}

.hum-value {
 font-size: 20px;
 font-weight: 600;
 letter-spacing: -0.5px;
}

.hum-low {
 background: #EAF3DE;
 color: #1E4008;
}

.hum-mid {
 background: #F6DFB3;
 color: #4A2A04;
}

.hum-high {
 background: #F5C5C5;
 color: #5E1515;
}

/* Status interpretation sentence */

.status-sentence {
 display: block;
 font-size: 13px;
 font-weight: 400;
 margin-top: 6px;
 opacity: 0.85;
 line-height: 1.4;
}

/* Humidity physics sentence */

.hum-sentence {
 font-size: 12px;
 font-weight: 400;
 opacity: 0.9;
 margin-top: 4px;
 line-height: 1.4;
 width: 100%;
}

.humidity-display {
 flex-wrap: wrap;
}

/* Mobile */
@media (max-width: 480px) {
 body {
 padding: 16px;
 }
 h1 {
 font-size: 26px;
 }
 .card .value {
 font-size: 58px;
 }
 .value-medium {
 font-size: 30px;
 }
 .context {
 max-width: 100%;
 gap: 6px;
 }
}