:root {
  color-scheme: dark;
  --bg: #09090d;
  --bg-raised: #13131c;
  --panel: #1f1e1e;
  --panel-strong: #282835;
  --line: #393744;
  --text: #fff8ec;
  --muted: #bbb4aa;
  --q-orange: #f59e00;
  --q-red: #e73e11;
  --q-red-hot: #ff3b19;
  --gold: #d9a441;
  --green: #28d84f;
  --stage: var(--q-orange);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 16px),
    linear-gradient(180deg, #13131c 0%, #09090d 42%, #050507 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 3vw, 36px);
  background: rgba(9, 9, 13, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(245, 158, 0, 0.28), 0 12px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--q-orange);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1;
  text-shadow: 0 0 18px rgba(245, 158, 0, 0.32);
}

h2 {
  font-size: 1rem;
}

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

.brand-logo {
  width: 86px;
  max-height: 82px;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 18px rgba(231, 62, 17, 0.35));
}

.search {
  flex: 0 1 420px;
}

input,
button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 30, 30, 0.94);
  color: var(--text);
  font: inherit;
}

input {
  padding: 0 14px;
  border-color: rgba(245, 158, 0, 0.28);
}

button {
  width: auto;
  padding: 0 14px;
  cursor: pointer;
}

.tabs button {
  position: relative;
}

.day-label-short {
  display: none;
}

input:focus,
button:focus-visible {
  border-color: var(--q-orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 0, 0.18);
}

button.active,
.tabs button.active,
.stage-chip.active,
.result-row:hover,
.result-row:focus-visible {
  border-color: var(--q-orange);
  background: linear-gradient(270deg, rgba(231, 62, 17, 0.22), rgba(245, 158, 0, 0.22));
  color: #fff3cf;
}

.tabs button.live {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(245, 158, 0, 0.45);
}

.stage-chip.live {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--stage);
}

.tabs button.live::after,
.stage-chip.live::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--stage);
  box-shadow: 0 0 12px var(--stage);
}

.tabs button.live::after {
  background: var(--q-orange);
  box-shadow: 0 0 12px rgba(245, 158, 0, 0.9);
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 24px;
  padding: 24px clamp(16px, 3vw, 36px);
}

.app-shell {
  display: grid;
  gap: 18px;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 10px;
  padding: 20px clamp(16px, 3vw, 36px) 0;
}

.view-tabs button {
  min-height: 48px;
  font-weight: 800;
}

.app-view[hidden] {
  display: none;
}

.current-view {
  padding: 0 clamp(16px, 3vw, 36px) 28px;
}

.view-heading {
  margin-bottom: 14px;
}

.view-heading h2 {
  font-size: 1.2rem;
}

.test-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid var(--q-orange);
  border-radius: 999px;
  color: var(--q-orange);
  font-size: 0.72rem;
  font-weight: 950;
  vertical-align: middle;
}

.current-list {
  width: 100%;
}

.current-board {
  display: grid;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: var(--q-orange) rgba(255, 255, 255, 0.08);
}

.current-row {
  display: grid;
  grid-template-columns: minmax(116px, 160px) minmax(220px, 1fr) minmax(220px, 1fr);
  min-width: 620px;
  min-height: 76px;
  border: 1px solid rgba(0, 0, 0, 0.78);
  background: var(--stage);
  box-shadow: 0 0 18px color-mix(in srgb, var(--stage), transparent 78%);
}

.current-stage,
.current-slot {
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px 40px;
  color: var(--stage-text);
}

.current-slot {
  overflow: visible;
  font-weight: 950;
}

.current-stage strong {
  font-size: 1.18rem;
}

.current-stage span,
.slot-label,
.slot-time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.84;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stage-style-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1.1;
  opacity: 0.76;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.stage-style-label.missing {
  opacity: 0.58;
}

.current-slot {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.04));
  border-left: 2px solid rgba(0, 0, 0, 0.62);
}

.now-slot {
  padding-bottom: 34px;
}

