@font-face {
  font-family: "Garet";
  src: url("/assets/Garet-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root { --black:#000; --muted:#777; --line:#dedede; }
* { box-sizing:border-box; }
body { margin:0; background:#fff; color:#000; font-family:"Garet",Arial,sans-serif; }
button,input { font:inherit; }
.brand-logo { width:228px; height:auto; display:block; }
.panel { background:#fff; border:1px solid #000; border-radius:12px; }
.profile-button { width:48px; height:48px; border:0; border-radius:999px; background:#000; display:grid; place-items:center; cursor:pointer; transition:transform .15s ease; overflow:hidden; }
.profile-button:hover { transform:scale(1.04); }
.profile-button svg { width:28px; height:28px; }
.gmail-toolbar { height:55px; padding:0 14px; border-bottom:1px solid #ececec; display:flex; align-items:center; justify-content:space-between; }
.gmail-wordmark { font-family:Arial,sans-serif; font-size:18px; font-weight:500; }
.icon-button { width:34px; height:34px; border:0; background:transparent; border-radius:999px; cursor:pointer; }
.icon-button:hover { background:#f4f4f4; }
.gmail-nav { width:100%; border:0; background:transparent; text-align:left; padding:9px 10px; border-radius:0 999px 999px 0; font-size:10px; cursor:pointer; }
.gmail-nav:hover,.gmail-nav.active { background:#f0f0f0; font-weight:600; }
.gmail-search,.database-search { width:100%; height:38px; border:1px solid #ddd; border-radius:7px; padding:0 12px; outline:none; font-size:10px; }
.gmail-search:focus,.database-search:focus,.field input:focus { border-color:#000; }
.gmail-list { background:#fff; }
.gmail-row { width:100%; display:flex; gap:10px; align-items:center; padding:12px; border:0; border-bottom:1px solid #eee; cursor:pointer; text-align:left; background:#fff; }
.gmail-row:hover { background:#f8f8f8; }
.gmail-sender { font-size:10px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gmail-subject { font-size:10px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gmail-snippet { color:#888; font-size:9px; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mail-source { border:1px solid #ddd; border-radius:999px; padding:2px 5px; font-size:7px; color:#666; }
.attachment-badge { border-radius:4px; background:#000; color:#fff; font-size:7px; padding:3px 5px; }
.empty-gmail { padding:55px 25px; text-align:center; color:#888; font-size:10px; line-height:1.7; }
.upload-zone { min-height:125px; border:1px dashed #aaa; border-radius:8px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; cursor:pointer; transition:.15s ease; }
.upload-zone:hover,.upload-zone.dragover,.upload-zone.selected { border-color:#000; background:#fafafa; }
.field { display:block; }
.field span { display:block; font-size:10px; font-weight:600; margin-bottom:6px; }
.field input { width:100%; height:39px; border:1px solid #dedede; border-radius:7px; padding:0 11px; outline:none; font-size:10px; }
.primary-button,.secondary-button { height:37px; border-radius:6px; padding:0 15px; font-size:10px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; text-decoration:none; }
.primary-button { border:0; background:#000; color:#fff; }
.primary-button:hover { background:#222; }
.primary-button:disabled { opacity:.6; cursor:not-allowed; }
.secondary-button { border:1px solid #ddd; background:#fff; color:#000; }
.secondary-button:hover { border-color:#000; }
.spinner { width:15px; height:15px; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.eyebrow { color:#777; font-size:9px; font-weight:600; text-transform:uppercase; letter-spacing:.14em; }
.source-banner { border:1px solid #dedede; border-radius:8px; padding:10px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.source-banner.hidden { display:none; }
.analysis-card { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; overflow:hidden; border:1px solid #ddd; border-radius:8px; background:#ddd; }
.analysis-card div { background:#fff; padding:9px 10px; display:flex; justify-content:space-between; gap:8px; font-size:9px; }
.analysis-card span { color:#777; }
.analysis-card strong { font-weight:600; text-align:right; }
.attachment-card { border:1px solid #ddd; border-radius:8px; background:#fff; padding:8px; text-align:left; cursor:pointer; }
.attachment-card:hover { border-color:#000; }
.photo-card { overflow:hidden; border:1px solid #ddd; border-radius:10px; background:#fff; }
.photo-image-wrap { display:block; background:#f3f3f3; }
.photo-preview { aspect-ratio:16/10; background:#f2f2f2; object-fit:cover; width:100%; display:block; }
.photo-body { padding:12px; }
.photo-title { min-width:0; font-size:11px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.photo-meta { margin-top:9px; display:grid; gap:5px; font-size:9px; color:#777; }
.photo-meta div { display:flex; justify-content:space-between; gap:10px; }
.photo-meta strong { color:#000; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.modal { position:fixed; inset:0; z-index:50; background:rgba(0,0,0,.38); display:grid; place-items:center; padding:20px; }
.modal-card { position:relative; width:min(760px,100%); max-height:90vh; overflow:auto; background:#fff; border:1px solid #000; border-radius:12px; padding:24px; }
.modal-close { position:absolute; right:14px; top:10px; border:0; background:transparent; font-size:24px; cursor:pointer; }
.modal.hidden { display:none; }
.message-success { border-color:#b9dec4; background:#f1faf4; color:#1f6b37; }
.message-error { border-color:#f0bcbc; background:#fff5f5; color:#9a2d2d; }


.app-footer { margin-top:18px; padding:10px 2px 2px; font-size:8px; color:#777; text-align:left; }

/* Gmail follow-up helpers */
.gmail-filters { display:flex; gap:6px; padding:8px 10px; border-bottom:1px solid #eee; overflow-x:auto; background:#fff; }
.gmail-filter { flex:0 0 auto; border:1px solid #ddd; border-radius:999px; padding:5px 9px; background:#fff; font-size:8px; font-weight:600; color:#555; cursor:pointer; }
.gmail-filter:hover, .gmail-filter.active { border-color:#111; color:#111; background:#f7f7f7; }
.gmail-star { color:#e5a900; margin-right:5px; font-size:11px; vertical-align:-1px; }
.gmail-star-button { display:inline-block; margin-right:5px; font-size:13px; line-height:1; color:#b7b7b7; cursor:pointer; vertical-align:-1px; user-select:none; }
.gmail-star-button.is-starred { color:#e5a900; }
.gmail-star-button:focus-visible { outline:1px solid #111; outline-offset:2px; border-radius:2px; }
.mail-waiting { display:inline-flex; border:1px solid #f1b55d; background:#fff7e8; color:#8a5200; border-radius:999px; padding:2px 6px; font-size:7px; font-weight:700; white-space:nowrap; }
.mail-answered { display:inline-flex; border:1px solid #d8d8d8; background:#fafafa; color:#666; border-radius:999px; padding:2px 6px; font-size:7px; font-weight:600; white-space:nowrap; }

.mail-status-toggle { cursor:pointer; user-select:none; transition:filter .15s ease, transform .15s ease; }
.mail-status-toggle:hover { filter:brightness(.96); transform:translateY(-1px); }


/* Database card actions */
.copy-value {
  cursor: copy;
  transition: opacity .15s ease;
}
.copy-value:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.copy-value.copied {
  opacity: .45;
}

.photo-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eeeeee;
}
.photo-action {
  width: 30px;
  height: 30px;
  border: 1px solid #dddddd;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.photo-action:hover {
  border-color: #111111;
  background: #f7f7f7;
  transform: translateY(-1px);
}
.photo-action:disabled {
  opacity: .45;
  cursor: wait;
}
.photo-action svg {
  width: 15px;
  height: 15px;
}
.photo-trash:hover {
  background: #fff7f7;
}


/* Photo editor */
.photo-edit:hover {
  background: #f7f7ff;
}
.edit-photo-modal-card {
  width: min(650px, 100%);
}
.edit-name-preview {
  margin-top: 16px;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
  display: grid;
  gap: 4px;
}
.edit-name-preview span {
  font-size: 8px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.edit-name-preview strong {
  font-size: 10px;
  font-weight: 600;
  word-break: break-word;
}


/* V8 mobile layout */
.field-wide { grid-column: 1 / -1; }
.gmail-list { padding-bottom: 12px; scroll-padding-bottom: 12px; }

@media (max-width:640px) {
  .app-header-inner { min-height: 86px !important; }
  .app-main { padding-top: 16px !important; }
  .brand-logo { width:190px; }
  .profile-button { width:44px; height:44px; }
  .analysis-card { grid-template-columns:1fr; }

  .photo-fields-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 12px 10px !important;
  }
  .photo-fields-grid .field span { font-size:8px; margin-bottom:5px; }
  .photo-fields-grid .field input { height:37px; padding:0 9px; font-size:9px; }

  #photoGrid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap:10px !important;
  }
  .photo-card { border-radius:9px; min-width:0; }
  .photo-preview { aspect-ratio: 4 / 3; }
  .photo-body { padding:9px; }
  .photo-title { display:none; }
  .photo-meta { margin-top:0; gap:5px; font-size:7.5px; }
  .photo-meta div { display:grid; gap:2px; }
  .photo-meta span { font-size:7px; }
  .photo-meta strong { white-space:normal; overflow:visible; text-overflow:clip; line-height:1.35; }
  .photo-credit strong { font-size:8px; }
  .photo-actions { gap:5px; margin-top:8px; padding-top:8px; }
  .photo-action { width:27px; height:27px; border-radius:7px; }
  .photo-action svg { width:13px; height:13px; }
}

.import-clear-button { height:32px; padding:0 12px; flex-shrink:0; }


/* V9: Stories */
.stories-toggle { display:flex; align-items:center; gap:10px; cursor:pointer; width:max-content; max-width:100%; }
.stories-toggle input { position:absolute; opacity:0; pointer-events:none; }
.stories-switch { width:34px; height:19px; border-radius:999px; background:#dedede; position:relative; flex:none; transition:.18s ease; }
.stories-switch::after { content:""; position:absolute; width:15px; height:15px; left:2px; top:2px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.18); transition:.18s ease; }
.stories-toggle input:checked + .stories-switch { background:#111; }
.stories-toggle input:checked + .stories-switch::after { transform:translateX(15px); }
.stories-toggle > span:last-child { display:grid; gap:1px; }
.stories-toggle strong { font-size:10px; font-weight:600; }
.stories-toggle small { font-size:8px; color:#888; }
.database-tabs { display:flex; gap:3px; padding:3px; border:1px solid #e5e5e5; border-radius:9px; background:#fafafa; width:max-content; }
.database-tab { border:0; background:transparent; padding:6px 11px; border-radius:6px; font-size:9px; color:#777; cursor:pointer; }
.database-tab.active { background:#111; color:#fff; }


/* V10: unified photo categories */
.category-field { display:grid; gap:6px; }
.category-label { font-size:9px; font-weight:600; }
.category-tabs {
  display:flex;
  gap:3px;
  padding:3px;
  border:1px solid #e5e5e5;
  border-radius:9px;
  background:#fafafa;
  width:max-content;
  max-width:100%;
}
.category-tabs label { cursor:pointer; }
.category-tabs input { position:absolute; opacity:0; pointer-events:none; }
.category-tabs span {
  display:block;
  border-radius:6px;
  padding:6px 11px;
  font-size:9px;
  color:#777;
  transition:.15s ease;
}
.category-tabs input:checked + span { background:#111; color:#fff; }

@media (max-width: 520px) {
  .category-tabs { width:100%; }
  .category-tabs label { flex:1; }
  .category-tabs span { text-align:center; padding-left:6px; padding-right:6px; }
}

/* V10.5.3: compact full-bleed footer, flush with page bottom */
.brand-footer-bar {
  width: 100vw;
  margin-top: 26px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 0;
  background: linear-gradient(90deg, #000000 0%, #120A8F 100%);
}

.brand-footer-inner {
  width: 100%;
  max-width: 1280px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-sizing: border-box;
}

.brand-footer-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

/* LV is intentionally larger so its white lettering visually matches FA. */
.brand-footer-logo-lv {
  height: 23px;
  max-width: 34%;
}

.brand-footer-logo-fa {
  height: 18px;
  max-width: 30%;
}

/* Make the gradient the actual visual end of the document. */
html,
body {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

body > footer,
footer {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.brand-footer-bar:last-child {
  margin-bottom: 0 !important;
}

@media (max-width: 639px) {
  .brand-footer-bar {
    margin-top: 22px;
  }

  .brand-footer-inner {
    min-height: 50px;
    padding: 0 18px;
    gap: 14px;
  }

  .brand-footer-logo-lv {
    height: 17px;
    max-width: 38%;
  }

  .brand-footer-logo-fa {
    height: 13px;
    max-width: 33%;
  }
}

@media (max-width: 380px) {
  .brand-footer-inner {
    min-height: 46px;
    padding: 0 16px;
    gap: 12px;
  }

  .brand-footer-logo-lv {
    height: 15px;
  }

  .brand-footer-logo-fa {
    height: 11px;
  }
}


/* V10.5.4: remove the Tailwind bottom padding from <main>.
   The HTML uses `py-7`, which was leaving white space below the gradient. */
.app-main {
  padding-bottom: 0 !important;
}

/* Ensure the footer itself is the final painted area of the page. */
.app-footer {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.brand-footer-bar {
  display: block;
  margin-bottom: 0 !important;
}

@media (max-width: 639px) {
  .app-main {
    padding-bottom: 0 !important;
  }
}

/* Gmail multi-attachment import (v10.6.1) */
.attachment-use-one { display:block; width:100%; border:0; background:transparent; padding:0; text-align:left; cursor:pointer; }
.attachment-select { cursor:pointer; user-select:none; }
.attachment-card.is-selected { border-color:#000; box-shadow:0 0 0 1px #000 inset; }
.attachment-actions button:disabled { opacity:.45; cursor:not-allowed; }


/* V10.6.4 — compact "Odkaz autorovi" control */
.author-link-box {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.author-link-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  color: #202020;
  user-select: none;
}

.author-link-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.author-link-switch {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: #d7d7d7;
  position: relative;
  transition: background .16s ease;
}

.author-link-switch::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .16s ease;
}

.author-link-toggle input:checked + .author-link-switch {
  background: #120A8F;
}

.author-link-toggle input:checked + .author-link-switch::after {
  transform: translateX(13px);
}

.author-link-email {
  flex: 1 1 220px;
  max-width: 360px;
}

.photo-author-email {
  order: -1;
  margin-left: 0;
  margin-right: auto;
}

.photo-author-email.copied {
  background: #f1f1f1;
  border-color: #111111;
}

/* V10.7 — optional photo note */
.photo-note {
  grid-column: 1 / -1;
}
.photo-note strong {
  white-space: normal;
  overflow-wrap: anywhere;
}


/* V10.8 — data-saving pagination */
.photo-load-more { display:block; margin:20px auto 4px; min-width:180px; }

/* V10.8.1 — elegantnější tlačítko pro další výsledky */
.photo-load-more {
  appearance: none;
  display: block;
  width: fit-content;
  min-width: 0;
  margin: 22px auto 6px;
  padding: 10px 18px;
  border: 1px solid #d6d6d6;
  border-radius: 12px;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.photo-load-more:hover {
  background: #f7f7f7;
  border-color: #bdbdbd;
}
.photo-load-more:active {
  transform: translateY(1px);
}

/* V10.8.2 — compact load-more + aligned mobile category tabs */
.photo-load-more {
  margin: 18px auto 4px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
}

@media (max-width: 520px) {
  .database-tabs {
    width: 100%;
  }
  .database-tab {
    flex: 1;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
  }
  .photo-load-more {
    margin-top: 16px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 9px;
  }
}

/* Author database PWA */
.hidden { display:none !important; }
.authors-header { border-bottom:1px solid #000; background:#fff; }
.authors-container { width:min(1280px,100%); margin:0 auto; padding-left:32px; padding-right:32px; }
.authors-header-inner { position:relative; display:flex; min-height:116px; align-items:center; justify-content:space-between; gap:24px; }
.authors-header-title { position:absolute; left:50%; transform:translateX(-50%); margin:0; font-size:15px; font-weight:500; white-space:nowrap; }
.authors-main { padding-top:28px; }
.app-notice { margin-bottom:18px; border:1px solid #dedede; border-radius:10px; padding:11px 13px; font-size:10px; line-height:1.5; }
.app-notice.mock { background:#fafafa; color:#555; }
.app-notice.error { background:#fff5f5; border-color:#f0bcbc; color:#9a2d2d; }
.profile-image { width:100%; height:100%; object-fit:cover; border-radius:50%; }

.global-search-wrap { position:relative; margin-bottom:22px; }
.global-search { width:100%; height:56px; border:1px solid #000; border-radius:12px; padding:0 110px 0 46px; outline:none; background:#fff; font-size:12px; }
.global-search:focus { box-shadow:0 0 0 1px #000 inset; }
.search-icon { position:absolute; left:17px; top:50%; transform:translateY(-52%); font-size:22px; line-height:1; pointer-events:none; }
.search-count { position:absolute; right:16px; top:50%; transform:translateY(-50%); font-size:9px; color:#777; }

.authors-layout { display:grid; grid-template-columns:minmax(290px, 0.38fr) minmax(0, 0.62fr); gap:28px; align-items:start; min-height:560px; }
.authors-sidebar { overflow:hidden; min-height:0; align-self:start; }
.sidebar-toolbar { padding:16px; border-bottom:1px solid #ececec; }
.add-author-button { width:100%; }
.sidebar-meta { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:13px; font-size:8px; color:#777; text-transform:uppercase; letter-spacing:.1em; }
.author-list { max-height:650px; overflow:auto; }
.author-list-item { width:100%; border:0; border-bottom:1px solid #eee; background:#fff; padding:14px 16px; text-align:left; cursor:pointer; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.author-list-item:hover { background:#f8f8f8; }
.author-list-item.active { background:#f3f3f3; box-shadow:3px 0 0 #000 inset; }
.author-list-name { min-width:0; font-size:11px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.author-list-ig { margin-top:4px; font-size:9px; color:#777; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.author-list-arrow { flex:none; font-size:14px; color:#aaa; }

.author-detail-panel { min-height:0; padding:26px; align-self:start; }
.author-empty-state { min-height:505px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.author-empty-state h2 { margin:6px 0 0; font-size:19px; font-weight:600; }
.author-empty-state p { margin:7px 0 0; color:#777; font-size:10px; }
.detail-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; padding-bottom:22px; border-bottom:1px solid #eee; }
.detail-title { margin:6px 0 0; font-size:26px; line-height:1.15; font-weight:600; overflow-wrap:anywhere; }
.detail-instagram { display:inline-block; margin-top:7px; font-size:10px; color:#777; text-decoration:none; }
.detail-instagram:hover { color:#000; text-decoration:underline; }
.detail-actions { display:flex; gap:8px; flex:none; }
.danger-button:hover { background:#fff7f7; border-color:#a00; color:#900; }
.detail-section { padding:22px 0; border-bottom:1px solid #eee; }
.detail-section:last-child { border-bottom:0; padding-bottom:0; }
.detail-link { display:block; margin-top:9px; border:1px solid #ddd; border-radius:8px; padding:12px; color:#000; text-decoration:none; font-size:10px; overflow-wrap:anywhere; }
.detail-link:hover { border-color:#000; background:#fafafa; }
.detail-section-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.detail-count { font-size:8px; color:#777; }
.source-link-list { display:grid; gap:8px; margin-top:10px; }
.source-link-card { display:grid; grid-template-columns:minmax(110px,.35fr) minmax(0,.65fr) auto; gap:12px; align-items:center; border:1px solid #ddd; border-radius:8px; padding:11px 12px; text-decoration:none; color:#000; }
.source-link-card:hover { border-color:#000; background:#fafafa; }
.source-link-label { font-size:10px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.source-link-url { font-size:9px; color:#777; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.source-link-open { font-size:13px; }
.source-empty { font-size:10px; color:#777; padding:10px 0; }

.author-modal-card { width:min(680px,100%); }
.author-modal-title { margin:5px 0 20px; font-size:20px; font-weight:600; }
.author-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.sources-editor { margin-top:22px; padding-top:20px; border-top:1px solid #eee; }
.sources-editor-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.sources-help { margin-top:5px; font-size:9px; color:#777; }
.source-rows { display:grid; gap:9px; margin-top:12px; }
.source-row { display:grid; grid-template-columns:150px minmax(0,1fr) 36px; gap:8px; align-items:end; }
.source-remove { width:36px; height:39px; border:1px solid #ddd; background:#fff; border-radius:7px; cursor:pointer; }
.source-remove:hover { border-color:#900; color:#900; background:#fff7f7; }
.form-message { margin-top:16px; border:1px solid #ddd; border-radius:8px; padding:9px 11px; font-size:9px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }
.profile-menu { position:fixed; z-index:70; width:min(280px,calc(100vw - 24px)); right:max(12px, calc((100vw - 1280px)/2 + 32px)); top:92px; background:#fff; border:1px solid #000; border-radius:10px; padding:13px; box-shadow:0 12px 30px rgba(0,0,0,.12); }
.profile-menu-identity { font-size:9px; line-height:1.5; color:#555; margin-bottom:10px; overflow-wrap:anywhere; }
.profile-menu .secondary-button { width:100%; }

@media (max-width: 900px) {
  .authors-layout { grid-template-columns:1fr; min-height:0; }
  .authors-sidebar { min-height:0; }
  .author-list { max-height:340px; }
  .author-detail-panel { min-height:0; }
  .author-empty-state { min-height:0; }
}
@media (max-width: 640px) {
  .authors-container { padding-left:18px; padding-right:18px; }
  .authors-header-inner { min-height:86px; }
  .authors-header-title { display:none; }
  .authors-main { padding-top:16px; }
  .global-search { height:50px; border-radius:10px; padding-left:42px; padding-right:80px; font-size:10px; }
  .search-count { right:12px; font-size:8px; }
  .authors-layout { gap:16px; }
  .author-detail-panel { padding:18px; }
  .detail-head { position:relative; display:block; padding-right:72px; }
  .detail-actions {
    position:absolute;
    top:0;
    right:0;
    width:auto;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:6px;
  }
  .detail-actions button {
    flex:none;
    min-width:62px;
    padding:7px 9px;
    font-size:8px;
  }
  .detail-title { font-size:22px; }
  .source-link-card { grid-template-columns:1fr auto; }
  .source-link-url { grid-column:1 / -1; grid-row:2; }
  .author-form-grid { grid-template-columns:1fr; }
  .source-row { grid-template-columns:1fr 36px; border:1px solid #eee; border-radius:8px; padding:9px; }
  .source-row .field:first-child { grid-column:1 / -1; }
  .source-remove { grid-column:2; grid-row:2; }
  .sources-editor-head { align-items:flex-start; flex-direction:column; }
  .sources-editor-head .secondary-button { width:100%; }
  .modal-card { padding:20px 16px; }
  .profile-menu { top:75px; right:12px; }
}

/* Offline author database additions */
.detail-badges { display:flex; gap:6px; margin-bottom:6px; }
.status-badge { display:inline-flex; align-items:center; border:1px solid #d9d9d9; border-radius:999px; padding:4px 7px; font-size:8px; font-weight:600; color:#555; background:#fff; }
.contact-value { margin-top:9px; font-size:11px; font-weight:500; white-space:pre-wrap; }
.source-credit-card { border:1px solid #ddd; border-radius:10px; padding:12px; background:#fff; }

.source-credit-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.source-open-button { width:32px; height:32px; flex:0 0 auto; display:grid; place-items:center; border:1px solid #ddd; border-radius:8px; color:#111; text-decoration:none; background:#fff; font-size:14px; }
.source-open-button:hover { border-color:#111; background:#f8f8f8; }
.credit-copy-button { width:100%; margin-top:10px; border:1px solid #e4e4e4; border-radius:8px; background:#fafafa; min-height:45px; padding:8px 10px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; text-align:left; cursor:copy; transition:.15s ease; }
.credit-copy-button:hover { border-color:#111; background:#fff; }
.credit-copy-button.copied { border-color:#111; background:#f5f5f5; }
.credit-copy-label { font-size:7px; color:#888; text-transform:uppercase; letter-spacing:.12em; }
.credit-copy-button strong { min-width:0; font-size:10px; font-weight:600; overflow-wrap:anywhere; }
.credit-copy-icon { font-size:13px; color:#777; }
.data-menu-actions { display:grid; gap:7px; }
.profile-menu .data-menu-actions .secondary-button { width:100%; }
.copy-toast { position:fixed; z-index:100; left:50%; bottom:max(22px, calc(env(safe-area-inset-bottom) + 12px)); transform:translateX(-50%); background:#111; color:#fff; border-radius:999px; padding:8px 12px; font-size:9px; box-shadow:0 8px 24px rgba(0,0,0,.18); }
.offline-source-row { grid-template-columns:130px minmax(0,1fr) minmax(190px,.8fr) 36px; }
.source-credit-field { min-width:0; }
@media (max-width:760px){ .offline-source-row { grid-template-columns:1fr 36px; } .offline-source-row .field { grid-column:1 / -1; } .offline-source-row .source-remove { grid-column:2; grid-row:3; align-self:end; } }

/* LV-FA Authors v4 refinements */
.sidebar-toolbar { padding-bottom: 16px; }
.author-list-item,
.author-list-item:visited,
.author-list-name,
.credit-copy-button,
.credit-copy-button strong,
.detail-instagram,
.detail-instagram:visited,
.source-open-button,
.source-open-button:visited {
  color: #111 !important;
  -webkit-text-fill-color: #111;
}
.author-list-item,
.credit-copy-button,
.source-open-button {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: rgba(0,0,0,.06);
}
.author-list-name { display:block; min-width:0; }
.detail-title { margin-top: 0; }
.notes-value { margin-top:9px; font-size:11px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.field textarea {
  width:100%;
  min-height:88px;
  border:1px solid #dedede;
  border-radius:7px;
  padding:10px 11px;
  outline:none;
  resize:vertical;
  font:inherit;
  font-size:10px;
  line-height:1.5;
  color:#111;
  background:#fff;
}
.field textarea:focus { border-color:#000; }
.source-open-button svg { width:17px; height:17px; display:block; }
.credit-copy-button { grid-template-columns:minmax(0,1fr) auto; }
.credit-copy-label { display:none !important; }

@media (max-width: 640px) {
  .authors-header-title { display:none !important; }
  .brand-logo { width:190px; }
  .profile-button { width:40px; height:40px; }
  .profile-button svg { width:24px; height:24px; }
  .author-list-item { color:#111 !important; }
  .credit-copy-button strong { color:#111 !important; -webkit-text-fill-color:#111; }
}

@media (max-width: 430px) {
  .authors-header-title { display:none !important; }
  .brand-logo { width:190px; }
}

/* v4: compact content-driven panels */
.authors-layout { align-items:start; }
.authors-sidebar,
.author-detail-panel { height:auto; align-self:start; }
.author-detail-panel { overflow:visible; }
.source-credit-card { cursor:default; }
@media (max-width: 640px) {
  .authors-header-title { display:none !important; }
  .brand-logo { width:190px !important; }
  .author-detail-panel { min-height:0 !important; height:auto; }
  .authors-sidebar { min-height:0 !important; height:auto; }
  .detail-head { min-height:72px; }
}


/* v8: icon-only edit/delete actions */
.detail-actions {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:8px;
}

.icon-action-button {
  width:44px;
  height:44px;
  min-width:44px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #d9d9d9;
  border-radius:9px;
  background:#fff;
  color:#111;
  cursor:pointer;
}

.icon-action-button svg {
  width:20px;
  height:20px;
  display:block;
}

.icon-action-button:hover {
  border-color:#111;
  background:#fafafa;
}

@media (max-width: 640px) {
  .detail-head {
    position:relative;
    display:block;
    padding-right:104px;
    min-height:58px;
  }

  .detail-actions {
    position:absolute;
    top:0;
    right:0;
    width:auto;
    display:flex;
    flex-direction:row;
    align-items:center;
    gap:7px;
  }

  .detail-actions .icon-action-button {
    width:42px;
    height:42px;
    min-width:42px;
    padding:0;
    border-radius:9px;
  }

  .detail-actions .icon-action-button svg {
    width:19px;
    height:19px;
  }
}

/* v9: lighter desktop header title */
.authors-header-title {
  font-weight: 400;
}

/* v9: more compact author detail */
.detail-head {
  padding-bottom: 16px;
}

.detail-section {
  padding: 16px 0;
}

.detail-title {
  margin-top: 2px;
}

.detail-instagram {
  margin-top: 5px;
}

.source-link-list {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .detail-head {
    padding-bottom: 14px;
  }

  .detail-section {
    padding: 14px 0;
  }

  .detail-title {
    margin-top: 0;
  }

  .detail-instagram {
    margin-top: 4px;
  }
}


/* URL overflow fix — long source URLs must never widen the card/page */
.authors-layout,
.authors-sidebar,
.author-detail-panel,
.source-credit-card,
.source-credit-top {
  min-width: 0;
  max-width: 100%;
}

.author-detail-panel,
.source-credit-card {
  overflow: hidden;
}

.source-credit-top {
  width: 100%;
}

.source-credit-top > div {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Show as much of the URL as fits and softly fade the end. */
.source-credit-card .source-link-url {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: normal;

  -webkit-mask-image: linear-gradient(
    to right,
    #000 0%,
    #000 calc(100% - 34px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    #000 0%,
    #000 calc(100% - 34px),
    transparent 100%
  );
}

.source-credit-card .source-open-button {
  flex: 0 0 auto;
}

.credit-copy-button {
  min-width: 0;
  max-width: 100%;
}

.credit-copy-button strong {
  min-width: 0;
  max-width: 100%;
}

/* Extra protection against a single long value creating horizontal scroll on mobile. */
@media (max-width: 900px) {
  .authors-layout,
  .author-detail-panel,
  .source-credit-card,
  .source-credit-top,
  .source-credit-top > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}
