:root {
  --background: #f7f5ef;
  --foreground: #101820;
  --muted: #66706a;
  --panel: #fffcf6;
  --line: #d8d2c7;
  --line-strong: #c9bcae;
  --coral: #e36f4f;
  --coral-soft: #f8d8c8;
  --green: #102f31;
  --green-soft: #dce7d8;
  --gold: #c98b2e;
  --footer: #102f31;
  --shadow: 0 18px 42px rgba(16, 24, 32, 0.1);
  --card-shadow: 0 8px 18px rgba(16, 24, 32, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #f7f5ef 0%, #efebe2 100%),
    var(--background);
  color: var(--foreground);
  font-family: "Segoe UI", Inter, Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  padding: 76px 32px 56px;
}

.tool-panel {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 0 32px 28px;
  border: 1px solid rgba(216, 210, 199, 0.72);
  border-radius: 6px;
  background: rgba(255, 252, 246, 0.72);
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.06);
}

.sticky-workbench {
  position: sticky;
  top: 58px;
  z-index: 15;
  margin: 0 -32px;
  padding: 12px 32px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px 6px 0 0;
  background: var(--green);
  box-shadow: 0 10px 28px rgba(16, 24, 32, 0.16);
  backdrop-filter: blur(12px);
}

.fixed-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.95);
  box-shadow: 0 10px 28px rgba(16, 24, 32, 0.08);
  backdrop-filter: blur(10px);
}

.fixed-header h1 {
  margin: 0;
  color: var(--green);
  font-family: "Segoe UI", Inter, Arial, Helvetica, sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.bookmark-area {
  position: relative;
}

.bookmark-button {
  min-height: 34px;
  border: 1px solid rgba(16, 47, 49, 0.22);
  border-radius: 6px;
  padding: 0 14px;
  background: rgba(16, 47, 49, 0.04);
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
}

.bookmark-button:hover,
.bookmark-button:focus {
  border-color: var(--green);
  background: rgba(16, 47, 49, 0.08);
  outline: none;
}

.bookmark-button.attention {
  animation: bookmarkPulse 900ms ease-in-out 10;
}

.bookmark-tip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: 270px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(16, 24, 32, 0.16);
  color: var(--foreground);
}

.bookmark-tip strong,
.bookmark-tip span {
  display: block;
}

.bookmark-tip strong {
  margin-bottom: 5px;
  color: var(--green);
  font-size: 0.92rem;
}

.bookmark-tip span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

@keyframes bookmarkPulse {
  0%,
  100% {
    border-color: rgba(16, 47, 49, 0.22);
    background: rgba(16, 47, 49, 0.04);
    box-shadow: 0 0 0 0 rgba(227, 111, 79, 0);
    transform: translateY(0);
  }
  40% {
    border-color: var(--coral);
    background: rgba(227, 111, 79, 0.14);
    box-shadow:
      0 0 0 5px rgba(227, 111, 79, 0.18),
      0 8px 18px rgba(16, 24, 32, 0.14);
    transform: translateY(-2px) scale(1.03);
  }
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) minmax(160px, 0.85fr) minmax(300px, 1.2fr) minmax(110px, 0.45fr);
  gap: 14px;
  align-items: end;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.controls label,
.time-control,
.date-control,
.format-control,
.calendar-row,
.search {
  display: grid;
  gap: 5px;
}

.city-combobox {
  position: relative;
}

.time-control {
  position: relative;
}

.time-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.controls span,
.time-control > span,
.time-label-row span,
.date-control > span,
.format-control > span,
.calendar-row span,
.search span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.now-button {
  min-height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.now-button:hover,
.now-button:focus {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

input[type="date"],
input[type="text"],
input[type="search"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: var(--panel);
  color: #111;
  outline: none;
}

input[type="date"],
input[type="text"] {
  padding: 0 16px;
}

input[type="search"] {
  padding: 0 16px;
}

.time-picker-field {
  position: relative;
}

.time-picker-field input {
  padding-right: 48px;
}

.time-trigger {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(16, 24, 32, 0.08);
  border-radius: 0 7px 7px 0;
  background: transparent;
  color: var(--green);
}

.time-trigger:hover,
.time-trigger:focus {
  background: rgba(16, 47, 49, 0.08);
  outline: none;
}

.time-trigger .time-icon {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid var(--green);
  border-radius: 999px;
  color: var(--green);
}

.time-trigger .time-icon::before,
.time-trigger .time-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  border-radius: 999px;
  background: var(--green);
  transform-origin: top center;
}

.time-trigger .time-icon::before {
  height: 5px;
  transform: translate(-50%, -1px) rotate(0deg);
}

.time-trigger .time-icon::after {
  height: 6px;
  transform: translate(-50%, -1px) rotate(125deg);
}

.time-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 36;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 252, 246, 0.98);
  box-shadow: 0 18px 40px rgba(16, 24, 32, 0.2);
}