.current-progress {
  position: absolute;
  right: 10px;
  bottom: 8px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--stage-text), transparent 82%);
  overflow: visible;
}

.current-progress::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  border-radius: inherit;
  background: var(--stage-text);
  opacity: 0.72;
}

.current-progress::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--progress);
  width: 12px;
  height: 12px;
  border: 2px solid var(--stage-text);
  border-radius: 999px;
  background: var(--stage);
  box-shadow: 0 0 10px color-mix(in srgb, var(--stage-text), transparent 48%);
  transform: translate(-50%, -50%);
}

.next-slot {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.1));
}

.slot-artist {
  font-size: 0.98rem;
  letter-spacing: 0;
}

.slot-time {
  opacity: 0.72;
}

.empty-slot .slot-artist,
.empty-slot .slot-time {
  opacity: 0.7;
}

.current-empty {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(19, 19, 28, 0.9);
  color: var(--muted);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tabs,
.stage-list {
  display: grid;
  gap: 8px;
}

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

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(19, 19, 28, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel h2 {
  margin-bottom: 12px;
}

.stack {
  display: grid;
  gap: 10px;
}

.muted {
  color: var(--muted);
}

.stage-chip {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--stage);
  border-radius: 8px;
  background: rgba(31, 30, 30, 0.94);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.stage-chip::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--stage);
  box-shadow: 0 0 16px var(--stage);
}

.stage-chip span,
.stage-chip strong {
  position: relative;
  z-index: 1;
}

.stage-chip-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.stage-chip-main strong,
.stage-count {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-count {
  color: var(--stage);
  font-weight: 800;
}

.content {
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.schedule {
  display: grid;
  gap: 18px;
}

.stage-section {
  border-top: 4px solid var(--stage);
  background: rgba(19, 19, 28, 0.72);
  box-shadow: 0 0 0 1px rgba(57, 55, 68, 0.8), 0 0 22px rgba(0, 0, 0, 0.24);
}

.stage-section.live {
  box-shadow:
    0 0 0 1px var(--stage),
    0 0 28px color-mix(in srgb, var(--stage), transparent 74%);
}

.stage-section.live header {
  border-color: var(--stage);
}

.stage-section header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 44%), var(--panel-strong);
}

.stage-heading {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.stage-section h2 {
  color: var(--stage);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.1);
  font-size: 1.1rem;
  font-weight: 900;
  margin: 0;
}

.stage-style-description {
  max-width: 760px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.stage-style-description.missing {
  color: color-mix(in srgb, var(--stage), var(--muted) 46%);
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border-left: 1px solid var(--line);
}

.event {
  position: relative;
  min-height: 94px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 13, 0.82);
  overflow: hidden;
}

.event::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--stage);
  opacity: 0.88;
}

.event.current {
  outline: 2px solid var(--stage);
  outline-offset: -2px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--stage), transparent 78%), transparent 42%),
    rgba(9, 9, 13, 0.92);
  box-shadow: inset 0 0 24px color-mix(in srgb, var(--stage), transparent 84%);
}

.event.current::before {
  width: 6px;
  background: var(--stage);
  box-shadow: 0 0 18px var(--stage);
}

.event-topline {
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
}

.now-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--stage), transparent 82%);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  border: 1px solid var(--stage);
  box-shadow: 0 0 12px color-mix(in srgb, var(--stage), transparent 68%);
}

.artist {
  position: relative;
  z-index: 1;
  font-weight: 800;
  line-height: 1.15;
}

