.chip:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.8);
  outline-offset: 2px;
}
:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #ffffff;
  background-color: #000000;
  overflow-x: hidden;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}


body, html, #root, .app-shell {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body,
#root,
.app-shell {
  width: var(--app-viewport-width, 100%);
  max-width: var(--app-viewport-width, 100%);
}

.app-shell {
  position: relative;
  isolation: isolate;
  min-height: var(--app-viewport-height, 100dvh);
  overflow-x: clip;
}

.app-background {
  position: fixed;
  inset: 0;
  background-image: url('/img/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.1;
  z-index: 0;
  pointer-events: none;
}

.app-shell > :not(.app-background):not(.verification-dialog-backdrop) {
  position: relative;
  z-index: 1;
}

body {
  background-color: #0f172a;
}

.surface-card {
  border-radius: 1rem;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-light .surface-card {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}

.theme-dark .surface-card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.surface-card :where(h1, h2, h3, h4, h5, h6, p, span, div, strong, small, li, a, label, pre) {
  color: inherit;
}

.surface-card .secondary-badge,
.surface-card .muted-badge,
.surface-card .feedback {
  color: inherit;
}

.theme-light .surface-card .details-json {
  background: rgba(15, 23, 42, 0.08);
}

.theme-dark .surface-card .details-json {
  background: rgba(255, 255, 255, 0.08);
}

.auth-card, .panel, .form-loader, .top-bar, .category-chips {
  background: rgb(57 97 99 / 26%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(420px, calc(100% - 2rem));
  padding: 2.5rem 1.5rem;
  max-width: 420px;
  margin: 0 auto;
  height: 100%;
  color: #fff;
}

.auth-header h1 {
  margin: 0;
  font-size: 2.2rem;
}

.auth-header p {
  margin: 0.25rem 0 1.5rem;
  color: rgba(255, 255, 255, 0.8);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field.field-required span {
  color: #fecaca;
}

.field-required-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(254, 202, 202, 0.55);
  color: #fff1f2;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field-required-hint {
  color: #ffe4e6;
  font-size: 0.78rem;
  font-weight: 600;
}

.field span {
  font-size: 0.85rem;
  font-weight: 500;
}

.auth-support-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-top: -0.1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(191, 219, 254, 0.28);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.22), rgba(30, 41, 59, 0.32));
}

.auth-support-copy {
  min-width: 0;
}

.auth-support-copy strong {
  display: block;
  color: #eff6ff;
  font-size: 0.92rem;
  line-height: 1.2;
}

.auth-support-button {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.auth-support-button:hover:not(:disabled),
.auth-support-button:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px);
}

.auth-support-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-dialog-backdrop {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-dialog.surface-card,
.theme-light .auth-dialog.surface-card,
.theme-dark .auth-dialog.surface-card {
  width: min(100%, 320px);
  padding: 1.15rem;
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.92));
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.5);
}

.auth-dialog-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.auth-dialog-header p {
  margin: 0.35rem 0 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.84rem;
  line-height: 1.45;
}

.auth-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.auth-dialog-success {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.auth-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
}

.auth-dialog-actions-single {
  justify-content: center;
}

.field input,
.field select {
  padding: 0.75rem;
  border-radius: 999px;
  border: none;
  outline: none;
  font-size: 0.95rem;
}

.company-code-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.company-code-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 480px) {
  .auth-support-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-support-button {
    width: 100%;
  }

  .auth-dialog-backdrop {
    padding: 0.9rem;
  }

  .auth-dialog {
    width: 100%;
  }

  .auth-dialog-actions {
    flex-direction: column-reverse;
  }

  .auth-dialog-actions .primary,
  .auth-dialog-actions .secondary {
    width: 100%;
    justify-content: center;
  }
}

.company-code-dash {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  opacity: 0.9;
}

.locale-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.locale-option {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 0.75rem;
  padding: 0.55rem 0.5rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
}

.locale-option.active {
  border-color: rgba(56, 189, 248, 0.9);
  background: rgba(56, 189, 248, 0.22);
}

.locale-flag {
  width: 22px;
  height: 15px;
  border-radius: 0.15rem;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.primary {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #38bdf8;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 600;
}

.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: inherit;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 1rem;
}

.cta-row .ghost {
  margin-top: 0;
}

.top-bar .ghost {
  margin-top: 0;
}

.feedback {
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
}

