/* =============================================
   RESET & VARIABLES
   ============================================= */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg: #F8F6F1;
  --bg-alt: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F1EDE4;
  --text: #1B1B1F;
  --text-2: #5A5A5E;
  --text-3: #9A9A9E;
  --accent: #E8553D;
  --accent-2: #3D5AE8;
  --accent-3: #10A37F;
  --border: #E5E1D8;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 50px;
  --font-d: 'Playfair Display', Georgia, serif;
  --font-b: 'DM Sans', system-ui, sans-serif;
  --font-m: 'JetBrains Mono', monospace;
  --shadow-1: 0 1px 3px rgba(27,27,31,.04), 0 4px 12px rgba(27,27,31,.06);
  --shadow-2: 0 4px 6px rgba(27,27,31,.04), 0 10px 30px rgba(27,27,31,.08);
  --shadow-3: 0 8px 16px rgba(27,27,31,.06), 0 20px 50px rgba(27,27,31,.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .03;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

.main { position: relative; z-index: 1; }

/* =============================================
   HEADER
   ============================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,246,241,.82);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-d);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.02em;
}
.logo-dot { color: var(--accent); }

.nav { display: flex; gap: 8px; }

.nav-link {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all .2s;
}
.nav-link:hover { color: var(--text); background: var(--surface-alt); }
.nav-link.active { color: var(--accent); background: rgba(232,85,61,.08); }

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}
.menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .25s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================
   SECTIONS
   ============================================= */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-family: var(--font-d);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.section-badge {
  font-size: .75rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(232,85,61,.08);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* =============================================
   SEARCH MODULE — Gradient BG + pill bar
   ============================================= */
.search-section {
  text-align: center;
  padding-top: 80px;
  padding-bottom: 64px;
  background:
    radial-gradient(ellipse at 25% 40%, rgba(232,85,61,.08) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 60%, rgba(61,90,232,.06) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 90%, rgba(16,163,127,.05) 0%, transparent 50%);
}

.search-title {
  font-family: var(--font-d);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 8px;
  animation: fadeUp .7s ease both;
}
.search-sub {
  color: var(--text-2);
  font-size: 1.05rem;
  margin-bottom: 40px;
  animation: fadeUp .7s ease .1s both;
}

.search-box {
  max-width: 620px;
  margin: 0 auto;
  animation: fadeUp .7s ease .2s both;
}

.search-engine-toggle {
  display: inline-flex;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: var(--shadow-1);
  margin-bottom: 16px;
}

.engine-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all .25s;
}
.engine-btn.active {
  background: var(--text);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.engine-btn:not(.active):hover { color: var(--text); }

.search-form {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
  border: 1.5px solid transparent;
  overflow: hidden;
  transition: border-color .3s, box-shadow .3s;
}
.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-2), 0 0 0 4px rgba(232,85,61,.1);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px 24px;
  font-size: 1rem;
  background: transparent;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-3); }

.search-submit {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border: none;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin: 3px;
  transition: transform .2s, box-shadow .2s;
}
.search-submit:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(232,85,61,.35);
}

/* =============================================
   WEATHER MODULE — Two-panel card
   ============================================= */
.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.weather-main {
  background: linear-gradient(145deg, #6C63FF, #4ECDC4);
  border-radius: var(--radius);
  padding: 36px;
  color: #fff;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}
.weather-main::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.weather-location {
  font-size: .9rem;
  opacity: .85;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.weather-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.weather-temp {
  font-family: var(--font-d);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.weather-desc {
  font-size: 1rem;
  opacity: .9;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.weather-divider {
  height: 1px;
  background: rgba(255,255,255,.2);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.weather-details {
  display: flex;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.weather-detail { display: flex; flex-direction: column; gap: 2px; }
.weather-detail-label { font-size: .75rem; opacity: .7; }
.weather-detail-value { font-weight: 600; font-size: .95rem; }

.weather-forecast {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forecast-day {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-1);
  transition: transform .2s;
}
.forecast-day:hover { transform: translateX(4px); }
.forecast-day-name { font-weight: 600; font-size: .9rem; }
.forecast-day-icon { font-size: 1.4rem; }
.forecast-day-temps {
  font-size: .85rem;
  color: var(--text-2);
  font-weight: 500;
}
.forecast-day-temps span { color: var(--accent); font-weight: 600; }

/* =============================================
   QUICK LINKS MODULE — Masonry-inspired grid
   ============================================= */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 16px;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  position: relative;
  animation: fadeUp .5s ease both;
}
.quick-link:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-3);
}
.quick-link-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: var(--surface-alt);
}
.quick-link-name {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.quick-link .remove-link {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  display: none;
  place-items: center;
  line-height: 1;
}
.quick-link:hover .remove-link { display: grid; }

.add-link-btn {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px dashed var(--border);
  background: transparent;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all .2s;
}
.add-link-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,85,61,.04);
}

/* =============================================
   NEWS MODULE — Magazine cards
   ============================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.news-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  animation: fadeUp .5s ease both;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
}

.news-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(1 #764ba2);
}
.news-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.news-card-source {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.news-card-title {
  font-family: var(--font-d);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-date { font-size: .78rem; color: var(--text-3); margin-top: auto; }
.news-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap .2s;
}
.news-card-link:hover { gap: 8px; }

/* =============================================
   TOOLS MODULE — Distinct card styles
   ============================================= */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tool-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-1);
  transition: box-shadow .3s;
  animation: fadeUp .535deg, #667eea,s ease both;
}
.tool-card:hover { box-shadow: var(--shadow-2); }

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.tool-icon { font-size: 1.3rem; }
.tool-name { font-weight: 600; font-size: .95rem; }

