:root {
  --bg: #F5EFE6;
  --card-bg: #FFFFFF;
  --primary: #1F4E79;
  --accent-red: #D9534F;
  --accent-yellow: #F0AD4E;
  --accent-green: #4A7C59;
  --text-main: #2C3E50;
  --text-muted: #7F8C8D;
  --border: #E5DDD0;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  padding-bottom: 40px;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 480px;
  padding: 16px;
}

/* Home Screen Install Banner */
.install-banner {
  background: #FFF8E7;
  border: 1.5px solid var(--accent-yellow);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #856404;
}
.install-banner button {
  background: var(--accent-yellow);
  border: none;
  color: #FFF;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Header & Status */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
}
.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
}
.phone-button {
  border: 1px solid black;
  height: 50px;
  width: 50px;
  border-radius: 25px;
  background-color: var(--base-bg);
  cursor: pointer;
  color: var(--text-color)
}
.phone-button:hover {
  background-color: color-mix(in srgb, var(--base-bg), white 20%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-red { background: var(--accent-red); }
.dot-yellow { background: var(--accent-yellow); }
.dot-blue { background: var(--primary); }

.device-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.device-url {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.status-badge {
  background: #E8F5E9;
  color: var(--accent-green);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
}

/* Navigation Tabs (Announce -> Contacts -> Voice -> Settings) */
.tabs-nav {
  display: flex;
  background: #EAE3D5;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tab-btn.active {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Content Panels */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Card Styling */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Announcement Voice Recorder */
.announce-mic-container {
  text-align: center;
  padding: 20px 0;
}
.record-btn-big {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #FADBD8;
  background: var(--accent-red);
  color: white;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(217, 83, 79, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background-color 0.2s;
}
.record-btn-big.recording {
  animation: pulse 1s infinite alternate;
  background: #C0392B;
}
@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); box-shadow: 0 8px 28px rgba(217, 83, 79, 0.6); }
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.pill {
  background: #F0EDE6;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}
.pill:hover, .pill:active {
  background: var(--primary);
  color: white;
}

/* Announcement History (Last 4) */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #FAF8F5;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.history-info {
  flex: 1;
}
.history-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  background: transparent;
  border: none;
  width: 90%;
}
.history-time {
  font-size: 11px;
  color: var(--text-muted);
}
.history-actions {
  display: flex;
  gap: 8px;
}
.btn-small {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.btn-preview {
  background: #EAE3D5;
  color: var(--text-main);
}
.btn-resend {
  background: var(--primary);
  color: white;
}

/* Contact Cards */
.contact-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  background: #FAFAFA;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.contact-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-name-input {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.contact-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}

/* Form Inputs & Sliders */
.field {
  margin-bottom: 14px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
input[type="text"], input[type="password"], input[type="time"], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 15px;
  outline: none;
  background: #FAFAFA;
}
input:focus {
  border-color: var(--primary);
  background: white;
}
.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}
.safe-badge {
  background: #E8F5E9;
  color: var(--accent-green);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

/* Primary Action Buttons */
.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(31, 78, 121, 0.25);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Inline Loading Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
