.monitor-tools-toggle {
  display: none;
}
.sound-tools {
  display: contents;
}
@media (max-width: 700px) {
  #dashboard > h1 {
    font-size: 17px;
    padding: 7px 10px;
  }
  #monitor-status {
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    margin-bottom: 8px;
  }
  .filters label {
    min-width: 0;
    font-size: 12px;
  }
  .filters input {
    width: 100%;
  }
  .filters > button {
    min-height: 42px;
    padding: 7px 10px;
    font-size: 12px;
  }
  #toggle-sound {
    grid-column: 1;
  }
  #unlock-audio {
    grid-column: 1/-1;
  }
  .monitor-tools-toggle {
    display: block;
    grid-column: 2;
  }
  .sound-tools {
    display: none;
    grid-column: 1/-1;
  }
  .sound-tools[data-open='true'] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
  }
  .sound-tools button {
    min-height: 42px;
    padding: 7px;
    font-size: 12px;
  }
  .sound-status {
    font-size: 11px;
    line-height: 1.45;
    margin-bottom: 12px;
  }
  .vocations {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: visible;
    margin-bottom: 12px;
  }
  .vocations button {
    min-width: 0;
    min-height: 44px;
    padding: 4px 2px;
    font-size: 11px;
    line-height: 1.25;
  }
  .vocations button:nth-child(7) {
    grid-column: 1/-1;
  }
  #members details {
    margin-bottom: 12px;
  }
  #members summary {
    min-height: 36px;
    padding: 7px 2px;
  }
  #members .table-wrap {
    margin-left: 0;
    border-radius: 5px;
    overflow: visible;
  }
  #members table {
    min-width: 0;
    width: 100%;
    font-size: 11px;
  }
  #members th,
  #members td {
    padding: 4px 3px;
    line-height: 16px;
  }
  #members th:first-child,
  #members td:first-child:not([colspan]) {
    display: none;
  }
  #members th:nth-child(2) {
    width: 48%;
  }
  #members th:nth-child(3) {
    width: 10%;
  }
  #members th:nth-child(4) {
    width: 15%;
  }
  #members th:nth-child(5) {
    width: 27%;
  }
  #members td:nth-child(3),
  #members td:nth-child(4),
  #members td:nth-child(5) {
    white-space: nowrap;
  }
  #members td:nth-child(2) {
    overflow-wrap: anywhere;
  }
  #members .character-name {
    max-width: calc(100% - 18px);
    min-height: 30px;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
    font-size: 12px;
  }
  .movable-name {
    cursor: default;
    -webkit-touch-callout: none;
    user-select: none;
  }
  .context-menu {
    min-width: 190px;
  }
  .context-menu button {
    min-height: 44px;
    padding: 10px 14px;
  }
  .copy-notice {
    bottom: max(14px, env(safe-area-inset-bottom));
    width: max-content;
    font-size: 12px;
  }
  .connection-alert,
  .filter-notice {
    font-size: 12px;
    line-height: 1.45;
  }
}

#schedule-panel {
  margin-top: 16px;
}
#schedule-panel h2 {
  font-size: 16px;
}
#schedule-chart {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 12px 0;
  color: var(--muted);
}
#schedule-detail,
#schedule-summary,
#schedule-panel details {
  font-size: 12px;
  line-height: 1.6;
}
#schedule-panel button[aria-pressed='true'] {
  background: #d6e4ff;
  color: #1d39c4;
}
@media (max-width: 700px) {
  #main-navigation .filters {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin: 0;
  }
  #main-navigation .filters label {
    grid-column: 1/-1;
  }
  #main-navigation .filters input {
    width: 100%;
  }
  #main-navigation .filters > button {
    grid-column: auto;
  }
  #main-navigation #unlock-audio {
    grid-column: 1/-1;
  }
  #main-navigation .sound-tools {
    grid-column: 1/-1;
  }
  body:has(#dashboard[hidden]) #main-navigation .filters {
    display: none;
  }
  #dashboard .sound-status {
    font-size: 11px;
    margin: 5px 0;
  }
  body:has(#unlock-audio[hidden]) #dashboard .sound-status {
    display: none;
  }
  #monitor-status {
    font-size: 10px;
    margin-bottom: 8px;
  }
  #dashboard > h1 {
    margin-bottom: 4px;
  }
  #schedule-chart {
    min-height: 180px;
  }
  .guild-tabs {
    gap: 6px;
  }
}

.schedule-key {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
}
#schedule-legend::before {
  content: '';
  display: inline-block;
  width: 20px;
  border-top: 2px dashed #ff4545;
  margin-right: 7px;
  vertical-align: middle;
}
:root[data-theme='dark'] #schedule-chart {
  background: #181b23;
}
#schedule-chart circle:focus {
  outline: none;
  stroke: #ff4545;
  stroke-width: 2;
}

.schedule-guild-field {
  display: block;
  max-width: 280px;
  font-size: 12px;
  margin: 10px 0;
}
.schedule-guild-field select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
@media (max-width: 700px) {
  .schedule-guild-field {
    max-width: none;
  }
}