/* Calculator */
.calc-display {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: var(--font-m);
  font-size: 1.8rem;
  font-weight: 500;
  text-align: right;
  margin-bottom: 16px;
  overflow: hidden;
  word-break: break-all;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-btn {
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 500;
  background: var(--surface-alt);
  color: var(--text);
  transition: all .15s;
}
.calc-btn:hover { background: #E5E1D8; }
.calc-btn:active { transform: scale(.95); }
.calc-btn.op { color: var(--accent); background: rgba(232,85,61,.06); }
.calc-btn.op:hover { background: rgba(232,85,61,.12); }
.calc-btn.wide { grid-column: span 2; }

/* Color Picker */
.color-swatch {
  width: 100%;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}
.color-swatch input[type="color"] {
  width: 120%;
  height: 120%;
  border: none;
  cursor: pointer;
  position: absolute;
  top: -10%;
  left: -10%;
}

.color-info { display: flex; flex-direction: column; gap: 8px; }
.color-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.color-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.color-value {
  font-family: var(--font-m);
  font-size: .82rem;
  color: var(--text-2);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: background .2s;
}
.color-value:hover { background: var(--surface-alt); }

/* Timer */
.timer-display {
  font-family: var(--font-m);
  font-size: 2.4rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: .02em;
}

.timer-progress {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}
.timer-progress-bar {
  height: 100%;
  background: var(--accent-3);
  border-radius: 3px;
  width: 0%;
  transition: width 1s linear;
}

.timer-inputs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.timer-inputs input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  text-align: center;
  outline: none;
  background: var(--bg);
  transition: border-color .2s;
}
.timer-inputs input:focus { border-color: var(--accent); }

.timer-controls { display: flex; gap: 8px; }
.timer-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-2);
  transition: all .2s;
}
.timer-btn:hover { background: #E5E1D8; color: var(--text); }
.timer-btn.start { background: var(--accent-3); color: #fff; }
.timer-btn.start:hover { background: #0E9070; }

/* Notepad */
.notepad-area {
  width: 100%;
  height: 140px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: .9rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color .2s;
}
.notepad-area:focus { border-color: var(--accent-2); }

.notepad-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: .78rem;
  color: var(--text-3);
}
.notepad-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  font-size: .78rem;
  color: var(--text-2);
  transition: all .2s;
}
.notepad-btn:hover { border-color: var(--accent-2); color: var(--accent-2); }

/* Converter */
.converter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  margin-bottom: 12px;
  cursor: pointer;
}
.converter-select:focus { border-color: var(--accent); }

.converter-row {
  display: flex;
  gap: 10px;
}
.converter-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.converter-input:focus { border-color: var(--accent); }
.converter-input[readonly] { background: var(--surface-alt); font-weight: 600; }

.converter-arrow {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-3);
  margin: 6px 0;
}

/* Text Tool */
.text-tool-input {
  width: 100%;
  height: 80px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: .9rem;
  resize: none;
  outline: none;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
}
.text-tool-input:focus { border-color: var(--accent); }

.text-tool-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.text-tool-btn {
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-2);
  transition: all .2s;
}
.text-tool-btn:hover {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}
.footer-links a {
  font-size: .85rem;
  color: var(--text-2);
  transition: color .2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: .78rem; color: var(--text-3); }