.time-column {
  min-width: 0;
}

.time-column-title {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.time-column-options {
  display: grid;
  gap: 4px;
  max-height: 188px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.period-column {
  width: 66px;
}

.time-option {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--foreground);
  text-align: center;
}

.time-option:hover,
.time-option:focus {
  background: var(--green-soft);
  outline: none;
}

.time-option.selected {
  background: var(--coral);
  color: #ffffff;
}

input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(223, 116, 87, 0.16);
}

input.invalid {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(227, 111, 79, 0.18);
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 30;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.98);
  box-shadow: 0 18px 40px rgba(69, 43, 24, 0.16);
}

.suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(220, 203, 178, 0.72);
  background: transparent;
  color: #111;
  text-align: left;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover,
.suggestion:focus {
  background: var(--coral-soft);
}

.suggestion strong {
  display: block;
  font-size: 0.95rem;
}

.suggestion span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
}

.suggestion small {
  color: var(--green);
  font-size: 0.78rem;
  white-space: nowrap;
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: var(--panel);
}

.format-segment {
  grid-template-columns: repeat(2, 1fr);
}

.segment button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #17130f;
}

.segment button:last-child {
  border-right: 0;
}

.segment .active {
  background: var(--coral);
  color: white;
}

.calendar-row {
  position: relative;
  width: min(340px, 100%);
  margin: 8px auto 0;
}

.calendar-trigger {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--foreground);
  text-align: left;
}

.calendar-trigger #calendarDisplay {
  color: var(--foreground);
}

.calendar-trigger .calendar-icon {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid var(--green);
  border-radius: 4px;
}

.calendar-trigger .calendar-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 0;
  left: 0;
  border-top: 2px solid var(--green);
}

.calendar-trigger .calendar-icon::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 3px;
  width: 7px;
  height: 5px;
  border-right: 2px solid var(--green);
  border-left: 2px solid var(--green);
}

.calendar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 40;
  width: 286px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(16, 24, 32, 0.22);
  color: var(--foreground);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.calendar-month {
  font-size: 0.88rem;
  font-weight: 800;
}

.calendar-nav {
  display: flex;
  gap: 6px;
}

.calendar-nav button,
.calendar-day {
  border: 0;
  background: transparent;
}

.calendar-nav button {
  width: 30px;
  height: 28px;
  border-radius: 6px;
  color: var(--green);
  font-size: 1.1rem;
}

