/* SafetyGroup Event Logbuch – mobile Arbeitsansicht 0.2.1 */
.mobile-logout { display: none; }
@media (max-width: 760px) {
  html, body { width: 100%; overflow-x: hidden; }
  .app-shell { display: block; min-height: 100dvh; }
  .sidebar { display: none !important; }
  .workspace { width: 100%; margin-left: 0 !important; }
  .workspace > header { height: 64px; padding: 8px 12px; gap: 10px; }
  .event { flex: 1; min-width: 0; gap: 0; }
  .event > b, .mobile-menu { display: none !important; }
  .event-switcher { width: 100%; max-width: none !important; height: 44px; padding-left: 12px; font-size: 13px; }
  .live { display: none !important; }
  .live strong, .live span { display: none !important; }
  .live b { white-space: nowrap; font-size: 14px !important; }
  .mobile-logout {
    display: inline-flex;
    flex: none;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    max-width: 168px;
    min-width: 112px;
    height: 46px;
    padding: 5px 10px;
    border: 1px solid #5f4639;
    border-radius: 8px;
    background: #fff;
    color: #27160f;
    cursor: pointer;
  }
  .mobile-logout span {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 850;
  }
  .mobile-logout small {
    color: #8a4b27;
    font-size: 8px;
    font-weight: 750;
    line-height: 1.25;
  }
  main { width: 100%; padding: 14px 12px 32px; }
  .title-row { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
  .title-row h1 { margin: 3px 0 0; font-size: 24px; line-height: 1.12; }
  .title-row .eyebrow { font-size: 9px !important; }
  .title-row .primary, .title-row .new-entry-link { width: 100% !important; height: 48px; padding: 0 16px !important; font-size: 14px !important; }
  .role-area_lead .title-row { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
  .stat { height: 74px; padding: 10px 14px; gap: 0; }
  .stat > span { display: none; }
  .stat small { font-size: 11px; }
  .stat b { font-size: 27px; }
  .content-grid { display: block; }
  .right-col { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .panel { border-radius: 10px; }
  .panel-head { align-items: stretch; min-height: 0; padding: 14px; gap: 12px; }
  .panel-title h2 { font-size: 18px; }
  .tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .tools select, .tools input { width: 100% !important; max-width: none !important; height: 44px; }
  .tools input { grid-column: 1 / -1; }
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { padding: 0 10px 10px; }
  .table-wrap tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 10px; padding: 13px; border: 1px solid #e4ded9; border-left: 4px solid #ff7c2c; border-radius: 9px; background: #fff; box-shadow: 0 2px 6px #140d090b; }
  .table-wrap td { min-width: 0; height: auto; padding: 0; border: 0; overflow-wrap: anywhere; font-size: 12px; }
  .table-wrap td::before { display: block; margin-bottom: 2px; color: #766b64; text-transform: uppercase; letter-spacing: .04em; font-size: 8px; font-weight: 800; }
  .table-wrap td:nth-child(1)::before { content: "Zeit"; }
  .table-wrap td:nth-child(2)::before { content: "Vorgang"; }
  .table-wrap td:nth-child(3)::before { content: "Meldung / Auftrag"; }
  .table-wrap td:nth-child(4)::before { content: "Ort"; }
  .table-wrap td:nth-child(5)::before { content: "Bereich"; }
  .table-wrap td:nth-child(6)::before { content: "Priorität"; }
  .table-wrap td:nth-child(7)::before { content: "Status"; }
  .table-wrap td:nth-child(3) { grid-column: 1 / -1; grid-row: 1; font-size: 15px; font-weight: 800; }
  .panel.urgent, .right-col .panel { min-height: 0; }
  .protocol-list > div { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .protocol-list > div > * { grid-column: 1 !important; }
  .drawer { width: calc(100% - 16px); max-width: none; max-height: calc(100dvh - 16px); margin: 8px; padding: 16px 14px; border-radius: 12px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); margin: 8px; padding: 16px 14px; }
  .keyboard-hint { display: none; }
}

#device-alarm-control {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1050;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid #d7ccc5;
  border-radius: 999px;
  background: #fff;
  color: #3c281f;
  box-shadow: 0 8px 25px rgba(38, 23, 16, 0.16);
  cursor: pointer;
}

#device-alarm-control.is-active {
  border-color: #cce7db;
  background: #e8f6ef;
  color: #087648;
}

#device-alarm-control span {
  font-size: 18px;
}

#device-alarm-control b {
  font-size: 13px;
}