/* =============================================
   SCROLL TO TOP
   ============================================= */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--text);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(12px);
  transition: all .3s;
  z-index: 90;
  pointer-events: none;
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top:hover { background: var(--accent); }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27,27,31,.4);
  backdrop-filter: blur(8px);
  display: none;
  place-items: center;
  z-index: 200;
}
.modal-overlay.open { display: grid; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-3);
  animation: fadeUp .3s ease;
}
.modal-title {
  font-family: var(--font-d);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  margin-bottom: 12px;
  background: var(--bg);
  color: var(--text);
}
.modal-input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.modal-btn {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  transition: all .2s;
}
.modal-btn.cancel { background: var(--surface-alt); color: var(--text-2); }
.modal-btn.confirm { background: var(--accent); color: #fff; }
.modal-btn.confirm:hover { background: #D04A34; }

/* =============================================
   LOADING SKELETON
   ============================================= */
.loading-skeleton { display: flex; flex-direction: column; gap: 12px; }
.skeleton-line {
  height: 18px;
  background: linear-gradient(90deg, var(--surface-alt) 25%, #e8e4db 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 20px; }

  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 20px;
    box-shadow: var(--shadow-2);
  }
  .nav.open { display: flex; }
  .menu-btn { display: flex; }

  .section { padding: 32px 20px; }

  .search-title { font-size: 1.8rem; }
  .search-section { padding-top: 50px; padding-bottom: 40px; }

  .weather-grid { grid-template-columns: 1fr; }

  .tools-grid { grid-template-columns: 1fr; }

  .news-grid { grid-template-columns: 1fr; }

  .quick-links-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; }
  .quick-link { padding: 16px 8px; }
  .quick-link-icon { width: 40px; height: 40px; font-size: 1.2rem; }

  .text-tool-btns { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .search-form { flex-direction: row; border-radius: var(--radius); }
  .search-input { padding: 14px 18px; }
  .search-submit { width: 100%; border-radius: var(--radius-sm); margin: 0; height: 50px; }

  .weather-main { padding: 24px; }
  .weather-temp { font-size: 2.6rem; }
  .weather-icon { font-size: 2.8rem; }
  .weather-details { gap: 16px; flex-wrap: wrap; }

  .calc-display { font-size: 1.4rem; }
  .timer-display { font-size: 1.8rem; }
}

/* =============================================
   PRIVACY / TERMS PAGES
   ============================================= */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 32px 60px;
  animation: fadeUp .6s ease;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-top: 40px;
  margin-bottom: 40px;
}
.legal-page h1 {
  font-family: var(--font-d);
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.02em;
  text-align: center;
}
.legal-updated {
  font-size: .85rem;
  color: var(--text-3);
  margin-bottom: 40px;
  text-align: center;
}
.legal-page h2 {
  font-family: var(--font-d);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
  letter-spacing: -0.01em;
}
.legal-page h3 {
  font-family: var(--font-d);
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.legal-page p {
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 16px;
}

.legal-toc {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
  border: 1px solid var(--border);
}

.legal-toc h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.1rem;
  color: var(--text);
}

.legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.legal-toc-list li {
  margin-bottom: 0;
}

.legal-toc-list a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: all .2s;
  font-size: .9rem;
}

.legal-toc-list a:hover {
  background: var(--accent);
  color: #fff;
  transform: translateX(4px);
}
.legal-page ul {
  padding-left: 24px;
  margin-bottom: 20px;
  margin-top: 12px;
}
.legal-page li {
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 8px;
  position: relative;
}

.legal-page strong {
  color: var(--text);
  font-weight: 600;
}

.legal-page .mm {
  color: var(--accent);
  font-weight: 500;
}

.legal-page a {
  color: var(--accent);
  text-decoration: none;
  transition: all .2s;
  position: relative;
}

.legal-page a:hover {
  text-decoration: underline;
  color: var(--accent-2);
}

.legal-section {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.legal-nav {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid var(--accent);
  justify-content: space-between;
  flex-wrap: wrap;
}
.legal-nav a {
  font-size: .9rem;
  color: var(--accent);
  font-weight: 600;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: rgba(232,85,61,.08);
}
.legal-nav a:hover {
  gap: 8px;
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232,85,61,.3);
}

@media (max-width: 768px) {
  .legal-page {
    padding: 32px 20px 48px;
    margin-top: 24px;
    margin-bottom: 24px;
  }
  .legal-page h1 { font-size: 1.8rem; }
  .legal-page h2 { font-size: 1.3rem; }
  .legal-page h3 { font-size: 1.1rem; }
  .legal-page p, .legal-page li { font-size: .9rem; }
  
  .legal-toc {
    padding: 16px;
    margin: 24px 0;
  }
  
  .legal-toc-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .legal-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .legal-nav a {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .legal-page {
    padding: 24px 16px 40px;
  }
  
  .legal-page h1 { font-size: 1.6rem; }
  .legal-page h2 { font-size: 1.2rem; }
  
  .legal-toc {
    padding: 12px;
  }
  
  .legal-nav a {
    padding: 8px 12px;
    font-size: .85rem;
  }
}