.calendar-nav button:hover,
.calendar-day:hover {
  background: var(--green-soft);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekday {
  padding: 5px 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 30px;
  border-radius: 6px;
  color: var(--foreground);
  font-size: 0.82rem;
}

.calendar-day.muted {
  color: #a49d93;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 1px var(--coral);
}

.calendar-day.selected {
  background: var(--coral);
  color: #ffffff;
}

.hidden {
  display: none;
}

.base-pill {
  width: fit-content;
  margin: 7px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
}

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

.ad-slot {
  display: grid;
  place-items: center;
  border: 1px dashed #beb5a8;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.44);
  color: #8a8176;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-slot-top {
  display: none;
  min-height: 80px;
  margin: 12px auto 0;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: start;
}

.world-section {
  min-width: 0;
}

.ad-slot-side {
  position: sticky;
  top: 236px;
  min-height: 600px;
  margin-top: 56px;
}

.favourites-block {
  margin-top: 8px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.section-title span {
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: var(--coral);
}

.section-title h2 {
  margin: 0;
  color: var(--green);
  font-family: "Segoe UI", Inter, Arial, Helvetica, sans-serif;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sticky-workbench .section-title h2 {
  color: #fffaf1;
}

.sticky-workbench .section-title span {
  background: var(--coral);
}

.world-grid {
  display: grid;
  gap: 10px;
}

.world-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.favourites-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.city-card {
  min-height: 82px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--card-shadow);
}

.favourite-card {
  min-width: 176px;
  max-width: 176px;
  min-height: 84px;
  border-color: rgba(201, 139, 46, 0.28);
  background: #fff9ef;
  scroll-snap-align: start;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.card-topline h3 {
  margin: 0;
  color: var(--foreground);
  font-family: "Segoe UI", Inter, Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}

.favourite-card h3 {
  font-size: 0.98rem;
}

.card-topline p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.card-topline p span {
  margin-left: 6px;
  color: var(--muted);
}

.star-button {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--gold);
  font-size: 1.05rem;
  line-height: 1;
  transition: background 160ms ease, transform 160ms ease;
}

.star-button:hover,
.star-button:focus {
  background: rgba(211, 139, 36, 0.14);
  transform: translateY(-1px);
}

.star-button:not(.active) {
  color: rgba(111, 102, 92, 0.55);
}

.city-time {
  margin-top: 8px;
  color: var(--foreground);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.favourite-card .city-time {
  font-size: 1.08rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 0.68rem;
  line-height: 1;
  white-space: nowrap;
}

.chip.green {
  background: var(--green-soft);
  color: #284434;
}

.chip.coral {
  background: var(--coral-soft);
  color: #a44531;
}

.world-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 0 10px;
}

.world-heading .section-title {
  margin-bottom: 0;
}

.search {
  width: min(420px, 100%);
}

.world-heading .search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.world-heading .search span {
  color: var(--foreground);
  flex: 0 0 auto;
  white-space: nowrap;
}

.world-heading .search input {
  min-width: 0;
  border-color: #c7beb1;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 32, 0.02);
}

.fixed-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 11px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--footer);
  box-shadow: 0 -12px 32px rgba(16, 47, 49, 0.22);
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-size: 0.86rem;
  backdrop-filter: blur(10px);
}

.fixed-footer strong {
  color: #f3c15f;
}

@media (max-width: 1000px) {
  .site-shell {
    padding: 72px 18px 60px;
  }

  .tool-panel {
    padding: 0 18px 24px;
  }

  .sticky-workbench {
    margin: 0 -18px;
    padding: 11px 18px 8px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .world-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .favourite-card {
    min-width: 176px;
    max-width: 176px;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 60px 0 96px;
  }

  .tool-panel {
    min-height: 100vh;
    padding: 0 12px 22px;
    border: 0;
    border-radius: 0;
  }

  .sticky-workbench {
    position: relative;
    top: auto;
    margin: 0 -12px;
    padding: 9px 12px 8px;
    border-radius: 0;
  }

  .fixed-header {
    height: 50px;
    padding: 0 16px;
  }

  .fixed-header h1 {
    font-size: 1.25rem;
  }

  .bookmark-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .bookmark-tip {
    width: min(260px, calc(100vw - 24px));
  }

  .controls {
    gap: 9px;
    padding: 10px;
  }

  .segment {
    grid-template-columns: repeat(3, 1fr);
  }

  .format-segment {
    grid-template-columns: repeat(2, 1fr);
  }

  .segment button {
    min-height: 38px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .segment button:last-child {
    border-right: 0;
  }

  .base-pill {
    font-size: 0.76rem;
    text-align: center;
  }

  .world-heading {
    display: grid;
  }

  .world-heading .search {
    display: grid;
    gap: 5px;
  }

  .search {
    width: 100%;
  }

  .world-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .content-layout {
    display: block;
  }

  .ad-slot-top {
    display: grid;
  }

  .ad-slot-side {
    display: none;
  }

  .ad-slot-top {
    min-height: 80px;
  }

  .favourite-card {
    min-width: 164px;
    max-width: 164px;
    min-height: 82px;
  }

  .fixed-footer {
    padding: 10px 14px;
    font-size: 0.76rem;
  }
}
