* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #1f2933;
  background: #f4f7f5;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.app-header {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  align-items: center;
  min-width: 0;
  height: 72px;
  padding: 10px 18px;
  background: #ffffff;
  border-bottom: 1px solid #d7e0da;
  box-shadow: 0 1px 6px rgba(31, 41, 51, 0.08);
}

.title-block {
  min-width: 0;
}

.app-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.app-subtitle {
  margin-top: 3px;
  color: #5b6770;
  font-size: 14px;
  white-space: nowrap;
}

.logo-strip,
.sponsor-strip,
.toolbar {
  display: flex;
  align-items: center;
}

.logo-strip {
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  text-decoration: none;
}

.brand-logo {
  width: auto;
  max-width: 176px;
  height: 52px;
  flex: 0 1 auto;
  object-fit: contain;
}

.sponsor-strip {
  flex: 0 1 auto;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

.sponsor-label {
  color: #5b6770;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sponsor-logo {
  width: auto;
  max-width: 132px;
  height: 46px;
  object-fit: contain;
}

.qr-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.toolbar {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 0;
  flex-wrap: nowrap;
}

.toolbar-button,
.password-input {
  min-height: 48px;
  border-radius: 6px;
  border: 1px solid #c8d3cc;
  background: #ffffff;
  color: #1f2933;
}

.toolbar-button {
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.toolbar-button:hover {
  background: #edf4ef;
}

.toolbar-button.primary {
  color: #ffffff;
  border-color: #236f4e;
  background: #236f4e;
}

.toolbar-button.primary:hover {
  background: #1d5f42;
}

.password-input {
  width: 156px;
  padding: 0 12px;
}

.chart-area {
  min-height: 0;
  height: calc(100vh - 72px);
  padding: 5px;
  overflow: hidden;
}

.main-graph {
  width: 100%;
  height: calc(100vh - 82px);
  min-height: 0;
  background: #ffffff;
  border: 1px solid #d7e0da;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(31, 41, 51, 0.08);
}

.js-plotly-plot,
.plot-container,
.svg-container {
  width: 100% !important;
  height: 100% !important;
}

@media screen and (max-width: 1180px) {
  .app-subtitle,
  .sponsor-label {
    display: none;
  }

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

  .sponsor-logo {
    max-width: 92px;
    height: 36px;
  }

  .qr-logo {
    width: 44px;
    height: 44px;
  }
}

@media screen and (max-width: 900px) {
  .app-header {
    gap: 8px;
    padding: 6px 8px;
  }

  .app-title {
    font-size: 15px;
  }

  .sponsor-strip,
  .qr-logo {
    display: none;
  }

  .password-input {
    width: 108px;
  }

  .toolbar-button {
    padding: 0 8px;
  }
}