.feedback.error {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.feedback.info {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.feedback.success {
  background: rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
  font-weight: 700;
  text-align: center;
}

.verification-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.verification-dialog {
  width: min(100%, 420px);
  padding: 1.5rem;
  color: #fff;
}

.verification-dialog h2 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

.verification-dialog p {
  margin: 0;
  line-height: 1.5;
}

.verification-dialog-note {
  margin-top: 0.85rem !important;
  color: rgba(191, 219, 254, 0.96);
}

.verification-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.verification-dialog-actions .ghost {
  margin-top: 0;
}

.start-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: var(--app-viewport-height, 100dvh);
  width: 100%;
  max-width: 100%;
  color: #fff;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  padding-top: 0;
  overflow-x: clip;
}

.start-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

.start-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1;
}

.start-screen > :not(.start-background) {
  position: relative;
  z-index: 2;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--safe-area-top) + 1rem) calc(var(--safe-area-right) + 1.5rem) 1rem calc(var(--safe-area-left) + 1.5rem);
  z-index: 10;
}

.top-bar-spacer {
  min-width: 64px;
}

.company-info h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.company-info span {
  font-size: 0.8rem;
  opacity: 0.8;
}

.hero-company-info {
  width: min(440px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hero-company-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hero p.hero-company-header {
  margin: 0;
  max-width: 60%;
  text-align: right;
  font-size: 1rem;
  line-height: 1.35;
  opacity: 0.9;
}

.actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.logout-button {
  min-width: 74px;
  justify-content: center;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.exit-button {
  min-width: 56px;
  justify-content: center;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.avatar-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.avatar-icon circle,
.avatar-icon path {
  fill: transparent;
  stroke: #fff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.hero-panel {
  width: min(560px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  background: rgb(57 97 99 / 26%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero h1 {
  font-size: 2rem;
  width: min(440px, 100%);
  max-width: 100%;
  margin: 0 auto;
  text-align: left;
}

.hero p {
  width: min(440px, 100%);
  max-width: 100%;
  margin: 0 auto;
  text-align: left;
  color: rgba(255, 255, 255, 0.8);
}

.cta-row {
  width: min(440px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.home-nav-button {
  min-height: 96px;
  border-radius: 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  position: relative;
  cursor: pointer;
}

.home-nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.home-nav-button-wide {
  width: min(440px, 100%);
  max-width: 100%;
  margin: 0 auto;
  min-height: 58px;
  flex-direction: row;
  gap: 0.4rem;
}

.cta-wide-column {
  width: min(440px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-nav-label {
  font-size: 0.95rem;
  font-weight: 500;
}

.home-nav-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.home-nav-icon path,
.home-nav-icon rect,
.home-nav-icon circle {
  fill: transparent;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-nav-button .badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
}

.profile-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-form-actions .ghost {
  margin-top: 0;
}

.profile-form .field input {
  border: 1px solid #94a3b8;
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: #fff;
}

.profile-form .field.field-required input {
  border-color: #ef4444;
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28);
}

.profile-required-notice {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid rgba(254, 202, 202, 0.55);
  background: rgba(127, 29, 29, 0.32);
}

.profile-required-notice strong {
  font-size: 0.96rem;
}

.profile-required-notice span {
  color: #ffe4e6;
  font-size: 0.82rem;
}

button {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.97);
}

.notifications-screen,
.questions-screen,
.meeting-screen,
.progress-screen,
.tips-screen,
.library-screen, 
.forms-screen,
.profile-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: #fff;
}

.profile-screen {
  height: auto;
  min-height: 100vh;
  min-height: var(--app-viewport-height, 100dvh);
  overflow: visible;
}

.notifications-body,
.questions-body,
.meeting-body,
.progress-body,
.tips-body,
.library-body, 
.forms-body,
.profile-body {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: calc(5rem + var(--safe-area-top));
  max-width: 100%;
  min-width: 0;
}

.profile-body {
  flex: 0 0 auto;
  overflow: visible;
}

.page-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.notifications-panel,
.questions-panel,
.meeting-panel,
.tips-panel,
.library-panel,
.progress-panel,
.forms-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  min-width: 0;
}

.notifications-panel,
.questions-panel,
.meeting-panel,
.tips-panel,
.library-panel,
.progress-panel {
  gap: 0.875rem;
}

.meeting-form {
  gap: 0.8rem;
}

.meeting-form h3 {
  margin: 0;
}

.meeting-description {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.9;
}

.meeting-camera-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.meeting-camera-status {
  font-size: 0.85rem;
  opacity: 0.9;
}

.meeting-camera-preview {
  width: 100%;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(2, 6, 23, 0.42);
}

.meeting-camera-preview video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(56vh, 460px);
  object-fit: cover;
}

.meeting-or-divider {
  font-size: 0.8rem;
  opacity: 0.82;
}

.question-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-card {
  padding: 1rem;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.question-card.loading {
  text-align: center;
}

.question-message {
  font-weight: 600;
  font-size: 1rem;
}

.question-meta {
  display: flex;
  gap: 0.6rem;
  font-size: 0.82rem;
  opacity: 0.85;
  flex-wrap: wrap;
}

.question-answer {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 0.55rem;
}

.question-answer strong {
  display: block;
  margin-bottom: 0.2rem;
}

.question-answer p {
  margin: 0;
}

.question-form {
  gap: 0.8rem;
}

.question-form h3 {
  margin: 0;
}

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

.list-header h3 {
  margin: 0;
}

.notification-list,
.progress-list,
.tips-list,
.library-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notification-card {
  padding: 1rem;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-card {
  background: rgba(248, 250, 252, 0.95);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.progress-card.loading {
  text-align: center;
  color: #475569;
}

.progress-title {
  font-weight: 600;
  font-size: 1rem;
}

.progress-meta {
  font-size: 0.85rem;
  color: #475569;
  display: flex;
  gap: 0.5rem;
}

.progress-body .feedback.info {
  background: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

.tip-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tip-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tip-content p,
.tip-content ul,
.tip-content ol,
.tip-content blockquote {
  margin: 0;
}

.tip-content ul,
.tip-content ol {
  padding-left: 1.25rem;
}

.tip-content a {
  color: inherit;
}

.tip-card.loading {
  text-align: center;
}

.tip-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.tip-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.secondary-badge {
  background: rgba(37, 99, 235, 0.2);
  color: #1d4ed8;
}

.tip-meta {
  font-size: 0.8rem;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.category-chips.expanded {
  margin-bottom: 1.5rem;
}

.more-chip {
  background: rgba(56, 189, 248, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
  font-weight: 500;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

.chip.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
}

.library-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.library-card.loading {
  text-align: center;
}

.library-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.library-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}

.library-card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.library-card-actions .secondary {
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

.library-card-actions .secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.library-card-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.library-card-header p {
  margin: 0.35rem 0 0;
}

.library-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  justify-content: flex-start;
}

.library-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.library-viewer-screen {
  min-height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.library-viewer-header {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 auto;
  margin: 1rem 1rem 0;
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr minmax(52px, auto);
  align-items: center;
  gap: 0.75rem;
}

.library-viewer-title {
  min-width: 0;
  text-align: center;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-viewer-body {
  flex: 1;
  min-height: 0;
  padding: 0 1rem 1rem;
  display: flex;
  overflow: hidden;
  min-width: 0;
}

.library-viewer-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.library-viewer-pdf {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0.75rem;
  border-radius: 16px;
  overflow: auto;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.library-viewer-pdf.zoomed {
  touch-action: pan-x pan-y;
}

.library-viewer-pdf.hidden {
  display: none;
}

.library-viewer-pdf-shell {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.library-viewer-image-shell {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.library-viewer-video-shell {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.library-viewer-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.library-viewer-toolbar-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.library-viewer-back-button {
  margin-top: 0;
}

.library-viewer-toolbar-row-zoom {
  align-items: center;
}

.library-viewer-zoom-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.library-viewer-icon-button {
  
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

.library-viewer-icon-glyph {
  display: block;
  color: inherit;
  line-height: 1;
  transform: translateY(-1px);
}

.library-viewer-image-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 1rem;
  box-sizing: border-box;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  touch-action: pan-x pan-y;
}

.library-viewer-video-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 1rem;
  box-sizing: border-box;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.library-viewer-video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 10rem);
  border-radius: 12px;
  background: #000;
}

.library-viewer-image-stage.zoomed {
  padding: 1rem;
}

.library-viewer-image-layout {
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.library-viewer-image-canvas {
  min-width: 100%;
  min-height: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: visible;
}

.library-viewer-image-canvas.zoomed {
  min-width: 0;
  min-height: 0;
  max-width: none;
  display: block;
  flex: 0 0 auto;
}

.library-viewer-image {
  display: block;
  width: auto;
  max-width: calc(100vw - 3.5rem);
  max-height: calc(100vh - 11.75rem);
  object-fit: contain;
}

.library-viewer-image-canvas.zoomed .library-viewer-image {
  display: block;
  object-fit: contain;
}

.library-viewer-status {
  width: min(560px, 100%);
  margin: auto;
  color: #fff;
}

.library-viewer-pdf-page {
  display: flex;
  justify-content: center;
  min-width: 100%;
}

.library-viewer-pdf.zoomed .library-viewer-pdf-page {
  width: max-content;
  justify-content: flex-start;
}

.library-viewer-pdf-page + .library-viewer-pdf-page {
  margin-top: 0.75rem;
}

.library-viewer-pdf-page canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.library-viewer-pdf.zoomed .library-viewer-pdf-page canvas {
  max-width: none;
}

.library-viewer-empty {
  width: min(560px, 100%);
  margin: auto;
  color: #fff;
}

.library-viewer-choice-panel {
  width: min(560px, 100%);
  margin: auto;
  display: grid;
  gap: 1rem;
}

.library-viewer-choice-copy {
  display: grid;
  gap: 0.75rem;
}

.library-viewer-choice-copy h3,
.library-viewer-choice-copy p {
  margin: 0;
}

.library-viewer-choice-actions {
  display: grid;
  gap: 0.75rem;
}

.toolbox-debug-panel {
  gap: 0.9rem;
}

.toolbox-debug-export-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #dbeafe;
}

.toolbox-debug-export {
  width: 100%;
  min-height: 220px;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}

.toolbox-debug-export:focus {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 2px;
}

.toolbox-debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.toolbox-debug-header h3 {
  margin: 0;
}

.library-debug-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbox-debug-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toolbox-debug-entry {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.toolbox-debug-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.toolbox-debug-entry-header strong,
.toolbox-debug-entry-header span {
  color: #fff;
}

.toolbox-debug-entry-header span {
  font-size: 0.82rem;
  color: #cbd5f5;
}

.toolbox-debug-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.toolbox-debug-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.toolbox-debug-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bed8fd;
}

.toolbox-debug-pre {
  margin: 0;
  max-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}

.library-card-details {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.details-json {
  margin: 0;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  overflow-x: hidden;
  overflow-x: auto;
}

.muted-badge {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.notification-card.loading,
.notification-card.empty {
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: default;
}

.notification-title {
  font-weight: 600;
  font-size: 1rem;
}

.notification-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.8;
  align-items: center;
}

.notification-photo {
  margin-top: 0.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  max-height: 220px;
}

.notification-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left;
  display: block;
}

.attachment-group ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: inherit;
}

.attachment-group a {
  color: inherit;
  text-decoration: none;
}

.attachment-group a:hover {
  text-decoration: underline;
}


.forms-panel {
  gap: 1.25rem;
}

.form-loader,
.panel,
.form-submission-result,
.form-response-card,
.form-runner {
  color: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-response-card {
  background: rgb(57 97 99 / 26%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

.form-response-card :where(h1, h2, h3, h4, h5, h6, p, span, div, strong, small, li, a, label) {
  color: inherit;
}

.form-loader p,
.form-submission-result p {
  margin: 0;
  color: #cbd5f5;
}

.loader-row {
  display: flex;
  gap: 0.75rem;
}

.form-text-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5f5;
  font-size: 0.95rem;
}

.forms-directory-search {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.form-directory-card,
.form-history-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
}

.form-history-card {
  background: rgba(248, 250, 252, 0.95);
  border-radius: 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: black;
}

.form-directory-card.loading {
  justify-content: center;
}

.form-directory-card h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.form-directory-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.forms-directory-list,
.forms-history-list,
.form-response-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-history-card.loading {
  justify-content: center;
  color: #475569;
}

.form-history-card.active {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
}

.form-history-card h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.form-history-card span {
  font-size: 0.85rem;
  color: #64748b;
}

.form-response-card {
  gap: 1.25rem;
}

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

.form-response-header h3 {
  margin: 0;
}

.form-response-header span {
  font-size: 0.85rem;
  color: #bed8fd;
}

.form-response-section h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.form-response-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.05);
}

.form-response-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-response-value {
  font-size: 0.9rem;
  color: #c3dbfb;
  word-break: break-word;
}

.form-response-link {
  font-size: 0.9rem;
  color: #2563eb;
}

.form-runner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.form-runner-header h2 {
  margin: 0;
}

.form-runner-actions {
  display: flex;
  gap: 0.5rem;
}

.form-runner-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-question {
  display: flex;
  flex-direction: column;
}

.form-question.has-error {
  border-color: rgba(239, 68, 68, 0.4);
}

.form-question-header h4 {
  margin: 0;
  font-size: 1rem;
}

.question-subtitle {
  margin: 0.25rem 0 0;
  color: #cbd5f5;
  font-size: 0.9rem;
}

.form-question-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #cbd5f5;
}

.required-indicator {
  margin-left: 0.35rem;
  color: #ef4444;
}

.form-question-images {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-question-images img {
  max-height: 140px;
  border-radius: 0.6rem;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.form-question-control input[type="text"],
.form-question-control textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5f5;
  font-size: 0.95rem;
}

.form-question-control textarea {
  resize: vertical;
  min-height: 120px;
}

.form-question-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.form-question-error {
  font-size: 0.85rem;
  color: #ef4444;
}

.form-question-slider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-question-slider input[type="range"] {
  flex: 1;
}

.slider-value {
  font-size: 0.9rem;
  color: #475569;
  min-width: 60px;
}

.form-question-upload {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-name {
  font-size: 0.85rem;
  color: #475569;
}

.signature-pad {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  border-radius: 0.75rem;
  border: 2px dashed rgba(15, 23, 42, 0.2);
  background: #fff;
  touch-action: none;
}

@media (max-width: 550px) {

  .home-nav-button {
    padding:10px;
    min-height:50px;
  }

  .top-bar {
    padding: calc(var(--safe-area-top) + 0.75rem) calc(var(--safe-area-right) + 1rem) 0.75rem calc(var(--safe-area-left) + 1rem);
  }

  .top-bar-spacer {
    min-width: 52px;
  }

  .actions {
    gap: 0.5rem;
  }

  .secondary,
  .ghost {
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
  }

  .logout-button {
    min-width: 64px;
  }

  .exit-button {
    min-width: 54px;
  }

  .avatar {
    width: 40px;
    height: 40px;
  }

  .hero {
    padding: 2rem 1rem 2rem;
  }

  .hero-panel {
    width: 100%;
    padding: 1.1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero-company-info {
    gap: 0.75rem;
  }

  .notifications-body,
  .progress-body,
  .tips-body,
  .library-body,
  .forms-body,
  .profile-body {
    padding: 1rem;
    margin-top: calc(4.25rem + var(--safe-area-top));
  }

  .library-viewer-body {
    padding: 0 1rem 1rem;
    margin-top: 0.25rem;
  }

  .library-viewer-header {
    margin: 0.75rem 1rem 0;
    grid-template-columns: minmax(72px, auto) 1fr minmax(40px, auto);
  }

  .library-viewer-frame {
    min-height: 0;
  }

  .library-viewer-pdf {
    min-height: 0;
  }

  .library-viewer-image {
    max-width: calc(100vw - 2.5rem);
    max-height: calc(100vh - 10.75rem);
  }

  .page-title {
    font-size: 1.1rem;
  }

  .panel,
  .form-loader,
  .form-submission-result,
  .form-response-card,
  .form-runner,
  .notification-card,
  .tip-card,
  .library-card,
  .form-directory-card,
  .form-history-card,
  .progress-card {
    padding: 0.45rem;
  }

  .forms-directory-search {
    gap: 0.5rem;
  }

  .form-text-input {
    padding: 0.65rem 0.85rem;
  }

  .form-runner-header,
  .form-runner-footer,
  .form-response-header,
  .library-card-header,
  .library-card-actions {
    gap: 0.5rem;
  }

  .locale-selector {
    gap: 0.35rem;
  }

  .locale-option {
    padding: 0.45rem 0.4rem;
    font-size: 0.74rem;
  }

  .locale-flag {
    width: 20px;
    height: 14px;
  }

  .library-card-tags {
    display: none;
  }

  .library-card-meta {
    display: none;
  }

  .toolbox-debug-grid {
    grid-template-columns: 1fr;
  }

  .toolbox-debug-entry,
  .toolbox-debug-header {
    gap: 0.6rem;
  }

  .toolbox-debug-header,
  .toolbox-debug-entry-header {
    flex-direction: column;
  }
}

@media (min-width: 768px) and (min-height: 500px) {
  .auth-card {
    border-radius: 24px;
    margin-top: 4rem;
    height: auto;
    min-height: 500px;
  }

  .start-screen {
    overflow: hidden;
  }

  .profile-screen {
    border-radius: 24px;
    margin: 1.5rem auto;
    max-width: 480px;
  }

  .notifications-screen,
  .questions-screen,
  .meeting-screen,
  .progress-screen,
  .tips-screen,
  .library-screen,
  .forms-screen,
  .profile-screen {
    border-radius: 24px;
    overflow: hidden;
  }

  .profile-screen {
    overflow: visible;
  }

  .notifications-screen .top-bar,
  .questions-screen .top-bar,
  .meeting-screen .top-bar,
  .progress-screen .top-bar,
  .tips-screen .top-bar,
  .library-screen .top-bar,
  .forms-screen .top-bar,
  .profile-screen .top-bar {
    padding: calc(var(--safe-area-top) + 1rem) calc(var(--safe-area-right) + 1.5rem) 1rem calc(var(--safe-area-left) + 1.5rem);
  }
}
