/* Shared theme accents and thin control borders. Loaded after page skins. */
html[data-od-theme] {
  --od-control-accent:var(--od-accent,var(--od-theme-accent,#6c9ff3));
  --od-control-border:var(--od-border,var(--od-theme-border,#3f5064));
  --od-control-surface:var(--od-soft,var(--od-theme-soft,#203753));
  --od-control-header:var(--od-control-accent);
}
/* Light palettes retain a tinted, readable icon on the dark header. */
html:is([data-od-theme="paper"],[data-od-theme="sand"],[data-od-theme="frost"],[data-od-theme="sage"],[data-od-theme="rose"]) {
  --od-control-header:color-mix(in srgb,var(--od-control-accent) 60%,white);
}
html[data-od-theme] body .top-action,
html[data-od-theme] body .top-action svg {color:var(--od-control-header) !important;}
html[data-od-theme] body .side-link svg,
html[data-od-theme] body .member-navigation svg,
html[data-od-theme] body .topic-bookmark,
html[data-od-theme] body .topic-bookmark button,
html[data-od-theme] body .topic-bookmark svg {color:var(--od-control-accent) !important;}
html[data-od-theme] body .topic-bookmark.saved svg {fill:currentColor;}
html[data-od-theme] body .presence-track,
html[data-od-theme] body .toggle-track {
  background:var(--od-control-surface) !important;border-color:var(--od-control-accent) !important;border-width:1px;
}
html[data-od-theme] body .presence-switch input:not(:checked)+.presence-track,
html[data-od-theme] body .toggle input:not(:checked)+.toggle-track {
  background:var(--od-panel2,var(--od-theme-panel2,#1b2533)) !important;border-color:var(--od-control-border) !important;
}
html[data-od-theme] body .presence-thumb,
html[data-od-theme] body .toggle-track::before {background:var(--od-control-accent) !important;}
/* v0.10.36: text-entry borders stay identical before and during focus. */
html[data-od-theme] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]),textarea,select,[contenteditable="true"]) {
  border-width:1px !important;border-style:solid;border-color:var(--od-control-border) !important;
  box-shadow:none !important;
}
html[data-od-theme] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]),textarea,select,[contenteditable="true"]):focus {
  border-color:var(--od-control-border) !important;outline:none !important;box-shadow:none !important;
}
html[data-od-theme] body :is(.compose-editor-box,.editor-frame,.tag-entry):focus-within {
  border-color:var(--od-control-border) !important;outline:none !important;box-shadow:none !important;
}
/* The discussion editor already has a frame around its toolbar and body. */
html[data-od-theme] body #createTopicForm .compose-editor-box #topicBody {border:0 !important;}
html[data-od-theme] body :is(input,textarea,select):user-invalid {border-color:var(--od-error-text,#dc6b65) !important;}
html[data-od-theme] body :is(button,.btn,.od-btn,.tab,.settings-tab,.friends-tab,.profile-tab,.new-topic,.new-topic-mini,.primary-btn,.secondary-btn,.page-button,.od-inbox-tab,.od-inbox-compose) {
  border-width:1px;box-shadow:none;
}
/* Mouse clicks do not leave a second frame around tabs and buttons. */
html[data-od-theme] body :is(button,a,summary):focus:not(:focus-visible) {outline:none;box-shadow:none;}
/* Keep a clear, thin keyboard indicator for non-text controls. */
html[data-od-theme] body :is(button,a,summary,input[type="checkbox"],input[type="radio"],input[type="range"],input[type="submit"],input[type="button"],input[type="reset"]):focus-visible {
  outline:1px solid var(--od-control-accent);outline-offset:2px;box-shadow:none;
}
html[data-od-theme] body :is(.presence-switch,.toggle) input:focus-visible {outline:none;}
html[data-od-theme] body :is(.presence-switch,.toggle) input:focus-visible+:is(.presence-track,.toggle-track),
html[data-od-theme] body .od-theme-option:has(input:focus-visible) {
  outline:1px solid var(--od-control-accent);outline-offset:2px;box-shadow:none;
}
html[data-od-theme] body .od-inbox-tab.active::after {height:1px;}
html[data-od-theme] body input:is([type="checkbox"],[type="radio"],[type="range"]) {accent-color:var(--od-control-accent);}

/* Editor frames use the same resting border when a child receives focus. */
html[data-od-theme] body :is(.compose-editor-box,.editor-frame,.tag-entry) {
  border-color:var(--od-control-border) !important;box-shadow:none !important;
}
/* Homepage controls match the tag treatment; keep existing padding and heights. */
html[data-od-theme] body .toolbar :is(.tabs > .tab,.topic-create-link) {
  border:1px solid var(--od-theme-border,#35485e) !important;
  background:var(--od-theme-tag,#202d3e) !important;
  color:var(--od-theme-link,#aac0df);
  border-radius:4px;box-shadow:none !important;
}
html[data-od-theme] body .toolbar :is(.tabs > .tab,.topic-create-link):is(:hover,:active,:focus) {
  border-color:var(--od-theme-border,#35485e) !important;
  box-shadow:none !important;
}
html[data-od-theme] body .toolbar .tabs > .tab.active {
  text-decoration:underline;text-underline-offset:4px;
}
