:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --fg: #121212;
  --muted: #5e6472;
  --primary: #019acc;
  --primary-contrast: #fff;
  --secondary: #b10061;
  --secondary-contrast: #fff;
  --tertiary: #0b2a6f;
  --tertiary-contrast: #fff;
  --card: #fff;
  --border: #e4e8f1;
  --danger: #b30021;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-width: 0;
  overflow-x: clip;
}

html {
  background: var(--bg);
}

body {
  margin: 0 auto;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
  min-height: 100vh;
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
}

.topbar {
  inline-size: calc(100% - 1.8rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0.5rem 0.9rem 0;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  gap: 0.55rem;
  line-height: 1.2;
}

.topbar h1 span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.title-hidden .app-title {
  display: none;
}

body.title-hidden .topbar {
  gap: 0.2rem;
}

h2 {
    font-size: 1.15rem;
}

.brand-logo {
  height: 2.5rem;
  width: auto;
  display: block;
  flex: 0 0 auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

#nav-favorites {
  color: var(--secondary);
}

.nav-icon {
  color: currentColor;
  line-height: 1;
}

@media (max-width: 560px) {
  .topbar {
    padding: 0.7rem 0.7rem;
    gap: 0.4rem;
  }

  .topbar h1 {
    font-size: 1.07rem;
    gap: 0.4rem;
  }

  .nav {
    gap: 0.45rem;
  }

  .nav a {
    font-size: 0.93rem;
    gap: 0.16rem;
  }
}

.container {
  width: 100%;
  min-width: 0;
  flex: 1;
  margin: 0 auto;
  padding: 0 0.9rem 1rem;
}

.app-footer {
  width: 100%;
  margin-top: auto;
  padding: 0.3rem 0.7rem 0.45rem;
}

.status-line {
  margin: 0;
  text-align: center;
  font-size: 0.68rem;
  color: #8a90a0;
}

.card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
}

