:root { --soft: #f8f9fc; --radius: 16px; }
body { background: #fff; }
main { width: min(100%, 868px); padding: 0 24px 36px; }
button { min-height: 44px; border-radius: 8px; font-size: 15px; font-weight: 500; transition: background .15s; }
.primary { box-shadow: 0 2px 5px rgb(79 86 219 / .1); }
.secondary { color: #505665; border-color: var(--line); }
.secondary:hover { background: var(--soft); }
a { color: var(--accent); text-underline-offset: 3px; }
.site-nav { width: min(100%, 1080px); min-height: 80px; padding: 24px 28px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.hero { margin: 24px 0 34px; text-align: center; }
.hero h1 { font-size: clamp(32px, 4vw, 40px); line-height: 1.4; letter-spacing: -1.3px; font-weight: 650; }
.hero h1 span { white-space: nowrap; }
.hero .intro { margin-top: 10px; font-size: 16px; }
#extract-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 6px 22px rgb(31 38 64 / .035); }
#extract-form > label { font-size: 15px; margin-bottom: 12px; }
#share-text { min-height: 124px; padding: 15px 18px; font-size: 15px; line-height: 1.8; border-color: #dce0e9; border-radius: 8px; }
textarea:focus, input:focus { outline: 3px solid rgb(79 86 219 / .1); border-color: var(--accent); }
.submit-row { margin-top: 16px; gap: 20px; }
.platforms { font-size: 14px; color: var(--muted); }
#extract-button { min-width: 150px; min-height: 46px; font-size: 16px; }
.queue-panel { border: 0; border-radius: 0; padding: 0; margin: 22px 0 16px; font-size: 14px; color: var(--muted); background: transparent; }
.queue-panel summary { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.queue-panel summary::-webkit-details-marker { display: none; }
.queue-panel summary::after { content: ''; width: 6px; height: 6px; border-right: 1px solid #9198a6; border-bottom: 1px solid #9198a6; transform: rotate(45deg); margin-bottom: 3px; }
.queue-panel[open] summary::after { transform: rotate(225deg); margin-bottom: -3px; }
.queue-capacity { font-size: 13px; margin-top: 8px; }
.queue-panel[data-full="true"] { background: #fffaf2; padding: 12px; border-radius: 8px; }
.profile-panel { padding: 0; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-panel > summary, .review-item > summary, .account-records > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.profile-panel > summary::-webkit-details-marker, .review-item > summary::-webkit-details-marker, .account-records > summary::-webkit-details-marker { display: none; }
.profile-panel > summary::after, .review-item > summary::after, .account-records > summary::after { content: ''; width: 7px; height: 7px; flex: 0 0 7px; border-right: 1px solid #9198a6; border-bottom: 1px solid #9198a6; transform: rotate(45deg); margin: 0 3px 4px; }
.profile-panel[open] > summary::after, .review-item[open] > summary::after, .account-records[open] > summary::after { transform: rotate(225deg); margin-bottom: -4px; }
.profile-panel > summary { padding: 20px 0; font-size: 15px; }
.profile-panel[open] { padding-bottom: 20px; }
.profile-panel > .hint { margin-bottom: 16px; }
.profile-panel .result-actions { flex-wrap: wrap; margin: 15px 0; }
.profile-panel .access-row { align-items: center; }
.profile-panel .access-row label { margin: 0 10px 0 0; white-space: nowrap; }
.profile-panel .access-row select { width: auto; }
.help-details { margin-top: 12px; color: var(--muted); font-size: 13px; }
.help-details > summary { list-style: none; cursor: pointer; padding: 11px 0; }
.help-details > summary::-webkit-details-marker { display: none; }
.help-details > summary::after { content: '+'; margin-left: 10px; color: #9198a6; }
.help-details[open] > summary::after { content: '−'; }
.help-details p { line-height: 1.8; margin: 6px 0 10px; }
.workspace-help { margin-top: 4px; }
.workspace-help p { max-width: 690px; }
.stack-form { display: grid; gap: 9px; }
.stack-form label { font-size: 14px; font-weight: 500; margin: 7px 0 0; }
.stack-form input, .access-row input, .profile-panel input, select { min-width: 0; width: 100%; padding: 11px 13px; min-height: 44px; border: 1px solid #dce0e9; border-radius: 8px; font: inherit; background: #fff; }
.stack-form input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; accent-color: var(--accent); vertical-align: middle; margin: 0 8px 0 0; }
.account-bar { position: relative; z-index: 10; padding: 0; margin: 0; border: 0; }
.account-menu > summary { cursor: pointer; padding: 8px 0; list-style: none; min-height: 40px; font-size: 15px; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary::after { content: ''; display: inline-block; width: 6px; height: 6px; border-right: 1px solid #9198a6; border-bottom: 1px solid #9198a6; transform: rotate(45deg); margin: 0 2px 3px 9px; }
.account-sheet { position: absolute; top: calc(100% + 7px); right: 0; width: 355px; max-width: calc(100vw - 40px); max-height: min(76vh, 700px); overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 10px 35px rgb(33 35 45 / .1); }
#account-who { font-size: 17px; font-weight: 600; }
#account-balance { font-size: 13px; margin: 5px 0 12px; }
.account-sheet > .result-actions { flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.account-sheet .quiet, .account-sheet a { font-size: 14px; }
.account-sheet a { text-decoration: none; }
.account-records { border-top: 1px solid var(--line); font-size: 14px; }
.account-records > summary { padding: 14px 0; }
.account-records > .result-actions { margin: 15px 0; }
.account-list { max-height: 280px; overflow: auto; }
.account-list p, .account-list button { display: block; margin: 9px 0; overflow-wrap: anywhere; }
.account-list button { width: 100%; text-align: left; white-space: pre-line; line-height: 1.8; }
.access-panel { width: min(100%, 380px); border: 0; padding: 0; margin: 58px auto 80px; }
.access-panel h2 { font-size: 26px; }
.access-panel > p { font-size: 15px; color: var(--muted); margin: 10px 0 28px; }
.access-panel .stack-form input, .access-panel button.primary { min-height: 48px; }
.access-panel button.primary { margin-top: 14px; }
.account-tabs { margin-top: 15px; flex-wrap: wrap; justify-content: space-between; }
.recovery-notice { white-space: pre-wrap; overflow-wrap: anywhere; background: #f1f2ff; padding: 16px; border-radius: 8px; font-size: 14px; line-height: 1.8; }
body[data-authenticated="false"] .hero, body[data-authenticated="false"] .workspace-help { display: none; }
#profile-list { max-height: 480px; overflow: auto; margin-top: 10px; }
.profile-item { display: flex; gap: 12px; padding: 15px 0; align-items: flex-start; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 400; }
.profile-item input { width: 18px; height: 18px; min-height: 18px; margin: 4px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.profile-item span { overflow-wrap: anywhere; }
.profile-identity { min-width: 0; flex: 1; }
.profile-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.profile-duration { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.profile-panel h3 { font-size: 18px; margin: 20px 0 7px; }
.batch-panel { margin-top: 30px; }
.batch-panel > h2 { margin-bottom: 16px; font-size: 24px; font-weight: 600; }
.batch-stats { font-size: 14px; }
.batch-panel[data-single="true"] > .batch-stats { display: none; }
.batch-tools { padding: 14px 0; border: 0; border-radius: 0; }
.batch-tools > .result-actions { margin-left: auto; }
.job-row { grid-template-columns: 30px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; margin: 16px 0; }
.batch-panel[data-single="true"] .job-row { display: block; }
.batch-panel[data-single="true"] .job-select { display: none; }
.job-summary { padding: 16px 0; border-bottom: 1px solid var(--line); }
.job-card:not([open]) > .job-summary { border-bottom: 0; }
.job-label { font-size: 14px; font-weight: 500; color: var(--muted); min-width: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-row[data-status="complete"] .activity { background: #51856f; }
.batch-panel[data-single="true"] .job-row[data-status="complete"] .job-summary { display: none; }
.elapsed { font-size: 13px; }
.job-content { padding: 20px 0; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.result-identity { min-width: 0; flex: 1; }
.video-title { font-size: 17px; font-weight: 600; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-meta { font-size: 13px; margin-top: 5px; }
.job-content .result-heading > .result-actions { flex-wrap: nowrap; margin: 0; gap: 8px; }
.source-link + .job-message:not(:empty) { margin: 10px 0 0; font-size: 13px; }
.result-heading .result-actions button { font-size: 14px; padding: 8px 12px; white-space: nowrap; }
.result-more { position: relative; }
.result-more > summary { cursor: pointer; padding: 9px 11px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: #505665; list-style: none; white-space: nowrap; }
.result-more > summary::-webkit-details-marker { display: none; }
.result-more > summary::after { content: ''; display: inline-block; width: 5px; height: 5px; border-right: 1px solid #9198a6; border-bottom: 1px solid #9198a6; transform: rotate(45deg); margin: 0 1px 3px 7px; }
.more-actions { position: absolute; z-index: 5; right: 0; top: calc(100% + 7px); min-width: 156px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 26px rgb(33 35 45 / .1); }
.result-heading .more-actions button { width: 100%; border: 0; background: #fff; text-align: left; min-height: 42px; color: #505665; }
.result-heading .more-actions button:not(:disabled):hover { background: var(--soft); }
.transcript { border: 0; border-radius: 0; padding: 0; margin-top: 22px; font-size: 17px; line-height: 1.95; background: #fff; }
.review-item { margin: 0; border-top: 1px solid var(--line); font-size: 14px; }
.review-item > summary { padding: 15px 0; color: var(--muted); }
.transcript + .review-item { margin-top: 23px; }
.raw-transcript { font-size: 15px; color: var(--muted); margin-bottom: 18px; }
.source-link { color: #646c7a; font-size: 14px; margin-top: 15px; }
.source-link::after { content: ' ↗'; }
.timeline-list { max-height: 420px; overflow: auto; padding: 0; list-style: none; }
.timeline-list li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.timeline-list time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.text-editor textarea { font-size: 16px; line-height: 1.9; min-height: 250px; }
footer { text-align: center; margin-top: 44px; font-size: 12px; color: #9097a4; }
.admin-main { width: min(100%, 1160px); padding: 32px 28px; }
.admin-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.admin-heading h1 { font-size: 34px; }
.admin-heading .intro { font-size: 15px; }
.admin-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 23px 0; margin: 20px 0 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-stat { display: flex; flex-direction: column-reverse; gap: 7px; padding: 0 14px; border-left: 1px solid var(--line); min-width: 0; }
.admin-stat:first-child { border-left: 0; padding-left: 0; }
.admin-stat strong { font-size: 24px; font-weight: 600; white-space: nowrap; }
.admin-stat span { font-size: 13px; color: var(--muted); }
.admin-section { margin: 0 0 25px; padding: 0; border: 0; background: #fff; }
.admin-section h2 { font-size: 21px; margin-bottom: 15px; }
.admin-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.admin-section-heading h2 { margin-bottom: 0; }
.admin-empty { color: var(--muted); font-size: 14px; padding: 16px 0; }
.stack-form input:disabled, .stack-form select:disabled { color: #9298a5; background: var(--soft); }
.admin-invitations { border-bottom: 1px solid var(--line); padding-bottom: 25px; }
.admin-invitations > .hint { margin-top: 12px; }
.invite-result-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.invite-result-actions .recovery-notice { flex: 1; }
.invite-result-actions button { flex-shrink: 0; }
#new-user-dialog { width: min(440px, calc(100% - 40px)); }
#new-user-dialog .stack-form button { margin-top: 12px; }
.admin-section .hint { font-size: 13px; }
.admin-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 26px; }
.admin-forms > .admin-section + .admin-section { border-left: 1px solid var(--line); padding-left: 32px; }
.admin-section .stack-form { grid-template-columns: 118px minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.admin-section .stack-form label { font-size: 13px; margin: 0; }
.admin-section .stack-form button[type=submit] { grid-column: 1 / -1; }
.admin-invitations .stack-form { grid-template-columns: 110px minmax(70px, 130px) auto; justify-content: start; }
.admin-invitations .stack-form button[type=submit] { grid-column: auto; }
.admin-permissions { border-bottom: 1px solid var(--line); margin: 0; padding: 0 18px; }
.admin-permissions > summary, .admin-log > summary { cursor: pointer; font-size: 14px; padding: 15px 0; }
.admin-permissions .stack-form { grid-template-columns: 190px minmax(0, 1fr); max-width: 720px; padding-bottom: 20px; }
.permission-switch { grid-column: 1 / -1; }
.admin-log { border-bottom: 1px solid var(--line); margin: 0; padding: 0 18px; }
.admin-log:first-of-type { border-top: 1px solid var(--line); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px; }
th { background: var(--soft); font-weight: 500; color: #656d7c; }
.admin-section select, .admin-section input { max-width: 100%; }
.admin-feedback { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .result-heading { flex-direction: column; gap: 14px; }
  .job-content .result-heading > .result-actions { width: 100%; }
  .admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 0; }
  .admin-stat:nth-child(4) { border-left: 0; padding-left: 0; }
  .admin-forms { grid-template-columns: 1fr; gap: 0; }
  .admin-forms > .admin-section + .admin-section { border-left: 0; border-top: 1px solid var(--line); padding: 25px 0 0; }
  .admin-heading { flex-direction: column; gap: 14px; }
}
@media (max-width: 520px) {
  .site-nav { min-height: 72px; padding: 18px 22px; }
  .brand { font-size: 17px; }
  .account-menu > summary { font-size: 14px; }
  main { padding: 0 22px 28px; }
  .hero { margin: 18px 0 30px; }
  .hero h1 { font-size: 32px; max-width: 250px; margin: 0 auto; letter-spacing: -.8px; }
  .hero h1 span { display: block; }
  .hero .intro { font-size: 15px; margin-top: 12px; }
  #extract-form { padding: 18px; border-radius: 14px; }
  #share-text { min-height: 154px; padding: 13px; font-size: 14px; }
  .platforms { font-size: 13px; }
  #extract-button { min-width: 130px; min-height: 46px; padding: 10px 18px; font-size: 15px; }
  .queue-panel { font-size: 13px; margin: 20px 0 15px; }
  .profile-panel > summary { font-size: 14px; padding: 19px 0; }
  .access-row { flex-wrap: wrap; }
  .access-row input { flex: 1 1 150px; }
  .access-panel { margin: 36px auto 60px; }
  .account-sheet { max-width: calc(100vw - 44px); padding: 18px; }
  .batch-panel > h2 { font-size: 23px; }
  .job-row { padding: 0 16px; }
  .result-meta { font-size: 12px; }
  .result-heading .copy-action, .result-heading .edit-action { flex: 1; }
  .result-heading .result-more > summary { min-width: 75px; text-align: center; }
  .transcript { font-size: 16px; line-height: 1.95; }
  .timeline-list li { grid-template-columns: 1fr; gap: 3px; }
  .admin-main { padding: 24px 22px; }
  .admin-heading h1 { font-size: 29px; }
  .admin-section .stack-form, .admin-permissions .stack-form { grid-template-columns: 1fr; gap: 9px; }
  .admin-invitations .stack-form { grid-template-columns: 1fr 100px; }
  .admin-invitations .stack-form button[type=submit] { grid-column: 1 / -1; }
  .invite-result-actions { flex-direction: column; align-items: stretch; }
  .admin-section .stack-form label { margin-top: 6px; }
  .admin-stat { padding: 0 10px; }
  .admin-stat strong { font-size: 19px; }
  .admin-stat span { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

#ranking-admin > details { padding: 14px 0; border-top: 1px solid #e3e7e5; }
#ranking-admin summary { cursor: pointer; font-weight: 600; }
#ranking-admin form { margin-top: 14px; }
#ranking-setting-groups > details { padding: 12px 0; }
#ranking-admin .ranking-fields, #ranking-admin .ranking-metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin-top: 12px; }
#ranking-admin .ranking-fields label, #ranking-admin .ranking-metrics-grid label { display: grid; gap: 6px; min-width: 0; font-size: 14px; }
#ranking-admin input, #ranking-admin textarea { width: 100%; min-width: 0; box-sizing: border-box; }
#ranking-admin .permission-switch input { width: auto; }
#ranking-version-summary, #ranking-metrics-source { overflow-wrap: anywhere; }
#ranking-inspection { margin-top: 20px; }
@media (max-width: 600px) { #ranking-admin .ranking-fields, #ranking-admin .ranking-metrics-grid { grid-template-columns: 1fr; } }