.time {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.results {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.searching .sidebar,
.searching .toolbar,
.searching .schedule {
  display: none;
}

.searching .layout {
  grid-template-columns: minmax(0, 980px);
  justify-content: center;
}

.searching .content {
  grid-column: 1 / -1;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  min-height: 0;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 0, 0.22);
  border-radius: 8px;
  background: rgba(19, 19, 28, 0.9);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px;
  border: 1px solid rgba(245, 158, 0, 0.4);
  border-radius: 8px;
  background: linear-gradient(270deg, rgba(231, 62, 17, 0.2), rgba(245, 158, 0, 0.18));
  margin-bottom: 14px;
}

.filter-banner div {
  display: grid;
  gap: 4px;
}

.filter-banner strong {
  font-size: 1.08rem;
  font-weight: 900;
}

.filter-banner span {
  color: var(--muted);
  font-size: 0.93rem;
  opacity: 0.9;
}

.artist-hit {
  min-height: 100px;
  border: 1px solid var(--stage);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 820px) {
  body {
    min-height: 100svh;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 14px),
      linear-gradient(180deg, #101018 0%, #07070a 100%);
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 12px;
    padding: max(14px, env(safe-area-inset-top)) 14px 12px;
    background: rgba(9, 9, 13, 0.98);
    box-shadow: 0 1px 0 rgba(245, 158, 0, 0.22);
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 56px;
    max-height: 58px;
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  h1 {
    font-size: 2rem;
  }

  .search {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  input,
  button {
    min-height: 46px;
    font-size: 16px;
  }

  input {
    border-radius: 8px;
  }

  .app-shell {
    gap: 12px;
  }

  .view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 12px 0;
  }

  .view-tabs button {
    min-height: 48px;
    font-weight: 850;
    font-size: 0.98rem;
  }

  .current-view {
    padding: 0 12px calc(22px + env(safe-area-inset-bottom));
  }

  .view-heading {
    margin-bottom: 10px;
  }

  .current-list {
    gap: 12px;
  }

  .current-board {
    overflow-x: hidden;
  }

  .current-row {
    grid-template-columns: minmax(76px, 92px) minmax(0, 1fr) minmax(0, 1fr);
    min-width: 0;
    min-height: 80px;
  }

  .current-stage,
  .current-slot {
    padding: 7px 8px;
  }

  .current-stage strong {
    font-size: 0.92rem;
  }

  .current-stage span,
  .slot-label,
  .slot-time {
    font-size: 0.64rem;
  }

  .current-stage .stage-style-label {
    font-size: 0.56rem;
  }

  .slot-artist {
    font-size: 0.82rem;
  }

  .now-slot {
    padding-bottom: 22px;
  }

  .current-progress {
    right: 8px;
    bottom: 2px;
    left: 8px;
  }

  .layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 12px calc(22px + env(safe-area-inset-bottom));
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .searching .layout {
    display: block;
    padding-top: 14px;
  }

  .searching .content {
    width: 100%;
  }

  .sidebar {
    display: contents;
  }

  .tabs {
    order: 1;
  }

  .stage-panel {
    order: 2;
  }

  .content {
    order: 3;
  }

  .tabs,
  .stage-panel,
  .content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .tabs {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0;
    margin: 0;
    background: linear-gradient(180deg, rgba(9, 9, 13, 0.98), rgba(9, 9, 13, 0.92));
    border-bottom: 2px solid rgba(245, 158, 0, 0.22);
  }

  .stage-list::-webkit-scrollbar {
    display: none;
  }

  .tabs button {
    min-width: 0;
    width: 100%;
    padding: 0 10px;
    font-size: 1rem;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 52px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .tabs button.active {
    font-weight: 950;
    font-size: 1.02rem;
    background: linear-gradient(270deg, rgba(231, 62, 17, 0.25), rgba(245, 158, 0, 0.2));
  }

  .tabs button.live {
    box-shadow: inset 0 0 0 1.5px rgba(245, 158, 0, 0.5);
  }

  .day-label-long {
    display: none;
  }

  .day-label-short {
    display: inline;
  }

  .panel {
    padding: 12px;
  }

  .panel h2 {
    margin-bottom: 10px;
    font-size: 0.9rem;
  }

  .stage-panel {
    position: sticky;
    top: calc(52px + 20px);
    z-index: 3;
    margin: 0 -12px;
    padding: 14px 12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(13, 13, 19, 0.98), rgba(13, 13, 19, 0.94));
    backdrop-filter: blur(16px);
    border-bottom: 2px solid rgba(245, 158, 0, 0.15);
  }

  .artist-filter-active .stage-panel {
    display: none;
  }

  .stage-panel h2 {
    display: block;
    font-size: 0.95rem;
    font-weight: 850;
    margin-bottom: 12px;
    color: var(--text);
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .stage-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0;
  }

  .stage-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: auto;
    min-height: 66px;
    padding: 12px 13px;
    white-space: normal;
    font-size: 0.93rem;
    transition: all 0.2s ease;
  }

  .stage-chip-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .stage-chip strong {
    font-size: 0.99rem;
    font-weight: 900;
    line-height: 1.1;
  }

  .stage-chip .stage-style-label {
    font-size: 0.65rem;
    opacity: 0.75;
    line-height: 1.1;
  }

  .stage-count {
    font-size: 0.88rem;
    font-weight: 800;
    margin-top: 4px;
  }

  .content {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .toolbar {
    position: sticky;
    top: calc(52px + 20px + 66px + 54px);
    z-index: 2;
    margin: 0 -12px 14px;
    padding: 13px 12px;
    background: linear-gradient(180deg, rgba(9, 9, 13, 0.96), rgba(9, 9, 13, 0.88));
    border-bottom: 1px solid rgba(57, 55, 68, 0.9);
    backdrop-filter: blur(14px);
    gap: 12px;
  }

  .toolbar h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
    font-weight: 850;
    color: #fff3cf;
  }

  .toolbar button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 16px;
    font-size: 0.95rem;
  }

  .results {
    gap: 10px;
    margin-bottom: 14px;
  }

  .result-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 16px;
    min-height: 50px;
  }

  .result-row strong {
    font-size: 1.05rem;
  }

  .result-row span {
    font-size: 0.9rem;
    opacity: 0.85;
  }

  .schedule {
    gap: 14px;
  }

  .event-grid {
    grid-template-columns: 1fr;
    border-left: 0;
    gap: 6px;
  }

  .stage-section {
    border-top-width: 6px;
  }

  .stage-section header {
    position: sticky;
    top: calc(52px + 20px + 66px + 54px + 50px);
    z-index: 1;
    padding: 13px 12px;
    gap: 8px;
  }

  .stage-section header h2 {
    font-size: 1.15rem;
    margin: 0;
  }

  .stage-style-description {
    font-size: 0.77rem;
    line-height: 1.3;
    display: none;
  }

  .event {
    min-height: 110px;
    padding: 14px 14px 14px 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(57, 55, 68, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .event::before {
    width: 4px;
  }

  .event.current::before {
    width: 6px;
  }

  .event-topline {
    margin-bottom: 6px;
  }

  .now-badge {
    font-size: 0.75rem;
    min-height: 24px;
    padding: 3px 10px;
  }

  .artist {
    font-size: 1.08rem;
    font-weight: 850;
    line-height: 1.25;
    margin-bottom: 6px;
  }

  .time {
    font-size: 0.92rem;
    margin-top: 4px;
    opacity: 0.8;
  }

}

@media (max-width: 430px) {
  h1 {
    font-size: 1.78rem;
  }

  .tabs button {
    padding: 0 6px;
    font-size: 0.9rem;
  }

  .stage-chip {
    min-width: 124px;
  }

  /* Timetable readability improvements */
  .event {
    min-height: 108px;
    padding: 13px 13px 13px 15px;
  }

  .artist {
    font-size: 1.06rem;
  }

  .time {
    font-size: 0.9rem;
  }
}

/* iPhone-specific optimizations */
@media (max-width: 600px) and (hover: none) and (pointer: coarse) {
  /* Prevent iOS zoom on input focus */
  input,
  button {
    font-size: 16px !important;
  }

  /* Improve touch target sizes per WCAG */
  button,
  .tabs button,
  .stage-chip,
  .result-row {
    min-height: 48px;
  }

  /* Better vertical spacing for touch */
  .view-tabs {
    gap: 12px;
    padding: 12px 12px 0;
  }

  .stage-list {
    gap: 10px;
  }

  /* Improve current view on mobile */
  .current-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .current-row {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: auto;
    min-width: auto;
  }

  .current-stage {
    padding: 10px 12px;
    box-shadow: none;
  }

  .current-slot {
    padding: 10px 12px 42px;
    border-left: none;
    overflow: visible;
  }

  .current-stage,
  .current-slot {
    border-right: none;
  }

  .current-stage + .current-slot {
    border-top: 1px solid rgba(0, 0, 0, 0.62);
  }

  /* Better panel spacing */
  .panel {
    padding: 14px;
  }

  .event {
    min-height: 88px;
    padding: 14px;
  }

  /* Search optimization */
  .search input {
    padding: 12px 16px;
  }

  /* Better button spacing */
  .toolbar {
    padding: 12px 12px;
    gap: 14px;
  }

  .toolbar button {
    min-height: 44px;
    padding: 0 16px;
  }

  /* Results better spaced */
  .results {
    gap: 10px;
  }

  .result-row {
    padding: 14px 16px;
    gap: 8px;
  }

  /* Improve readability */
  .artist {
    font-size: 1.02rem;
    line-height: 1.2;
  }

  .time {
    font-size: 0.88rem;
  }

  /* Better heading spacing */
  .view-heading h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  /* Optimize scrolling performance */
  .schedule {
    gap: 14px;
  }

  /* Better scroll behavior */
  .stage-list {
    scroll-behavior: smooth;
    -webkit-scroll-behavior: smooth;
  }

  /* Notch awareness */
  body {
    padding-top: max(0, env(safe-area-inset-top) - 14px);
  }

  /* Improve keyboard visibility */
  .topbar {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  /* Touch feedback - remove hover states, add active states */
  .result-row:hover {
    background: rgba(19, 19, 28, 0.9);
  }

  .result-row:active {
    background: linear-gradient(270deg, rgba(231, 62, 17, 0.22), rgba(245, 158, 0, 0.22));
    border-color: var(--q-orange);
    color: #fff3cf;
  }

  button:active {
    opacity: 0.85;
  }

  /* Landscape mode optimization */
  @media (orientation: landscape) {
    body {
      min-height: 100svh;
    }

    .topbar {
      padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
    }

    .topbar {
      gap: 8px;
    }

    .brand-logo {
      width: 40px;
      max-height: 40px;
    }

    h1 {
      font-size: 1.4rem;
    }

    .search {
      max-width: 160px;
    }

    .current-view,
    .layout {
      padding-top: 6px;
      padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .event {
      min-height: 90px;
      padding: 11px 11px 11px 12px;
    }

    .artist {
      font-size: 1rem;
    }

    .time {
      font-size: 0.86rem;
    }

    .tabs {
      padding: 8px 0;
      gap: 8px;
    }

    .tabs button {
      min-height: 46px;
      font-size: 0.94rem;
    }

    .stage-panel {
      top: calc(46px + 14px);
      padding: 10px 12px;
    }

    .stage-panel h2 {
      font-size: 0.88rem;
      margin-bottom: 8px;
    }

    .stage-chip {
      min-height: 58px;
      padding: 10px 11px;
    }

    .stage-chip strong {
      font-size: 0.92rem;
    }

    .toolbar {
      top: calc(46px + 14px + 58px + 26px);
      padding: 10px 12px;
      margin-bottom: 10px;
    }

    .toolbar h2 {
      font-size: 0.98rem;
    }
  }
}

/* Extra small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 52px;
    max-height: 50px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  .tabs button {
    font-size: 0.85rem;
  }

  .stage-chip {
    min-width: 110px;
    min-height: 48px;
    padding: 8px 10px;
  }

  .event {
    min-height: 84px;
  }

  .artist {
    font-size: 0.96rem;
  }
}

/* iPhone X and newer (notch support) */
@supports (padding: max(0px)) {
  @media (max-width: 600px) {
    body {
      /* Ensure content respects safe areas */
      min-height: 100dvh;
    }

    .topbar {
      padding-top: max(12px, env(safe-area-inset-top));
      padding-bottom: 12px;
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
    }

    .current-view,
    .layout {
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
      padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
  }
}
