/* X and LinkedIn tabs. ar- classes, scoped to .ar-scope (both tab roots); tokens come from app/tokens.css. */
.ar-scope *, .ar-scope *::before, .ar-scope *::after {box-sizing: border-box;}
.ar-scope.active {background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; letter-spacing: -0.01em; min-height: calc(100dvh - 56px);}
.ar-scope [hidden] {display: none !important;}
.ar-scope p {margin: 0;}
.ar-scope h2, .ar-scope h3 {margin: 0; font-weight: 600; letter-spacing: -0.012em; color: var(--text);}
.ar-scope h2 {font-size: 20px;}
.ar-scope h3 {font-size: 16px;}
.ar-scope .ar-app {max-width: 860px; margin: 0 auto; padding: 20px 16px 64px;}
.ar-scope .ar-muted {color: var(--text2);}
.ar-scope .ar-dim {color: var(--text3);}
.ar-scope .ar-mono {font-family: var(--mono); font-size: 12px;}
.ar-scope .ar-grow {flex: 1;}
.ar-scope .ar-empty {padding: 32px 0; text-align: center;}
.ar-scope .ar-notice {padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text2); margin-bottom: 12px;}
.ar-scope .ar-error {padding: 10px 12px; border: 1px solid var(--danger-border); border-radius: 8px; background: var(--danger-soft); color: var(--red); margin-bottom: 12px;}
.ar-scope .ar-err-text {color: var(--red); margin: 4px 0 10px;}
.ar-scope .ar-heading {display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px;}
.ar-scope .ar-heading p {margin-top: 4px;}
.ar-scope .ar-section-title {font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text3); margin: 24px 0 8px;}

.ar-scope .ar-btn {display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; border-radius: 6px;
  padding: 7px 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap;}
.ar-scope .ar-btn:hover:not(:disabled) {border-color: var(--border-strong);}
.ar-scope .ar-btn.ar-primary {background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600;}
.ar-scope .ar-btn.ar-primary:hover:not(:disabled) {background: var(--accent-hover); border-color: var(--accent-hover);}
.ar-scope .ar-btn.ar-ghost {border-color: transparent; background: none; color: var(--text2);}
.ar-scope .ar-btn.ar-small {padding: 3px 8px; font-size: 12px;}
.ar-scope .ar-btn:disabled {opacity: .4; cursor: not-allowed;}
.ar-scope button:focus-visible, .ar-scope .ar-input:focus-visible, .ar-scope summary:focus-visible {outline: 2px solid var(--accent); outline-offset: 2px;}

.ar-scope .ar-pill {display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface2); color: var(--text2); white-space: nowrap;}
.ar-scope .ar-pill::before {content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;}
.ar-scope .ar-pill.ar-need {color: var(--orange); background: var(--warning-soft);}
.ar-scope .ar-pill.ar-run {color: var(--accent); background: var(--accent-light);}
.ar-scope .ar-pill.ar-done {color: var(--green); background: var(--success-soft);}
.ar-scope .ar-pill.ar-fail {color: var(--red); background: var(--danger-soft);}

.ar-scope .ar-card {background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; box-shadow: 0 1px 2px rgb(0 0 0 / .04); margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 10px;}
.ar-scope .ar-start .ar-btn.ar-primary {align-self: flex-start;}
.ar-scope .ar-card-head {display: flex; align-items: center; gap: 8px; flex-wrap: wrap;}
.ar-scope .ar-steer summary {cursor: pointer; color: var(--text2); padding: 2px 0;}
.ar-scope .ar-steer[open] {display: flex; flex-direction: column; gap: 10px;}