#device-alarm-notice {
  position: fixed;
  left: 50%;
  top: 22px;
  z-index: 1200;
  width: min(760px, calc(100vw - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid #ff762b;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(41, 20, 10, 0.28);
}

.device-alarm-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff762b;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
}

.device-alarm-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.device-alarm-copy small {
  color: #d85316;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.device-alarm-copy strong,
.device-alarm-copy span {
  overflow-wrap: anywhere;
}

.device-alarm-copy strong {
  font-size: 17px;
}

.device-alarm-copy span {
  color: #665850;
  font-size: 13px;
}

.device-alarm-actions {
  display: flex;
  gap: 8px;
}

.device-alarm-actions button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #d6c9c2;
  border-radius: 8px;
  background: #fff;
  color: #2f2019;
  font-weight: 700;
  cursor: pointer;
}

.device-alarm-actions button:last-child {
  border-color: #ff762b;
  background: #ff762b;
  color: #140b07;
}

@media (max-width: 720px) {
  #device-alarm-control {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  #device-alarm-notice {
    top: calc(10px + env(safe-area-inset-top));
    width: calc(100vw - 20px);
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
  }

  .device-alarm-icon {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .device-alarm-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .device-alarm-actions button {
    min-height: 46px;
  }
}
@media (max-width: 390px) {
  .workspace > header { padding-inline: 9px; }
  .event-switcher { font-size: 12px; }
  .live b { font-size: 12px !important; }
  .mobile-logout {
    max-width: 128px;
    min-width: 88px;
    padding-inline: 8px;
  }
  .mobile-logout span { font-size: 9px; }
  .mobile-logout small { font-size: 7px; }
  main { padding-inline: 9px; }
  .detail-grid { grid-template-columns: 1fr; }
}

