/* Shared chrome. Brand colors stay blue #0058a6 and orange #f17125. */
* {
  font-family: Inter, "Segoe UI", sans-serif;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  color: #1f2937;
  line-height: 1.5;
}

body:not(:has(.login-card)) {
  background: #f3f7fb;
}

button,
input,
select {
  font-family: inherit;
}

header.top-nav {
  border-bottom: 3px solid #f17125;
}

@media (min-width: 901px) {
  header.top-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
    height: 64px;
    padding: 0 28px;
  }

  header.top-nav > .brand-logo-wrap {
    justify-self: start;
    min-width: 0;
  }

  header.top-nav > .header-title,
  header.top-nav > .top-nav-title {
    justify-self: center;
    max-width: min(520px, 46vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }

  header.top-nav > .product-brand,
  header.top-nav > .top-nav-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
  }
}

.section-title,
.panel-header-title,
.dashboard-status-header h3,
.panel h2 {
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.dashboard-status-header h3 {
  font-size: 16px;
  color: #0058a6;
}

.video-card,
.section-card,
.card-panel,
.table-card,
.panel,
#recorderPage .recorder-card {
  border-color: #d8e2ec;
  border-radius: 12px;
}

.nav-item {
  min-height: 42px;
  line-height: 1.2;
}

.btn-custom,
.btn-primary-orange,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-back-shell,
.header-logout,
.btn-signout,
.header-link,
.edit-video-button,
.admin-tab,
.tab,
.m3-file-button,
.upload-type-row button {
  border-radius: 8px;
  letter-spacing: -0.011em;
  line-height: 1.2;
}

.btn-custom,
.btn-back-shell,
.header-logout,
.btn-signout,
.header-link,
.btn-secondary,
.btn-danger,
.m3-file-button,
.admin-tab,
.tab {
  font-weight: 650;
}

.btn-primary-orange,
.btn-custom.primary,
.btn-primary,
.edit-video-button,
.submit-btn {
  font-weight: 700;
  border-radius: 8px;
  letter-spacing: -0.011em;
}

.btn-custom,
.btn-primary-orange,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-back-shell,
.edit-video-button,
.m3-file-button,
.upload-type-row button {
  min-height: 40px;
}

.header-logout,
.btn-signout,
.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
}

.m3-file-button {
  border: 1px solid #d8e2ec;
  color: #0058a6;
  background: #ffffff;
  padding: 0 16px;
}

.m3-file-button:hover {
  background: #eef6fc;
  border-color: #0058a6;
}

.btn-custom:focus-visible,
.btn-primary-orange:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.btn-back-shell:focus-visible,
.header-logout:focus-visible,
.btn-signout:focus-visible,
.header-link:focus-visible,
.edit-video-button:focus-visible,
.nav-item:focus-visible,
.tab:focus-visible,
.admin-tab:focus-visible,
.submit-btn:focus-visible,
.m3-file-button:focus-visible,
.upload-type-row button:focus-visible,
.text-link:focus-visible {
  outline: 2px solid #f17125;
  outline-offset: 2px;
}

.input-text,
.title-input,
.input-title,
textarea.script-editor,
textarea.notes-input,
.textarea-custom,
.form-field > label {
  letter-spacing: -0.011em;
}

.input-text,
.title-input,
.input-title {
  min-height: 42px;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  color: #1f2937;
  font-size: 14px;
}

.form-field > label {
  font-size: 13px;
  font-weight: 650;
  color: #3a4a5a;
}

textarea.script-editor,
textarea.notes-input,
.textarea-custom {
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  color: #1f2937;
}

.input-text:focus,
.title-input:focus,
.input-title:focus,
textarea.script-editor:focus,
textarea.notes-input:focus,
.textarea-custom:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: #f17125;
  box-shadow: 0 0 0 2px rgba(241, 113, 37, 0.18);
}

@media (min-width: 641px) {
  .builder-meta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    max-width: 100%;
  }

  .builder-meta .page-title-row.title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    margin: 0 0 14px;
    max-width: none;
  }

  .builder-meta .page-title-row.title-row > label {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .builder-meta .description-row,
  .builder-meta .script-length-row {
    margin-top: 0;
  }

  .builder-meta .script-length-row {
    margin-bottom: 24px;
  }

  .builder-meta .page-title-row.title-row:first-child {
    position: relative;
    width: max-content;
    max-width: 100%;
  }

  .builder-meta #videoTitleInput {
    width: 376px;
    max-width: 100%;
    flex: 0 0 376px;
  }

  .builder-meta .page-title-row.description-row {
    width: 0;
    min-width: 100%;
    overflow: visible;
  }

  .builder-meta #videoDescriptionInput {
    flex: 0 0 365px;
    width: 365px;
    min-width: 365px;
    max-width: none;
  }

  .builder-meta #targetScriptLength {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    max-width: none;
  }

  .builder-meta .edit-icon {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
  }
}

.login-card .tagline,
.reset-card .tagline {
  letter-spacing: -0.02em;
}