.ar-scope .ar-field {display: flex; flex-direction: column; gap: 4px; min-width: 0;}
.ar-scope .ar-label {display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text3);}
.ar-scope .ar-count {font-family: var(--mono); letter-spacing: 0; text-transform: none;}
.ar-scope .ar-count.ar-warn {color: var(--orange);}
.ar-scope .ar-count.ar-err {color: var(--red); font-weight: 600;}
.ar-scope .ar-input {width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; resize: vertical;}
.ar-scope .ar-input:hover {border-color: var(--border-strong);}
.ar-scope .ar-input[readonly] {background: var(--surface2); color: var(--text2);}
.ar-scope textarea.ar-input {min-height: 38px; overflow: hidden; line-height: 1.55;}
.ar-scope .ar-fields {display: flex; flex-direction: column; gap: 10px;}
.ar-scope .ar-link {align-self: flex-start; color: var(--accent); font-size: 13px; text-decoration: none;}
.ar-scope .ar-link:hover {text-decoration: underline;}
.ar-scope .ar-inline {display: flex; gap: 8px; align-items: end; flex-wrap: wrap;}
.ar-scope .ar-inline > .ar-field, .ar-scope .ar-inline > .ar-input {flex: 1; min-width: 220px;}
.ar-scope .ar-rewrite {display: flex; gap: 8px;}

.ar-scope .ar-options {display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px;}
.ar-scope .ar-option {display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--text); cursor: pointer;}
.ar-scope .ar-option:hover:not(:disabled) {border-color: var(--accent);}
.ar-scope .ar-option-title {font-weight: 500;}

.ar-scope .ar-topics {display: flex; flex-wrap: wrap; gap: 6px;}
.ar-scope .ar-btn.ar-topic {white-space: normal; text-align: left; background: var(--bg);}
.ar-scope .ar-btn.ar-topic:hover:not(:disabled) {border-color: var(--accent); color: var(--accent);}
.ar-scope .ar-top5 {margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px;}
.ar-scope .ar-top5 li {display: flex; flex-direction: column; gap: 6px;}
.ar-scope .ar-headers {display: flex; flex-wrap: wrap; gap: 6px; align-items: center;}
.ar-scope .ar-headers .ar-label {width: 100%;}
.ar-scope .ar-btn.ar-header-opt {white-space: normal; text-align: left;}
.ar-scope .ar-btn.ar-header-opt.ar-on {border-color: var(--accent); background: var(--accent-light); color: var(--accent);}
.ar-scope .ar-finish > .ar-btn.ar-primary {align-self: flex-start;}

.ar-scope .ar-list {display: flex; flex-direction: column;}
.ar-scope .ar-row {display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; font: inherit; text-align: left; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer;}
.ar-scope .ar-row:hover {border-color: var(--border-strong);}
.ar-scope .ar-row-text {flex: 1; min-width: 0; display: flex; flex-direction: column;}
.ar-scope .ar-row-date {font-weight: 600;}
.ar-scope .ar-row-title {color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}

.ar-scope .ar-bar {display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;}
.ar-scope .ar-bar-title {font-size: 20px;}
.ar-scope .ar-tabs {display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface);}
.ar-scope .ar-tab {font: inherit; font-size: 13px; padding: 6px 12px; border: 0; background: none; color: var(--text2); cursor: pointer;}
.ar-scope .ar-tab + .ar-tab {border-left: 1px solid var(--border);}
.ar-scope .ar-tab.ar-on {background: var(--accent-light); color: var(--accent); font-weight: 600;}
.ar-scope .ar-progress {display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: 12px;}
.ar-scope .ar-copyrow {display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border);}
.ar-scope .ar-copytext {flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;}
.ar-scope .ar-inline > .ar-field.ar-emoji {flex: 0 0 72px; min-width: 72px;}
.ar-scope .ar-preview {width: 100%; min-height: 80px; border: 1px solid var(--border); border-radius: 6px; background: #EAEAE8;}

@media (max-width: 640px) {
  .ar-scope .ar-app {padding: 16px 12px 48px;}
  .ar-scope .ar-tabs {width: 100%;}
  .ar-scope .ar-tab {flex: 1;}
  .ar-scope .ar-inline > .ar-field, .ar-scope .ar-inline > .ar-input {min-width: 100%;}
}
@media (pointer: coarse) {
  .ar-scope .ar-btn, .ar-scope .ar-tab {min-height: 40px;}
}

/* Articles-specific */
.ar-scope .ar-app {max-width: 1180px;}
.ar-scope .ar-workflow {flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap;}
.ar-scope .ar-filters {display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 10px;}
.ar-scope .ar-btn.ar-filter {font-size: 13px; padding: 4px 10px; border-radius: 999px;}
.ar-scope .ar-btn.ar-filter.ar-on, .ar-scope .ar-btn.ar-step.ar-on {border-color: var(--accent); background: var(--accent-light); color: var(--accent); font-weight: 600;}
.ar-scope .ar-row-title {color: var(--text); font-weight: 600; white-space: normal;}
.ar-scope .ar-row-sub {color: var(--text3); font-size: 12px;}
.ar-scope .ar-sub {color: var(--text3); font-size: 12px; margin: -4px 0 10px;}
.ar-scope .ar-status {display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;}
.ar-scope .ar-error-box {display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--danger-border);
  border-radius: 8px; background: var(--danger-soft); color: var(--red); margin-bottom: 12px;}