.assignment-box { margin: 18px 0; padding: 16px; border: 1px solid #ead8cb; border-radius: 10px; background: #fffaf6; }
.assignment-heading h3 { margin: 0 0 4px; }
.assignment-heading p { margin: 0 0 13px; color: #766b64; font-size: 11px; line-height: 1.45; }
.assignment-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.assignment-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 10px; font-weight: 800; }
.assignment-fields select { width: 100%; height: 42px; padding: 0 10px; border: 1px solid #d3c9c2; border-radius: 7px; background: #fff; font: inherit; font-size: 12px; }
.assignment-submit { width: 100%; height: 44px; margin-top: 11px; border: 0; border-radius: 8px; background: #241610; color: #fff; cursor: pointer; font-size: 11px; font-weight: 850; }
.assignment-submit:disabled { opacity: .55; cursor: wait; }
@media (max-width: 620px) {
  .assignment-box { margin-inline: -4px; padding: 14px; }
  .assignment-fields { grid-template-columns: 1fr; }
  .assignment-fields select, .assignment-submit { min-height: 48px; }
}

.attachment-storage-choice {
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.5fr);
  align-items: center;
  gap: 7px 16px !important;
  margin-top: 4px;
  padding: 14px 15px;
  border: 1px solid #ecd9cd;
  border-left: 4px solid #ff7028;
  border-radius: 9px;
  background: #fffaf6;
}
.attachment-storage-choice > b {
  grid-column: 1;
  font-size: 11px;
}
.attachment-storage-choice > select {
  grid-column: 1;
  width: 100%;
  min-height: 42px;
  white-space: normal;
}
.attachment-storage-choice > small {
  grid-column: 2;
  grid-row: 1 / 3;
  color: #6f625a;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.55;
}
@media (max-width: 760px) {
  .attachment-storage-choice {
    grid-template-columns: 1fr;
    padding: 13px;
  }
  .attachment-storage-choice > b,
  .attachment-storage-choice > select,
  .attachment-storage-choice > small {
    grid-column: 1;
    grid-row: auto;
  }
  .attachment-storage-choice > select {
    min-height: 48px;
  }
}
.storage-monitor-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 28px;
  align-items: start;
  padding: 22px 24px;
  margin-top: 16px;
  border: 1px solid #e6dcd5;
  border-top: 3px solid #ff7028;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(42, 24, 15, .06);
}
.storage-heading h2 {
  margin: 3px 0 5px;
  font-size: 18px;
}
.storage-heading > p:last-child {
  margin: 0;
  color: #746861;
  font-size: 12px;
}
.storage-summary {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-items: end;
  gap: 6px;
  min-width: 220px;
  padding: 12px 14px 12px 18px;
  border-radius: 10px;
  background: #fff5ef;
}
.storage-summary strong {
  grid-row: 1;
  grid-column: 1 / -1;
  color: #ff6d22;
  font-size: 1.65rem;
  line-height: 1;
}
.storage-summary span {
  grid-row: 2;
  grid-column: 1;
  color: #514740;
  font-size: 11px;
}
.storage-summary button {
  grid-row: 2;
  grid-column: 2;
  margin: 0 0 0 8px;
  padding: 7px 10px;
  border: 1px solid #d9c9bf;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.storage-events {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #eadfd8;
  border-radius: 9px;
  overflow: hidden;
}
.storage-events li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px 18px;
  padding: 11px 13px;
  border-bottom: 1px solid #eee5df;
  background: #fff;
}
.storage-events li:last-child {
  border-bottom: 0;
}
.storage-event-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}
.storage-events small {
  grid-column: 2;
  grid-row: 1;
  color: #756963;
  font-size: 11px;
}
.storage-events b {
  grid-column: 3;
  min-width: 70px;
  text-align: right;
}
@media (max-width: 700px) {
  .storage-monitor-panel {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }
  .storage-summary {
    grid-template-columns: 1fr auto;
    justify-items: start;
    min-width: 0;
  }
  .storage-summary strong {
    justify-self: start;
  }
  .storage-events li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .storage-events small {
    grid-column: 1;
    grid-row: 2;
  }
  .storage-events b {
    grid-column: 2;
    grid-row: 1 / 3;
  }
}

.attachment-storage-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
  gap: 20px 28px;
  align-items: center;
  margin-top: 16px;
  padding: 22px 24px;
  border-top: 3px solid #ff7028;
}
.attachment-storage-panel > div:first-child {
  min-width: 0;
}
.attachment-storage-panel > div:first-child > p:not(.eyebrow) {
  max-width: 920px;
  margin: 0;
  color: #746861;
  font-size: 12px;
  line-height: 1.5;
}
.attachment-storage-panel h2 {
  margin: 3px 0 6px;
  font-size: 18px;
}
.attachment-storage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.attachment-storage-actions .primary {
  min-width: 180px;
}
.attachment-storage-state {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f3eee9;
  color: #5b5048;
  font-size: 12px;
  font-weight: 700;
}
.attachment-storage-state.success {
  background: #e4f4ec;
  color: #087a4d;
}
.attachment-storage-state.error {
  border-radius: 9px;
  background: #fde8e8;
  color: #a72c2c;
  max-width: 560px;
}
@media (max-width: 760px) {
  .attachment-storage-panel {
    display: block;
    padding: 18px 16px;
  }
  .attachment-storage-actions {
    margin-top: 16px;
    justify-content: stretch;
  }
  .attachment-storage-actions button {
    width: 100%;
  }
}
.system-info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.system-info-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.58rem;
  border: 1px solid #eadfd8;
  border-radius: 0.55rem;
  background: #fffaf7;
  color: #382b25;
}
.system-info-item small {
  color: #7a6b63;
  font-size: 0.72rem;
}
.system-info-item strong {
  color: #d95c18;
  font-size: 0.76rem;
}
@media (max-width: 760px) {
  .system-info-strip {
    display: grid;
    grid-template-columns: 1fr;
  }
  .system-info-item {
    justify-content: space-between;
  }
}