#view.card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.banner {
  width: 100%;
  margin: 0.65rem auto;
  max-width: 100%;
  border: 1px solid #ffe08a;
  background: #fff9e5;
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.banner-actions {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.banner-actions button {
  width: 100%;
}

.inline-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

button {
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  padding: 0.55rem 0.75rem;
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
}

button.secondary {
  border-color: var(--secondary);
  background: #fff;
  color: var(--secondary);
}

button.danger {
  border-color: var(--danger);
  background: #fff;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

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

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-item {
  min-width: 0;
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}

.list-item:first-child {
  border-top: none;
}

.item-title {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.item-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.item-actions {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 0.5rem;
}

.item-actions button {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  font-size: 0.9rem;
}

.favorites-group {
  margin-top: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.favorites-group:first-of-type {
  margin-top: 0.2rem;
}

.favorites-group-title {
  margin: 0;
  font-size: 0.98rem;
  color: var(--tertiary);
  padding: 0.65rem 0.75rem;
  background: #f8f9fc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorites-group > .list {
  padding: 0 0.75rem 0.25rem;
}

.detail-grid {
  display: grid;
  gap: 0.75rem;
}

.kv {
  margin: 0;
}

.kv dt {
  font-weight: 700;
}

.kv dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

a {
  overflow-wrap: anywhere;
}

.text-link {
  color: var(--tertiary);
  text-decoration: underline;
  text-decoration-color: var(--tertiary);
  text-underline-offset: 2px;
  font-weight: 600;
}

.text-link:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}

.author-name {
  font-weight: 700;
}

.attendee-role {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.02rem 0.45rem;
  font-size: 0.78rem;
  line-height: 1.25;
  font-weight: 600;
}

.attendee-role.presenter {
  border-color: var(--secondary);
  color: var(--secondary);
}

.attendee-role.coauthor {
  border-color: var(--primary);
  color: var(--primary);
}

.attendee-role.discussant {
  border-color: var(--tertiary);
  color: var(--tertiary);
}

.attendee-role.chair {
  border-color: #7a5a00;
  color: #7a5a00;
}

.presenter-mark {
  display: inline-block;
  margin-left: 0.15rem;
  font-size: 0.86em;
  color: var(--secondary);
  vertical-align: 0.02em;
}

.block-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.btn-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon {
  display: inline-block;
  margin-right: 0.35rem;
  line-height: 1;
  color: currentColor;
  font-family: inherit;
}

button .icon,
.btn-nav .icon {
  vertical-align: middle;
}

.btn-nav.secondary {
  border-color: var(--secondary);
  background: #fff;
  color: var(--secondary);
}

.btn-nav.disabled {
  border-color: var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: default;
}

.block-time {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.block-heading {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-link {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  display: block;
  padding: 0.1rem 0;
}

.session-link:hover .item-title {
  text-decoration: underline;
}

.track-dropdown {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  margin: 0 0 0.65rem;
  overflow: hidden;
}

.track-dropdown > summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  list-style: none;
  padding: 0.65rem 0.75rem;
  font-weight: 700;
  color: var(--tertiary);
  background: #f8f9fc;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
}

.track-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-chevron {
  display: inline-block;
  margin-right: 0.45rem;
  transition: transform 0.2s ease;
}

.track-dropdown[open] > summary .track-chevron {
  transform: rotate(90deg);
}

.track-dropdown > summary::-webkit-details-marker {
  display: none;
}

.track-dropdown > .list {
  padding: 0 0.75rem 0.25rem;
}

.block-session-row {
  display: grid;
  gap: 0.1rem;
  padding: 0.45rem 0;
  min-width: 0;
}

.block-session-mainline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.block-session-row:first-child {
  border-top: none;
}

.block-session-link {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--primary);
  padding: 0;
}

.block-session-link:hover {
  text-decoration: underline;
}

.block-session-room {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.block-session-presenters {
  min-width: 0;
  margin-left: 0;
  display: grid;
  gap: 0.04rem;
}

.block-session-talk-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  line-height: 1.14;
  color: var(--fg);
}

.block-session-presenter {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
  line-height: 1.14;
  color: var(--muted);
}

.btn-fav-inline {
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  transition: color 0.15s;
}

.btn-fav-inline.is-fav {
  color: var(--secondary);
}

.btn-fav-inline:hover {
  color: var(--muted);
}

.btn-fav-inline.is-fav:hover {
  color: var(--secondary);
}

.btn-fav-inline .icon {
  font-size: 1.33em;
  margin-right: 0;
}

.search-panel {
  display: grid;
  gap: 0.75rem;
}

.search-mode-toggle {
  display: inline-flex;
  gap: 0.45rem;
}

.search-mode-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  min-height: 34px;
  padding: 0.3rem 0.6rem;
}

.search-mode-btn.active {
  border-color: var(--primary);
  background: #fff;
  color: var(--primary);
}

.search-section {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.search-section h3 {
  margin: 0.25rem 0;
  color: var(--tertiary);
}

.search-talk-actions {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
}

.search-talk-actions .btn-nav,
.search-talk-actions button {
  flex: 1 1 50%;
  width: 50%;
  min-width: 0;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-talk-actions [data-toggle-fav] .icon {
  font-size: 1.33em;
  vertical-align: middle;
}

.search-hit {
  background: #ffe08a;
  color: inherit;
  border-radius: 3px;
  padding: 0 0.05em;
}

.session-header-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
  color: #1f2a44;
}

.session-view-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  width: 100%;
  margin: 0;
}

.session-actions-row {
  flex-wrap: nowrap;
  align-items: center;
}

.session-actions-row button {
  width: auto;
  white-space: nowrap;
}

.session-code {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.dot-fill {
  flex: 1;
  min-width: 30px;
  border-bottom: 2px dotted #9097aa;
  margin: 0 0.35rem 0.2rem;
}

.session-talks {
  margin: 0;
  padding-left: 1.35rem;
}

.session-talk-item {
  margin: 0 0 0.8rem;
}

.session-talk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.talk-title-inline {
  font-size: 1rem;
}

.talk-author-line {
  margin: 0.1rem 0 0.1rem 0;
}

.talk-discussant {
  margin-top: 0.75rem;
}

.role-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  margin-left: 0.3rem;
  line-height: 1;
  color: var(--muted);
}

.talk-discussant .role-icon {
  margin-left: 0;
  margin-right: 0.25rem;
}

.role-glyph {
  display: inline-block;
  font-variant-emoji: text;
  color: currentColor;
}

.pdf-link {
  border: 1px solid var(--secondary);
  color: var(--secondary);
  padding: 0.06rem 0.4rem;
  font-size: 0.82rem;
  text-decoration: none;
  border-radius: 2px;
  white-space: nowrap;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.map-view {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.5rem;
}

.map-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}


#app-panel,
#view {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .topbar {
    inline-size: calc(100% - 2.5rem);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem 1.25rem;
    margin: 0.75rem 1.25rem 0;
  }

  .container {
    margin: 0 auto;
    padding: 0 1.25rem 1.5rem;
  }

  .session-view-panel {
    width: 100%;
    margin: 0;
  }

  .card,
  .banner {
    border-radius: 10px;
  }

  .card {
    padding: 1rem;
  }

  .banner {
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    padding: 0.75rem 1rem;
  }

  .banner-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  .banner-actions button {
    width: auto;
  }

  .inline-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  input {
    width: auto;
    min-width: 260px;
  }

  .item-actions button {
    width: auto;
  }
}

@media (max-width: 360px) {
  .topbar {
    padding: 0.75rem;
  }

  .container {
    padding: 0 0.5rem 0.85rem;
  }

  .card,
  .banner {
    padding: 0.7rem;
  }

  .topbar h1 {
    font-size: 1.05rem;
  }

  .item-actions {
    gap: 0.4rem;
  }
}