.ar-scope .ar-grid {display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start;}
.ar-scope .ar-side {display: flex; flex-direction: column; min-width: 0;}
.ar-scope .ar-side .ar-card {margin-bottom: 12px;}
.ar-scope .ar-tabs {align-self: flex-start;}
.ar-scope .ar-source {display: flex; flex-direction: column; gap: 8px;}
.ar-scope .ar-picker {display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto;}
.ar-scope .ar-option {display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); cursor: pointer;}
.ar-scope .ar-option:hover {border-color: var(--border-strong);}
.ar-scope .ar-option.ar-on {border-color: var(--accent); background: var(--accent-light);}
.ar-scope .ar-option-title {font-weight: 500;}
.ar-scope .ar-editor {min-height: 480px; font-family: var(--mono); font-size: 13px; line-height: 1.6;}
.ar-scope .ar-prose {font-size: 16px; line-height: 1.65; color: var(--text); max-width: 68ch;}
.ar-scope .ar-prose h1 {font-size: 26px; line-height: 1.25; margin: 0 0 16px;}
.ar-scope .ar-prose h2 {font-size: 19px; margin: 24px 0 8px;}
.ar-scope .ar-prose h3 {font-size: 15px; margin: 16px 0 6px;}
.ar-scope .ar-prose p {margin: 0 0 14px;}
.ar-scope .ar-prose ul, .ar-scope .ar-prose ol {margin: 0 0 14px; padding-left: 22px;}
.ar-scope .ar-prose a {color: var(--accent);}
.ar-scope .ar-small-prose {font-size: 13px; line-height: 1.55;}
.ar-scope .ar-small-prose h3 {font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); margin: 12px 0 4px;}
.ar-scope .ar-small-prose p, .ar-scope .ar-small-prose ul {margin-bottom: 8px;}
.ar-scope .ar-small-prose a {word-break: break-all;}
.ar-scope .ar-warnings {margin: 0; padding: 8px 12px 8px 28px; border: 1px solid var(--warning-border); border-radius: 6px; background: var(--warning-soft); color: var(--orange); font-size: 13px;}
.ar-scope .ar-ask {display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px;}
.ar-scope .ar-changes ul {margin: 4px 0 0; padding-left: 20px; font-size: 13px; color: var(--text2);}
.ar-scope .ar-claim {display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px;}
.ar-scope .ar-claim-top {display: flex; gap: 8px; align-items: flex-start;}
.ar-scope .ar-script summary {cursor: pointer; font-weight: 600;}
.ar-scope .ar-script[open] {gap: 10px;}
@media (max-width: 900px) {
  .ar-scope .ar-grid {grid-template-columns: minmax(0, 1fr);}
}
.ar-scope .ar-plain {white-space: pre-wrap; overflow-wrap: anywhere;}
