:root {
  font-family: Arial, sans-serif;
  color: #111;
  background: #f4f4f4;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #f4f4f4;
}

body {
  color: #111;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 170px 16px;
}

.card {
  background: #fff;
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.hidden {
  display: none;
}

.top-card {
  margin-top: 10px;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.checkbox-row {
  display: block;
}

label {
  font-size: 15px;
  font-weight: 600;
}

select,
.start-btn,
.stop-btn {
  width: 100%;
  font-size: 17px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #ddd;
}

.start-btn,
.stop-btn {
  cursor: pointer;
}

.start-btn {
  background: #111;
  color: #fff;
  border: none;
}

.status {
  margin-top: 12px;
  font-weight: 600;
  font-size: 15px;
}

h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 28px;
}

.turn {
  border-top: 1px solid #ececec;
  padding: 16px 0;
}

.turn:first-child {
  border-top: none;
  padding-top: 0;
}

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

.turn-speaker {
  font-size: 20px;
  font-weight: 700;
}

.turn-time {
  font-size: 17px;
}

.turn-block {
  margin-bottom: 12px;
}

.turn-block:last-child {
  margin-bottom: 0;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.text-box {
  font-size: 18px;
  line-height: 1.4;
}

.translated {
  position: relative;
  border-radius: 16px;
  padding: 14px;
  padding-right: 52px;
  border: 1px solid transparent;
}

.turn.patient .translated {
  background: #fff1f1;
  border-color: #f2c8c8;
}

.turn.ambu .translated {
  background: #fff8d8;
  border-color: #ebd667;
}

.speak-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speak-icon:active {
  transform: scale(0.97);
}

.sbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sbar-list {
  display: grid;
  gap: 10px;
}

.sbar-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: start;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid #ececec;
  background: #fafafa;
}

.sbar-key {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.sbar-item.s .sbar-key {
  color: #d92f2f;
}

.sbar-item.b .sbar-key {
  color: #666;
}

.sbar-item.a .sbar-key {
  color: #d88c00;
}

.sbar-item.r .sbar-key {
  color: #1e7a43;
}

.sbar-value {
  font-size: 17px;
  line-height: 1.45;
}

.sbar-empty {
  font-size: 16px;
  color: #666;
}

.sticky-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: linear-gradient(to top, rgba(244,244,244,1) 75%, rgba(244,244,244,0));
  padding: 12px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.sticky-inner {
  max-width: 760px;
  margin: 0 auto;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.control-btn {
  width: 100%;
  min-height: 78px;
  border: none;
  border-radius: 18px;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
}

.red {
  background: #d92f2f;
  color: #fff;
}

.yellow {
  background: #f2c736;
  color: #111;
}

.control-btn.active {
  box-shadow: inset 0 0 0 4px rgba(0,0,0,0.16);
  transform: scale(0.99);
}

.stop-btn {
  width: 100%;
  background: #111;
  color: white;
  border: none;
  margin-top: 12px;
  font-size: 21px;
  font-weight: 700;
  min-height: 58px;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .app {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 180px;
  }

  .card {
    border-radius: 20px;
    padding: 16px;
  }

  h2 {
    font-size: 26px;
  }

  .turn-speaker {
    font-size: 18px;
  }

  .turn-time {
    font-size: 16px;
  }

  .text-box {
    font-size: 17px;
  }

  .control-btn {
    min-height: 76px;
    font-size: 26px;
    border-radius: 16px;
  }

  .sbar-item {
    grid-template-columns: 44px 1fr;
    gap: 10px;
  }

  .sbar-key {
    font-size: 22px;
  }

  .sbar-value {
    font-size: 16px;
  }
}
