/*
 * Open to work: /open-to-work/ cards, the flow dialog and the nudges.
 * Colours come from the profile tokens (--os-p-*, light and dark) where the
 * profile stylesheet is loaded, with the light values as fallbacks.
 */
.os-otw, .os-otw-dlg, .os-otw-nudge {
	--otw-p: var(--os-p-primary, #2F62AF);
	--otw-on-p: var(--os-p-on-primary, #ffffff);
	--otw-ps: var(--os-p-primary-soft, rgba(47, 98, 175, 0.10));
	--otw-t: var(--os-p-text, #1e293b);
	--otw-m: var(--os-p-muted, #64748b);
	--otw-b: var(--os-p-border, #e5e7eb);
	--otw-panel: var(--os-p-panel, #ffffff);
	--otw-gold: var(--os-p-gold-soft, rgba(252, 185, 0, 0.16));
}
.os-otw { color: var(--otw-t); max-width: 1180px; margin: 0 auto; padding: 32px 16px 56px; }
.os-otw-eyebrow { display: block; text-align: center; color: var(--otw-p); font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.os-otw-title { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; margin: 8px auto 12px; text-align: center; max-width: 20ch; }
.os-otw-lede { text-align: center; color: var(--otw-m); font-size: 17px; line-height: 1.55; max-width: 48ch; margin: 0 auto 28px; }

.os-otw-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none !important; border: 1px solid var(--otw-p); white-space: nowrap; cursor: pointer; }
.os-otw-btn-primary { background: var(--otw-p); color: var(--otw-on-p) !important; }
.os-otw-btn-secondary { background: transparent; color: var(--otw-p) !important; }
.os-otw-btn:focus-visible, .os-otw-link:focus-visible, .os-otw-card a:focus-visible { outline: 2px solid var(--otw-p); outline-offset: 2px; }
.os-otw-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: var(--otw-p); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; cursor: pointer; }

.os-otw-me { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; background: var(--otw-ps); border: 1px solid var(--otw-b); border-radius: 14px; padding: 14px 16px; margin: 0 0 20px; }
.os-otw-me p { margin: 0; font-size: 15px; line-height: 1.45; }

.os-otw-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 8px; }
.os-otw-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--otw-m); }
.os-otw-filters select { min-height: 44px; border: 1px solid var(--otw-b); border-radius: 10px; padding: 0 10px; font-size: 15px; color: var(--otw-t); background-color: var(--otw-panel); }
.os-otw-filters .os-otw-check { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; color: var(--otw-t); font-size: 15px; font-weight: 500; }
.os-otw-filters .os-otw-check input { width: 20px; height: 20px; }
@media (min-width: 720px) { .os-otw-filters { grid-template-columns: 2fr 1.4fr auto auto; align-items: end; } }
.os-otw-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; color: var(--otw-m); font-size: 14px; margin: 10px 0 16px; }

.os-otw-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .os-otw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .os-otw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.os-otw-card { background: var(--otw-panel); border: 1px solid var(--otw-b); border-radius: 16px; padding: 18px; box-shadow: var(--os-p-shadow, 0 1px 3px rgba(15, 23, 42, .06)); display: flex; flex-direction: column; gap: 12px; color: var(--otw-t); min-width: 0; }
.os-otw-card.is-own { border-color: var(--otw-p); }
.os-otw-you { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--otw-p); }
.os-otw-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.os-otw-av { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.os-otw-av-i { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 20px; }
.os-otw-av-0 { background: #0f766e; } .os-otw-av-1 { background: #2F62AF; } .os-otw-av-2 { background: #7c3aed; }
.os-otw-av-3 { background: #b45309; } .os-otw-av-4 { background: #be123c; } .os-otw-av-5 { background: #334155; }
.os-otw-name { font-size: 18px; font-weight: 700; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.os-otw-name a { color: inherit; text-decoration: none; }
.os-otw-name a:hover { text-decoration: underline; }
.os-otw-rank { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--otw-t); background: var(--otw-gold); border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
.os-otw-hl[hidden], .os-otw-loc[hidden] { display: none; }
.os-otw-hl { margin: 0; font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.os-otw-loc { margin: 0; color: var(--otw-m); font-size: 14px; overflow-wrap: anywhere; }
.os-otw-pills, .os-otw-sks { display: flex; flex-wrap: wrap; gap: 6px; }
.os-otw-pills:empty { display: none; }
.os-otw-pill { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--otw-ps); color: var(--otw-t); }
.os-otw-sk { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--otw-b); color: var(--otw-t); }
.os-otw-sk-cr { border-color: rgba(21, 128, 61, .45); }
.os-otw-sk-sd { border-style: dashed; color: var(--otw-m); }
.os-otw-sk-more { font-size: 13px; padding: 4px 2px; color: var(--otw-m); }
.os-otw-acts { display: flex; gap: 8px; margin-top: auto; }
.os-otw-acts .os-otw-btn { flex: 1 1 0; }
.os-otw-youacts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: auto; }
.os-otw-youacts a { color: var(--otw-p); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

.os-otw-empty { background: var(--otw-panel); border: 1px solid var(--otw-b); border-radius: 16px; padding: 32px 20px; text-align: center; max-width: 640px; margin: 0 auto; }
.os-otw-empty h2 { font-size: 20px; margin: 0 0 8px; }
.os-otw-empty p { color: var(--otw-m); margin: 0 auto 16px; max-width: 42ch; line-height: 1.5; }
.os-otw-pages { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 28px; }
.os-otw-pages .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--otw-b); border-radius: 10px; text-decoration: none; color: var(--otw-t); }
.os-otw-pages .page-numbers.current { background: var(--otw-p); border-color: var(--otw-p); color: var(--otw-on-p); }

/* Nudge card (course page, Skills and credentials) */
.os-otw-nudge { background: var(--otw-ps); border: 1px solid var(--otw-b); border-radius: 14px; padding: 16px; margin: 16px 0; color: var(--otw-t); }
.os-otw-nudge[hidden] { display: none; }
.os-otw-nudge p { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.os-otw-nudge .os-otw-nudge-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.os-otw-nudge-acts { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
/* Dashboard home (DEV-296). The dashboard loads no profile tokens and can be
   dark, so this card takes Tutor's own, as Learning streak beside it does. */
.os-otw-nudge.os-otw-nudge-dash {
	--otw-p: var(--tutor-button-primary, #2F62AF);
	--otw-on-p: var(--tutor-text-primary-inverse, #ffffff);
	--otw-t: var(--tutor-text-primary, #1e293b);
	background: var(--tutor-surface-l1, #ffffff);
	border-color: var(--tutor-border-idle, #e5e7eb);
	border-radius: 12px;
	padding: 16px 20px;
	margin: 0 0 20px;
}
.os-otw-nudge-dash p { color: var(--tutor-text-secondary, #64748b); }
.os-otw-nudge-dash .os-otw-nudge-title { color: var(--tutor-text-primary, #1e293b); }
.os-otw-nudge-dash .os-otw-link { color: var(--tutor-text-brand, #2F62AF); }

/* Flow dialog */
.os-otw-dlg { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; border: 0; border-radius: 18px; padding: 0; background: var(--otw-panel); color: var(--otw-t); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.os-otw-dlg-form { padding: 22px 20px; margin: 0; }
.os-otw-dlg::backdrop { background: rgba(15, 23, 42, .55); }
.os-otw-dlg h2 { font-size: 22px; line-height: 1.25; margin: 0 0 8px; outline: none; padding-right: 40px; }
.os-otw-dlg p { margin: 0 0 14px; color: var(--otw-m); line-height: 1.5; font-size: 15px; }
.os-otw-stp { font-size: 13px; }
.os-otw-x { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 24px; color: var(--otw-m); cursor: pointer; }
.os-otw-opt { display: flex; align-items: center; gap: 10px; min-height: 48px; border: 1px solid var(--otw-b); border-radius: 12px; padding: 0 14px; margin: 0 0 8px; font-size: 16px; cursor: pointer; }
.os-otw-opt:has(input:checked) { border-color: var(--otw-p); background: var(--otw-ps); font-weight: 600; }
.os-otw-opt input { width: 20px; height: 20px; flex: 0 0 auto; }
.os-otw-field { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.os-otw-dlg input[type="text"], .os-otw-dlg textarea { width: 100%; min-height: 44px; border: 1px solid var(--otw-b); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--otw-t); background-color: var(--otw-panel); box-sizing: border-box; }
.os-otw-dlg textarea { min-height: 88px; resize: vertical; }
.os-otw-err { color: #b42318 !important; font-weight: 600; }
.os-otw-row { display: flex; gap: 10px; justify-content: space-between; margin-top: 16px; }
.os-otw-row .os-otw-btn-primary { flex: 1 1 auto; white-space: normal; text-align: center; }
.os-otw-preview { margin: 0 0 12px; }
.os-otw-preview .os-otw-card { box-shadow: none; }
/* Max members first (member plans Stage 2a, review D2.1): a shown Max shield outlines the card. */
.os-otw-card.is-max { box-shadow: inset 0 0 0 2px #e0b400; }
