:root {
    color-scheme: light;
    --paper: #ffffff;
    --surface: #ffffff;
    --ink: #004b49;
    --muted: #607976;
    --line: #d8e5e2;
    --green: #004b49;
    --green-dark: #003b39;
    --lime: #f6b06a;
    --coral: #f6b06a;
    --serif: "Playfair Display", Georgia, serif;
    --sans: "DM Sans", "Trebuchet MS", sans-serif;
    font-family: var(--sans);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.55; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
::selection { color: var(--ink); background: #f6b06a; }

.topbar { min-height: 76px; padding: 0 max(5.5vw, 24px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(38, 54, 47, .1); background: rgba(250, 249, 245, .9); }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 18px; font-weight: 700; letter-spacing: 0; }
.brand-mark { display: inline-grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--paper); background: var(--green); font-family: var(--serif); font-size: 20px; font-weight: 600; }
.topnav { display: flex; align-items: center; gap: clamp(18px, 3vw, 42px); color: #555f57; font-size: 13px; }
.topnav a, .nav-logout { transition: color .18s ease; }
.topnav a:hover, .nav-logout:hover { color: var(--green); }
.nav-active { color: var(--green-dark); font-weight: 700; }
.nav-cta { display: inline-flex; gap: 12px; align-items: center; padding: 11px 16px; border-radius: 3px; color: white !important; background: var(--green); }
.nav-cta:hover { background: var(--green-dark); }
.inline-form { display: inline; }
.nav-logout { padding: 0; border: 0; background: transparent; cursor: pointer; }
.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.site-footer { min-height: 88px; margin-top: 72px; padding: 20px max(5.5vw, 24px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer .brand { color: var(--ink); font-size: 15px; }
.site-footer .brand-mark { width: 27px; height: 27px; font-size: 16px; }
.eyebrow { display: inline-block; color: #7c8477; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; line-height: 1.5; }
.button { min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid transparent; border-radius: 3px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s ease, color .2s ease, transform .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-dark { color: #fff; background: var(--green-dark); }
.button-dark:hover { background: #173d2d; }
.button-accent { color: var(--ink); background: var(--lime); }
.button-accent:hover { background: #d1e071; }
.button-outline { border-color: #bbc7bb; color: var(--green-dark); background: transparent; }
.button-outline:hover { background: rgba(255, 255, 255, .65); }
.button-light { color: var(--ink); background: #f7f2d7; }
.button-light:hover { background: #fffbe8; }
.button-full { width: 100%; }
.flash { margin: 20px 0 0; padding: 12px 16px; border-left: 3px solid #004b49; color: #004b49; background: #edf6f4; font-size: 13px; }
.flash.error { border-left-color: #bd5b48; color: #883a2a; background: #f7eae4; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Public directory */
.directory-hero { min-height: 495px; padding: 68px 6.5% 58px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 56px; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-copy { position: relative; z-index: 1; animation: rise-in .65s both; }
.eyebrow-dot { width: 7px; height: 7px; margin-right: 7px; display: inline-block; border-radius: 50%; background: #f6b06a; vertical-align: 1px; }
.hero-copy h1, .auth-aside h1 { margin: 19px 0 15px; font-family: var(--serif); font-size: clamp(42px, 5.1vw, 64px); font-weight: 500; letter-spacing: 0; line-height: 1.08; }
.hero-copy h1 em { color: var(--coral); font-weight: 500; }
.hero-copy > p { max-width: 470px; margin: 0; color: #697168; font-size: 15px; line-height: 1.8; }
.search-form { max-width: 500px; height: 56px; margin-top: 28px; padding: 5px 6px 5px 17px; display: flex; align-items: center; gap: 12px; border: 1px solid #d6d9ce; background: #fffefa; box-shadow: 0 7px 22px rgba(42, 52, 45, .05); }
.search-form > span { color: #778278; font-size: 25px; line-height: 1; }
.search-form input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-form input::placeholder { color: #92978f; }
.search-form button { height: 42px; padding: 0 17px; display: flex; align-items: center; gap: 17px; border: 0; color: white; background: var(--green); font-size: 12px; cursor: pointer; }
.search-form button:hover { background: var(--green-dark); }
.hero-footnote { margin-top: 19px; display: flex; align-items: center; gap: 11px; color: #7a8077; font-size: 11px; }
.hero-avatars { display: flex; padding-left: 2px; }
.hero-avatars i { width: 23px; height: 23px; margin-left: -3px; display: grid; place-items: center; border: 2px solid var(--paper); border-radius: 50%; color: white; background: #004b49; font-size: 8px; font-style: normal; }
.hero-avatars i:nth-child(2) { background: #f6b06a; color: #004b49; }
.hero-avatars i:nth-child(3) { background: #477875; }
.hero-art { position: relative; height: 355px; display: grid; place-items: center; animation: rise-in .75s .08s both; }
.hero-art::before { position: absolute; width: 355px; height: 355px; border: 1px solid #d6d9cc; border-radius: 50%; content: ""; }
.hero-art::after { position: absolute; width: 287px; height: 287px; border: 1px dashed #d9dacc; border-radius: 50%; content: ""; }
.art-paper { position: relative; z-index: 1; width: 245px; height: 280px; padding: 31px 28px; transform: rotate(-4deg); border: 1px solid #d8e5e2; background: #ffffff; box-shadow: 17px 20px 0 rgba(0, 75, 73, .08), 0 12px 35px rgba(0, 75, 73, .12); }
.art-paper::before { position: absolute; top: 0; bottom: 0; left: 46px; width: 1px; background: #f1d5c7; content: ""; }
.art-line { width: 100%; height: 1px; margin: 19px 0; background: #d9dfd1; }
.art-line-short { width: 48%; margin-top: 4px; }
.art-line-mid { width: 71%; }
.art-orbit { position: absolute; top: 70px; right: 31px; width: 113px; height: 113px; display: grid; place-items: center; border: 1px solid #90b5b0; border-radius: 50%; color: #004b49; background: #edf6f4; }
.art-orbit::before, .art-orbit::after { position: absolute; width: 155px; height: 54px; border: 1px solid #f6b06a; border-radius: 50%; content: ""; transform: rotate(-36deg); }
.art-orbit::after { width: 66px; height: 156px; border-color: #90b5b0; transform: rotate(27deg); }
.art-orbit span { position: relative; z-index: 1; font-family: var(--serif); font-size: 36px; }
.art-stamp { position: absolute; right: 25px; bottom: 25px; padding: 8px 10px; transform: rotate(8deg); border: 1px solid #f6b06a; color: #9a5111; font-size: 8px; font-weight: 700; letter-spacing: 1.1px; line-height: 1.4; text-align: center; }
.art-star { position: absolute; top: 38px; left: 28px; color: #f6b06a; font-size: 26px; }
.art-caption { position: absolute; right: 0; bottom: 0; color: #7e8878; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; line-height: 1.7; }
.directory-section { padding: 52px 0 12px; }
.section-heading { margin-bottom: 24px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 7px 0 0; font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: 0; }
.result-count { padding-bottom: 4px; color: var(--muted); font-size: 12px; }
.teacher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.teacher-card { min-height: 318px; padding: 21px; display: flex; flex-direction: column; border: 1px solid #e1e1d9; background: rgba(255, 254, 250, .7); transition: border-color .2s, transform .2s, box-shadow .2s; animation: rise-in .45s both; }
.teacher-card:nth-child(2) { animation-delay: .07s; }
.teacher-card:nth-child(3) { animation-delay: .14s; }
.teacher-card:hover { transform: translateY(-3px); border-color: #bdcbbd; box-shadow: 0 12px 30px rgba(47, 64, 51, .07); }
.teacher-card-top { margin-bottom: 18px; display: flex; align-items: start; justify-content: space-between; }
.avatar { flex: 0 0 auto; overflow: hidden; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #6e8974; font-family: var(--serif); font-size: 19px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-card { width: 54px; height: 54px; background: #7d9279; }
.teacher-card:nth-child(2n) .avatar-card { background: #f6b06a; color: #004b49; }
.teacher-card:nth-child(3n) .avatar-card { background: #477875; }
.card-arrow { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #daddd4; border-radius: 50%; color: #667168; font-size: 13px; }
.card-role { min-height: 15px; color: #798378; font-size: 9px; letter-spacing: 1.1px; }
.teacher-card h3 { margin: 5px 0 2px; font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: 0; }
.teacher-meta { margin: 0 0 10px; color: #8a8e84; font-size: 10px; }
.teacher-bio { margin: 0; display: -webkit-box; overflow: hidden; color: #676f67; font-size: 12px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.teacher-url { display: block; margin-top: 12px; color: #6d796f; font-size: 9px; overflow-wrap: anywhere; }
.subject-list { display: flex; flex-wrap: wrap; gap: 6px; }
.subject-list span { padding: 5px 9px; border: 1px solid #e0e3d9; border-radius: 2px; color: #55705e; background: #f3f5ec; font-size: 10px; }
.card-subjects { margin-top: 13px; }
.card-link { margin-top: auto; padding-top: 17px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e7e7df; color: var(--green-dark); font-size: 11px; font-weight: 700; }
.card-link span { font-size: 16px; }
.join-banner { position: relative; min-height: 210px; margin-top: 62px; padding: 36px 46px; display: flex; align-items: center; justify-content: space-between; gap: 25px; overflow: hidden; color: #ffffff; background: #004b49; }
.join-banner .eyebrow { color: #f6b06a; }
.join-banner h2 { position: relative; z-index: 1; margin: 9px 0 5px; font-family: var(--serif); font-size: 31px; font-weight: 500; letter-spacing: 0; line-height: 1.2; }
.join-banner p { margin: 0; color: #d6e7e4; font-size: 12px; }
.join-banner .button { position: relative; z-index: 1; flex: 0 0 auto; }
.join-mark { position: absolute; right: 22%; bottom: -95px; color: rgba(243, 239, 218, .06); font-family: var(--serif); font-size: 290px; line-height: 1; }
.empty-state { min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state h1, .empty-state h3 { margin: 9px 0 4px; font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: 0; }
.empty-state p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.empty-symbol { color: #c77f5d; font-family: var(--serif); font-size: 42px; }
.empty-state.compact { min-height: 220px; }

/* Account forms */
.auth-layout { min-height: 590px; padding: 65px 7%; display: grid; grid-template-columns: 1fr .8fr; align-items: center; gap: 10%; }
.auth-aside { max-width: 490px; animation: rise-in .6s both; }
.auth-aside h1 { max-width: 460px; font-size: clamp(40px, 4.2vw, 56px); }
.auth-aside > p { max-width: 415px; color: #687269; font-size: 14px; line-height: 1.9; }
.auth-quote { max-width: 365px; margin-top: 39px; padding: 15px 19px; display: flex; gap: 13px; border-left: 2px solid #c67b5b; background: rgba(255, 254, 250, .6); }
.auth-quote > span { color: #c67b5b; font-family: var(--serif); font-size: 31px; line-height: 1; }
.auth-quote p { margin: 0; color: #536055; font-family: var(--serif); font-size: 15px; font-style: italic; line-height: 1.55; }
.auth-card { padding: 32px; border: 1px solid #e1e1d8; background: #fffefa; box-shadow: 0 15px 45px rgba(46, 58, 46, .06); animation: rise-in .6s .08s both; }
.back-link { display: inline-block; margin-bottom: 31px; color: #707a70; font-size: 11px; }
.back-link:hover { color: var(--green); }
.auth-card h2 { margin: 8px 0 4px; font-family: var(--serif); font-size: 27px; font-weight: 500; letter-spacing: 0; line-height: 1.25; }
.auth-subtitle { margin: 0; color: #7d827a; font-size: 12px; }
.stack-form { margin-top: 24px; display: grid; gap: 15px; }
.stack-form label, .form-grid label { display: grid; gap: 7px; color: #48534a; font-size: 11px; font-weight: 700; }
.stack-form input, .form-grid input, .form-grid textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #dfe1d9; border-radius: 2px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.stack-form input:focus, .form-grid input:focus, .form-grid textarea:focus { border-color: #668b71; box-shadow: 0 0 0 3px rgba(76, 119, 88, .11); }
.stack-form input::placeholder, .form-grid input::placeholder, .form-grid textarea::placeholder { color: #a3a69f; }
.auth-switch { margin: 19px 0 0; color: #858a82; font-size: 11px; text-align: center; }
.auth-switch a { color: var(--green); font-weight: 700; }

/* Teacher dashboard */
.dashboard-heading { margin: 42px 0 23px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.dashboard-heading h1 { margin: 5px 0 3px; font-family: var(--serif); font-size: 34px; font-weight: 500; letter-spacing: 0; }
.dashboard-heading p { margin: 0; color: #767d74; font-size: 12px; }
.dashboard-status { margin-bottom: 5px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; border: 1px solid #dedfd6; color: #6d756b; background: rgba(255, 254, 250, .68); font-size: 11px; }
.admin-page { width: 100%; max-width: 1120px; margin: 42px auto 70px; }
.admin-heading { margin-bottom: 23px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.admin-heading h1 { margin: 5px 0 3px; font-family: var(--serif); font-size: 34px; font-weight: 500; }
.admin-heading p { margin: 0; color: #767d74; font-size: 12px; }
.admin-tabs { margin-bottom: 27px; display: flex; gap: 23px; border-bottom: 1px solid #dfe4e2; }
.admin-tabs a { min-height: 43px; display: inline-flex; align-items: center; gap: 8px; border-bottom: 2px solid transparent; color: #66716f; font-size: 12px; }
.admin-tabs a.is-active { border-color: #53a9c1; color: #244f5a; font-weight: 700; }
.admin-tabs a span { color: #8b9693; font-size: 10px; }
.admin-section-heading { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.admin-section-heading h2 { margin: 4px 0 0; font-family: var(--serif); font-size: 24px; font-weight: 500; }
.admin-user-list, .admin-link-list { display: grid; }
.admin-user-row, .admin-link-row { padding: 16px 0; border-bottom: 1px solid #e5e8e5; }
.admin-user-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; }
.admin-user-summary > div { min-width: 0; display: grid; gap: 3px; }
.admin-user-summary strong { color: #303a38; font-size: 13px; }
.admin-user-summary > div span, .admin-user-summary time { color: #7c8582; font-size: 11px; overflow-wrap: anywhere; }
.admin-status { padding: 4px 8px; border-radius: 999px; color: #7b6250; background: #f8eee4; font-size: 10px; }
.admin-status.is-published { color: #3f7157; background: #eaf4ed; }
.admin-user-controls { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.admin-user-edit, .admin-link-edit { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(170px, 1fr) auto; align-items: end; gap: 9px; }
.admin-page label { min-width: 0; display: grid; gap: 5px; color: #4b5552; font-size: 10px; font-weight: 600; }
.admin-page input:not([type="checkbox"]), .admin-page textarea, .admin-page select { width: 100%; min-width: 0; min-height: 39px; padding: 8px 10px; border: 1px solid #dfe4e1; border-radius: 5px; color: #2e3836; background: #fff; font: inherit; font-size: 11px; font-weight: 400; }
.admin-page textarea { min-height: 68px; resize: vertical; line-height: 1.5; }
.admin-page input:focus, .admin-page textarea:focus, .admin-page select:focus { border-color: #63adc2; outline: 0; box-shadow: 0 0 0 3px rgba(98, 184, 211, .13); }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-page .button { min-height: 38px; padding: 0 12px; border-radius: 5px; font-size: 10px; white-space: nowrap; }
.button-danger { border: 1px solid #e7d3cf; color: #944c45; background: #fff; cursor: pointer; }
.button-danger:hover { border-color: #cd9c95; background: #fff8f7; }
.admin-protected-note, .admin-empty { margin: 10px 0 0; color: #7f8986; font-size: 11px; }
.admin-link-create { margin-bottom: 18px; padding: 14px; display: grid; grid-template-columns: minmax(100px, .7fr) minmax(160px, 1.5fr) minmax(90px, .6fr) 90px auto; align-items: end; gap: 10px; border: 1px solid #e3e7e4; background: #fafcfb; }
.admin-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.admin-link-edit { grid-template-columns: minmax(95px, .7fr) minmax(150px, 1.4fr) minmax(90px, .6fr) 75px auto auto; }
.admin-link-active { min-height: 39px; display: flex !important; align-items: center; gap: 7px !important; white-space: nowrap; }
.admin-link-active input { accent-color: #3898b5; }
.admin-home-form { max-width: 760px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 14px; }
.admin-base-url-field { grid-column: 1 / -1; }
.admin-base-url-field small { color: #74817d; font-size: 10px; font-weight: 400; line-height: 1.5; }
.admin-home-form label:nth-of-type(4), .admin-home-form label:nth-of-type(5), .admin-home-form label:nth-of-type(7), .admin-home-form label:nth-of-type(8) { grid-column: 1 / -1; }
.admin-home-form button { justify-self: start; }
.qr-admin-intro { margin: -4px 0 16px; color: #77817e; font-size: 11px; line-height: 1.6; }
.qr-select-form { max-width: 760px; }
.qr-select-toolbar { min-height: 43px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e1e6e3; color: #61706c; background: #fafcfb; font-size: 11px; }
.qr-select-toolbar > span { color: #74807c; font-variant-numeric: tabular-nums; }
.qr-select-all { display: inline-flex !important; align-items: center; gap: 8px !important; cursor: pointer; }
.qr-select-all input, .qr-select-item input { accent-color: #288da8; }
.qr-select-list { max-height: 390px; margin-bottom: 13px; overflow-y: auto; border: 1px solid #e1e6e3; border-top: 0; }
.qr-select-item { min-height: 52px; padding: 8px 11px; display: flex !important; align-items: center; gap: 10px !important; border-bottom: 1px solid #edf0ee; cursor: pointer; }
.qr-select-item:last-child { border-bottom: 0; }
.qr-select-item > span { min-width: 0; display: grid; gap: 2px; }
.qr-select-item strong { color: #36413e; font-size: 11px; }
.qr-select-item small { color: #7d8784; font-size: 9px; overflow-wrap: anywhere; }
.qr-print-section { margin-top: 25px; padding-top: 20px; border-top: 1px solid #e4e8e5; }
.qr-print-toolbar { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #63716d; font-size: 11px; }
.qr-print-status { margin: 0 0 12px; color: #9b5149; font-size: 11px; }
.qr-print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 13px; }
.qr-print-card { min-width: 0; padding: 15px 12px; display: grid; justify-items: center; gap: 7px; border: 1px solid #e0e5e2; border-radius: 6px; background: #fff; text-align: center; }
.qr-code { width: 200px; height: 200px; max-width: 100%; display: grid; place-items: center; overflow: hidden; background: white; }
.qr-code canvas, .qr-code img { max-width: 100%; height: auto; image-rendering: pixelated; }
.qr-print-card h3 { margin: 1px 0 0; color: #263431; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.qr-print-card p { margin: 0; color: #74817d; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.status-dot, .preview-live i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #cf8a54; }
.status-dot.is-live, .preview-live i { background: #539167; }
.dashboard-grid { width: 100%; max-width: 1180px; margin: 30px auto 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .78fr); gap: 46px; align-items: start; }
.editor-panel, .preview-panel { border: 0; background: transparent; box-shadow: none; }
.editor-panel { padding: 28px; border: 1px solid #e2e3da; background: var(--surface); box-shadow: 0 8px 24px rgba(46, 58, 46, .035); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 3px 0 0; font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: 0; }
.required-note { color: #90948c; font-size: 10px; }
.photo-row { margin: 19px 0 22px; padding: 15px; display: flex; align-items: center; gap: 14px; border: 1px solid #e6e7df; background: #fbfaf5; }
.avatar-editor { width: 62px; height: 62px; background: #718a75; font-size: 22px; }
.upload-control { position: relative; display: grid; gap: 4px; color: var(--green-dark); font-size: 11px; font-weight: 700; cursor: pointer; }
.upload-control input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-control:focus-within { outline: 2px solid #668b71; outline-offset: 3px; }
.upload-control small { color: #92968e; font-size: 10px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 13px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-grid label { color: #4d524d; font-size: 11px; font-weight: 600; }
.form-grid label > small { margin-left: 4px; color: #93978f; font-size: 9px; font-weight: 400; }
.form-grid input, .form-grid textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 8px; border: 1px solid #e4e5df; background: #fff; box-shadow: 0 0 0 0 rgba(0,0,0,0); transition: border-color .15s, box-shadow .15s; }
.form-grid textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
.form-grid input:focus, .form-grid textarea:focus { border-color: #d5d4ce; box-shadow: 0 0 0 3px rgba(72, 101, 82, .08); }
.field-hint { margin-top: -4px; text-align: right; }
.panel-heading-spaced { margin: 27px 0 15px; padding-top: 21px; border-top: 1px solid #e8e8e1; }
.detail-builder { display: grid; gap: 18px; }
.detail-option-group h3 { margin: 0 0 10px; color: #383e3d; font-size: 13px; font-weight: 700; }
.detail-option-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.detail-option { min-width: 0; min-height: 44px; padding: 5px 7px 5px 10px; display: grid; grid-template-columns: 17px minmax(0, 1fr) 30px; align-items: center; gap: 7px; border: 1px solid #e2e4e2; border-radius: 7px; color: #303635; background: #fff; font-size: 11px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.detail-option:hover:not(:disabled), .detail-option:focus-visible { border-color: #70b9ce; background: #f5fbfd; }
.detail-option:focus-visible, .detail-remove:focus-visible { outline: 2px solid #4fabc5; outline-offset: 2px; }
.detail-option:disabled { color: #657b7e; background: #f1f8fa; cursor: default; }
.detail-option-icon { display: grid; place-items: center; color: #252a2a; font-size: 14px; font-weight: 700; }
.detail-option-label { min-width: 0; overflow-wrap: anywhere; }
.detail-option-add { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #e1e3e3; border-radius: 6px; font-size: 16px; line-height: 1; }
.detail-option:disabled .detail-option-add { border-color: transparent; color: #2886a1; }
.detail-values { display: grid; gap: 10px; }
.detail-value-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: end; gap: 9px; }
.detail-value-row label { min-width: 0; display: grid; gap: 6px; color: #414a49; font-size: 11px; font-weight: 600; }
.detail-value-row input:not([type="hidden"]) { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #e1e4e2; border-radius: 5px; color: #26302f; background: #fff; font: inherit; font-weight: 400; }
.detail-value-row input:focus { border-color: #67aec3; outline: 0; box-shadow: 0 0 0 3px rgba(98, 184, 211, .14); }
.detail-remove { width: 36px; height: 36px; border: 1px solid #e1e3e3; border-radius: 6px; color: #5d6664; background: #fff; font-size: 19px; cursor: pointer; }
.detail-remove:hover { border-color: #dba8a3; color: #a33f3f; background: #fff8f7; }
.detail-empty { margin: 0; color: #878e8b; font-size: 11px; }
.history-editor { margin-top: 17px; }
.history-editor-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.history-editor-heading h3 { margin: 0; color: #383e3d; font-size: 13px; font-weight: 700; }
.history-add { flex: 0 0 auto; min-height: 34px; padding: 0 10px; border: 1px solid #dce3e3; border-radius: 6px; color: #267e96; background: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.history-add:hover { border-color: #70b9ce; background: #f5fbfd; }
.history-list, .skill-list { display: grid; gap: 10px; }
.history-entry { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: start; gap: 9px; padding: 13px; border: 1px solid #e2e5e3; border-radius: 6px; background: #fff; }
.history-fields { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.history-fields label { min-width: 0; display: grid; gap: 5px; color: #48514e; font-size: 10px; font-weight: 600; }
.history-fields .history-description { grid-column: 1 / -1; }
.history-fields input, .history-fields textarea { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid #e1e4e2; border-radius: 4px; color: #26302f; background: #fff; font: inherit; font-size: 11px; font-weight: 400; }
.history-fields textarea { min-height: 62px; resize: vertical; }
.history-fields input:focus, .history-fields textarea:focus, .skill-entry input:focus { border-color: #67aec3; outline: 0; box-shadow: 0 0 0 3px rgba(98, 184, 211, .14); }
.history-remove { margin-top: 20px; }
.skill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill-entry { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 8px; }
.skill-entry input { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #e1e4e2; border-radius: 5px; color: #26302f; background: #fff; font: inherit; font-size: 11px; }
.skill-mode { margin-top: 16px; }
.editor-actions { margin-top: 24px; padding-top: 18px; display: flex; align-items: center; justify-content: flex-end; gap: 15px; border-top: 1px solid #e6e7df; }
.editor-actions > span { max-width: 180px; color: #92968e; font-size: 10px; }
.editor-actions .button { min-width: 142px; border-radius: 999px; padding: 0 26px; }
.preview-column { min-width: 0; position: sticky; top: 20px; }
.preview-panel { width: 100%; max-width: 390px; margin: 0 auto; padding: 0; }
.preview-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.preview-hint { margin: 2px 0 0; color: #7b8279; font-size: 11px; }
.preview-live { display: inline-flex; align-items: center; gap: 8px; color: #4d7b5a; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.public-preview-frame { width: min(100%, 390px); height: 740px; margin: 0 auto; overflow: hidden; border: 1px solid #cfd4ca; background: #fffefa; box-shadow: 0 15px 34px rgba(26, 27, 28, .1); }
.public-preview { width: 100%; height: 100%; display: block; border: 0; background: var(--paper); }
.public-profile [hidden] { display: none !important; }
.profile-bio { white-space: pre-line; }
.public-profile .profile-main [hidden] { display: none !important; }
.public-profile .contact-panel [hidden] { display: none !important; }
.public-profile .credentials [hidden] { display: none !important; }
.public-preview-frame ~ .publish-panel { max-width: 390px; margin-right: auto; margin-left: auto; }
.public-preview-frame ~ .publish-form { max-width: 390px; margin-right: auto; margin-left: auto; }
.preview-card { width: 100%; overflow: hidden; border: 1px solid #1a1b1c; border-radius: 34px; background: #fff; box-shadow: 0 22px 42px rgba(26, 27, 28, .12); }
.mobile-profile { width: 100%; max-width: 390px; min-height: 0; margin: 0 auto; border: 10px solid #2c2c2c; border-radius: 34px; background: #f3efe9; box-shadow: 0 20px 38px rgba(16, 18, 18, .14); }
.mobile-profile-top { position: relative; height: 250px; padding: 28px 30px 0; background: linear-gradient(135deg, #7cc4d9 0%, #74b5d4 30%, #8fc8db 100%); overflow: hidden; }
.mobile-profile-top::before { position: absolute; inset: 0; background: radial-gradient(circle at 18% 18%, rgba(255,255,255,.5) 0 14%, transparent 15%), radial-gradient(circle at 74% 18%, rgba(255,255,255,.25), transparent 18%), linear-gradient(110deg, rgba(255,255,255,.12), transparent 38%, rgba(255,255,255,.08)); content: ""; }
.mobile-avatar-wrap { position: absolute; left: 50%; bottom: -42px; transform: translateX(-50%); z-index: 2; }
.mobile-avatar-wrap .avatar-preview { width: 96px; height: 96px; margin: 0; border-radius: 50%; border: 5px solid #f0efe9; background: #d9e2df; box-shadow: 0 14px 22px rgba(34, 49, 58, .12); }
.mobile-logo { position: absolute; right: 42px; top: 54px; width: 112px; height: 68px; border-radius: 16px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.mobile-logo::before { position: absolute; inset: 14px; border-radius: 50%; background: radial-gradient(circle, transparent 0 50%, rgba(36, 49, 58,.55) 51% 58%, transparent 59%), radial-gradient(circle, rgba(36,49,58,.35) 0 18%, transparent 19%), repeating-radial-gradient(circle, rgba(36,49,58,.65) 0 2px, rgba(36,49,58,0) 2px 6px); content: ""; }
.mobile-profile-body { padding: 64px 26px 30px; background: #f3efe9; }
.mobile-profile-body h2 { margin: 0; font-family: var(--sans); font-size: 30px; font-weight: 500; line-height: 1.1; letter-spacing: -.04em; color: #2d2d2d; }
.preview-role { margin: 8px 0 0; color: #2f2f2f; font-size: 20px; line-height: 1.35; font-weight: 400; }
.preview-bio { margin: 13px 0 0; color: #686c68; font-size: 12px; line-height: 1.65; }
.preview-subjects { margin-top: 14px; }
.preview-subjects:empty { display: none; }
.contact-list { margin-top: 21px; padding-top: 17px; display: grid; gap: 14px; border-top: 1px solid #dedbd3; }
.contact-item { display: flex; align-items: center; gap: 16px; }
.contact-item[hidden], .contact-empty[hidden] { display: none; }
.contact-icon { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: #404040; color: #f7f4ee; font-size: 16px; }
.contact-item > div { min-width: 0; }
.contact-item strong { display: block; overflow-wrap: anywhere; color: #2d2d2d; font-weight: 600; font-size: 15px; line-height: 1.35; }
.contact-item small { display: block; margin-top: 2px; color: #7a7a7a; font-size: 11px; }
.contact-empty { margin: 0; color: #7a7a7a; font-size: 11px; line-height: 1.5; }
.preview-card .button { min-height: 42px; border-radius: 12px; font-size: 11px; }
.publish-panel { margin-top: 20px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #e1e5db; background: var(--surface); }
.publish-panel > div { min-width: 0; flex: 1; }
.publish-panel .eyebrow { color: #7a8576; }
.publish-panel p { margin: 4px 0 0; color: var(--ink); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid #dfe4d8; border-radius: 50%; background: #f7f7f1; color: var(--green-dark); cursor: pointer; }
.publish-form { margin-top: 10px; padding: 14px; border: 1px solid #e1e5db; background: var(--surface); }
.publish-form small { display: block; margin-top: 8px; color: #7b8279; font-size: 10px; line-height: 1.5; }

/* Published profile */
.public-profile { --theme-accent: #62b8d3; --theme-cover: #59b6d2; --theme-soft: #72c2d9; --theme-wash: #edf8fb; width: min(100%, 1040px); margin: 36px auto 0; }
.public-profile > .back-link { margin-bottom: 13px; }
.profile-cover { position: relative; height: 220px; padding: 24px; display: flex; align-items: end; justify-content: space-between; overflow: hidden; background-color: var(--theme-cover); background-image: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,.68) 0 9%, transparent 9.3%), radial-gradient(ellipse at 84% 15%, transparent 0 19%, rgba(255,255,255,.48) 19.3% 19.8%, transparent 20.1%), linear-gradient(125deg, var(--theme-soft), var(--theme-cover) 62%, #7ecde1); }
.profile-cover::before { position: absolute; z-index: 1; width: 290px; height: 290px; right: 12%; top: 30px; border: 1px solid rgba(74, 105, 75, .13); border-radius: 50%; content: ""; }
.profile-cover::after { position: absolute; z-index: 1; width: 210px; height: 210px; right: 16%; top: 70px; border: 1px dashed rgba(74, 105, 75, .2); border-radius: 50%; content: ""; }
.profile-cover-image { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-cover.has-custom-cover { background-image: linear-gradient(0deg, rgba(20, 31, 24, .28), rgba(20, 31, 24, .04)); }
.profile-cover.has-custom-cover::before, .profile-cover.has-custom-cover::after, .profile-cover.has-custom-cover .cover-note, .profile-cover.has-custom-cover .cover-spark { display: none; }
.cover-note { position: relative; z-index: 2; color: var(--theme-accent); font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.cover-spark { position: absolute; z-index: 2; top: 25px; right: 17%; color: var(--theme-accent); font-size: 34px; }
.profile-brand-tile { position: absolute; z-index: 3; right: 5%; bottom: -31px; width: 108px; height: 68px; display: grid; place-items: center; border: 4px solid #fffefa; border-radius: 8px; color: white; background: var(--theme-soft); box-shadow: 0 2px 7px rgba(24, 33, 33, .16); }
.profile-brand-tile span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--theme-accent); background: rgba(255,255,255,.7); font-family: var(--serif); font-size: 23px; font-weight: 700; }
.public-content { padding: 0 5% 32px; background: #fffefa; }
.public-heading { position: relative; min-height: 132px; margin-top: -48px; padding-left: 132px; display: flex; align-items: center; }
.avatar-large { position: absolute; z-index: 3; top: 0; left: 0; width: 112px; height: 112px; margin: 0; border: 5px solid #fffefa; background: var(--theme-accent); box-shadow: 0 0 0 1px rgba(38, 54, 47, .08), 0 8px 20px rgba(38, 54, 47, .12); font-size: 31px; }
.avatar-large img { border-radius: 50%; object-fit: cover; }
.public-title { min-width: 0; padding: 0; }
.public-title .eyebrow { display: none; color: var(--theme-accent); }
.public-title h1 { margin: 0; color: #171a1a; font-family: var(--sans); font-size: 26px; font-weight: 700; letter-spacing: 0; line-height: 1.25; overflow-wrap: anywhere; }
.public-title p { margin: 5px 0 0; color: #292d2e; font-size: 16px; line-height: 1.4; }
.verified-mark { display: none; }
.profile-contact-list { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.profile-contact-item { min-width: 0; display: flex; align-items: center; gap: 11px; }
.profile-contact-icon { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border-radius: 50%; color: white; background: #373d3e; font-size: 16px; }
.profile-contact-copy { min-width: 0; display: grid; line-height: 1.35; }
.profile-contact-copy strong { overflow-wrap: anywhere; color: #171a1a; font-size: 13px; font-weight: 700; }
.profile-contact-copy small { color: #858b8b; font-size: 11px; }
.profile-contact-item[hidden] { display: none !important; }
.contact-empty { margin: 0; color: #727a70; font-size: 12px; }
.profile-columns { padding-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .72fr); align-items: start; gap: 7%; }
.profile-main h2 { margin: 10px 0 9px; font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: 0; }
.profile-main h2:not(:first-child) { margin-top: 29px; }
.profile-bio { max-width: 540px; margin: 0; color: #646e64; font-size: 13px; line-height: 1.85; }
.profile-bio-more { margin-top: 9px; color: var(--theme-accent); font-size: 11px; }
.profile-bio-more summary { width: fit-content; cursor: pointer; font-weight: 700; }
.profile-bio-more p { margin: 8px 0 0; color: #646e64; line-height: 1.75; white-space: pre-line; }
.public-profile [hidden] { display: none !important; }
.profile-main .subject-list { margin-top: 13px; }
.profile-more { margin-top: 21px; border-top: 1px solid #e3e8e6; }
.profile-more > summary { padding: 13px 0; display: flex; align-items: center; justify-content: space-between; color: var(--theme-accent); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.profile-more > summary::-webkit-details-marker { display: none; }
.profile-more > summary span { transition: transform .2s ease; }
.profile-more[open] > summary span { transform: rotate(180deg); }
.profile-more-content { padding: 5px 0 10px; }
.profile-details { margin-top: 34px; padding-top: 25px; border-top: 1px solid #d8e5e2; }
.profile-details-heading { margin-bottom: 20px; }
.profile-details-heading h2 { margin: 5px 0 0; font-family: var(--serif); font-size: 25px; font-weight: 500; }
.profile-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 24px; }
.profile-detail-group h3 { margin: 8px 0 10px; color: var(--theme-accent); font-size: 13px; font-weight: 700; }
.profile-detail-copy { margin: 0; color: #646e64; font-size: 12px; line-height: 1.7; }
.personal-detail-list { display: grid; gap: 11px; }
.personal-detail-list > div { display: grid; gap: 2px; }
.personal-detail-list b { color: #454d4b; font-size: 10px; font-weight: 600; }
.personal-detail-list span { color: #646e64; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.profile-history-list { display: grid; gap: 13px; }
.profile-history-item { display: grid; gap: 4px; padding-left: 11px; border-left: 2px solid var(--theme-soft); }
.profile-history-item b { color: #35403e; font-size: 12px; line-height: 1.5; }
.profile-history-meta { color: #7f8a87; font-size: 10px; }
.profile-history-item p { margin: 2px 0 0; color: #646e64; font-size: 11px; line-height: 1.6; }
.profile-skills { margin-top: 3px; }
.public-profile .subject-list span { border-color: color-mix(in srgb, var(--theme-accent) 20%, white); color: var(--theme-accent); background: var(--theme-wash); }
.credentials { display: grid; gap: 10px; }
.credentials > div { display: flex; align-items: center; gap: 11px; }
.credential-icon { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #e2e6dc; border-radius: 50%; color: var(--theme-accent); background: var(--theme-wash); }
.credentials p { margin: 0; display: grid; color: #4d574e; font-size: 11px; }
.credentials small { color: #8b9087; font-size: 9px; }
.contact-panel { align-self: start; padding: 21px; border: 1px solid color-mix(in srgb, var(--theme-accent) 16%, white); background: var(--theme-wash); }
.contact-panel > .eyebrow { color: var(--theme-accent); }
.contact-panel h2 { margin: 7px 0 8px; font-family: var(--serif); font-size: 23px; font-weight: 500; letter-spacing: 0; line-height: 1.3; }
.contact-detail { margin: 0 0 14px; color: #727a70; font-size: 10px; line-height: 1.6; }
.contact-panel .button { min-height: 42px; margin-top: 8px; font-size: 11px; }
.contact-panel .button-dark { background: var(--theme-accent); }
.contact-panel .button-outline { border-color: color-mix(in srgb, var(--theme-accent) 35%, white); color: var(--theme-accent); }
.text-link { margin-top: 11px; display: block; color: var(--theme-accent, var(--green)); font-size: 10px; font-weight: 700; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.profile-contact-list .share-button { grid-column: 1 / -1; width: fit-content; margin: 2px 0 0; padding: 0; border: 0; color: var(--theme-accent); background: transparent; font-size: 11px; text-align: left; cursor: pointer; }
.profile-contact-list .share-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.public-footer { margin-top: 39px; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid #e8e8e0; color: #93978f; font-size: 10px; }
.public-footer .brand { color: var(--ink); font-size: 13px; }
.public-footer .brand-mark { width: 24px; height: 24px; font-size: 15px; }
.profile-embed .topbar, .profile-embed .site-footer, .profile-embed .flash { display: none; }
.profile-embed .page-shell { width: calc(100% - 20px); }
.profile-embed .public-profile { max-width: none; }

.cover-upload-row { min-height: 112px; margin: -4px 0 22px; padding: 12px; display: flex; align-items: center; gap: 14px; border: 1px solid #e6e7df; background: #fbfaf5; }
.cover-editor-preview { width: 142px; height: 84px; flex: 0 0 auto; overflow: hidden; border: 1px solid #d9ded4; background: linear-gradient(135deg, #dce8d5, #bdd1c0 50%, #f0e4d1); }
.cover-editor-preview img { width: 100%; height: 100%; object-fit: cover; }
.public-preview-frame ~ .publish-panel, .public-preview-frame ~ .publish-form { max-width: 390px; margin-right: auto; margin-left: auto; }

@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

@media (max-width: 900px) {
    .topbar { flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
    .topnav { flex-wrap: wrap; justify-content: center; }
    .directory-hero { gap: 20px; padding-right: 3%; padding-left: 3%; }
    .hero-art { transform: scale(.86); }
    .dashboard-grid { grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr); gap: 24px; }
    .editor-panel { padding: 20px; }
    .admin-link-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-link-create button { justify-self: start; }
    .admin-link-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-link-row > form:last-child { justify-self: start; }
    .detail-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .history-fields { grid-template-columns: 1fr; }
    .history-fields .history-description { grid-column: auto; }
    .public-content { padding-right: 4%; padding-left: 4%; }
}
@media (max-width: 760px) {
    .topbar { padding-left: 16px; padding-right: 16px; }
    .topnav { gap: 12px; }
    .nav-cta { white-space: nowrap; }
    .search-form { flex-wrap: wrap; min-height: auto; height: auto; padding: 10px 12px; }
    .search-form input { min-width: 100%; order: 1; }
    .search-form button { width: 100%; justify-content: center; order: 2; }
    .dashboard-grid { width: 100%; grid-template-columns: 1fr; }
    .preview-column { position: static; }
    .preview-panel { width: min(100%, 390px); }
    .preview-column { width: 100%; }
}
@media (max-width: 700px) {
    .topbar { min-height: 65px; padding: 0 18px; }
    .topnav { gap: 14px; font-size: 11px; }
    .topnav > a:first-child { display: none; }
    .nav-cta { padding: 9px 11px; gap: 6px; }
    .page-shell { width: min(100% - 32px, 520px); }
    .preview-panel { width: min(100%, 390px); }
    .preview-card { border-radius: 22px; }
    .directory-hero { min-height: 0; padding: 47px 3% 35px; grid-template-columns: 1fr; gap: 5px; }
    .hero-copy h1 { font-size: 48px; }
    .hero-copy > p { font-size: 13px; }
    .hero-art { height: 250px; margin: 5px auto -8px; transform: scale(.72); transform-origin: center; }
    .hero-art::before { width: 330px; height: 330px; }
    .hero-art::after { width: 270px; height: 270px; }
    .art-caption { right: -40px; }
    .directory-section { padding-top: 37px; }
    .section-heading { align-items: start; flex-direction: column; }
    .section-heading h2 { font-size: 25px; }
    .teacher-grid { grid-template-columns: 1fr; gap: 11px; }
    .teacher-card { min-height: 290px; }
    .join-banner { min-height: 245px; margin-top: 42px; padding: 27px 24px; align-items: start; flex-direction: column; justify-content: center; }
    .join-banner h2 { font-size: 27px; }
    .join-mark { right: -10px; bottom: -93px; font-size: 235px; }
    .site-footer { margin-top: 45px; padding: 20px 18px; flex-wrap: wrap; font-size: 10px; }
    .site-footer > span:nth-child(2) { display: none; }
    .auth-layout { min-height: 0; padding: 39px 0 10px; grid-template-columns: 1fr; gap: 25px; }
    .auth-aside h1 { margin: 12px 0 9px; font-size: 39px; }
    .auth-aside > p { margin-bottom: 0; font-size: 12px; }
    .auth-quote { display: none; }
    .auth-card { padding: 24px 20px; }
    .auth-card .back-link { margin-bottom: 23px; }
    .dashboard-heading { margin-top: 30px; align-items: start; flex-direction: column; gap: 12px; }
    .admin-heading { align-items: start; flex-direction: column; gap: 12px; }
    .admin-tabs { gap: 15px; overflow-x: auto; }
    .admin-user-summary { grid-template-columns: minmax(0, 1fr) auto; }
    .admin-user-summary time { grid-column: 1 / -1; }
    .admin-user-controls { grid-template-columns: 1fr; }
    .admin-user-edit { grid-template-columns: 1fr; }
    .admin-user-actions { align-items: start; }
    .admin-link-create, .admin-link-edit { grid-template-columns: 1fr; }
    .admin-link-row { grid-template-columns: 1fr; }
    .admin-home-form { grid-template-columns: 1fr; }
    .admin-home-form label:nth-of-type(n) { grid-column: auto; }
    .qr-select-toolbar { align-items: start; flex-direction: column; justify-content: center; padding: 9px 11px; }
    .qr-print-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qr-code { width: min(100%, 200px); height: auto; aspect-ratio: 1; }
    .dashboard-heading h1 { font-size: 29px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .preview-card { max-width: 390px; margin: auto; }
    .preview-panel { width: min(100%, 390px); }
    .preview-top { margin-bottom: 8px; }
    .editor-panel { padding: 17px 14px; }
    .detail-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .detail-option { grid-template-columns: 15px minmax(0, 1fr) 26px; gap: 5px; padding-left: 7px; font-size: 10px; }
    .detail-option-add { width: 26px; height: 28px; }
    .editor-actions { align-items: stretch; flex-direction: column; }
    .editor-actions > span { max-width: none; }
    .editor-actions .button { justify-content: center; }
    .public-profile { margin-top: 20px; }
    .profile-cover { height: 184px; }
    .cover-note { max-width: 160px; font-size: 8px; }
    .public-content { padding: 0 24px 24px; }
    .public-heading { min-height: 168px; margin-top: 0; padding: 70px 0 0; display: block; }
    .avatar-large { top: -42px; width: 88px; height: 88px; border-width: 4px; font-size: 24px; }
    .public-title h1 { font-size: 23px; overflow-wrap: anywhere; }
    .public-title p { font-size: 14px; }
    .profile-contact-list { grid-template-columns: 1fr; gap: 12px; }
    .profile-columns { grid-template-columns: 1fr; gap: 22px; }
    .profile-details { margin-top: 26px; padding-top: 21px; }
    .profile-details-grid { grid-template-columns: 1fr; gap: 20px; }
    .public-footer { align-items: start; flex-direction: column; }
}
@media (max-width: 480px) {
    .page-shell { width: calc(100% - 20px); }
    .topbar { padding: 10px 12px; }
    .brand { gap: 7px; font-size: 16px; }
    .topnav { gap: 9px; font-size: 10px; }
    .nav-cta { padding: 8px; }
    .hero-copy h1 { font-size: 42px; }
    .search-form { gap: 7px; padding-left: 10px; }
    .search-form button { padding: 0 11px; gap: 8px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .field-wide { grid-column: auto; }
    .stack-form input, .form-grid input, .form-grid textarea { font-size: 14px; }
    .photo-row { align-items: flex-start; flex-direction: column; }
    .cover-upload-row { align-items: flex-start; flex-direction: column; }
    .cover-editor-preview { width: 100%; height: 128px; }
    .upload-control { width: 100%; }
    .skill-list { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
    .topbar { padding: 0 12px; }
    .hero-copy h1 { font-size: 38px; }
    .join-banner { padding: 24px 18px; }
    .auth-card { padding: 20px 14px; }
    .public-content { padding: 0 16px 20px; }
    .profile-cover { height: 160px; }
    .public-heading { min-height: 154px; padding-top: 64px; }
    .avatar-large { top: -36px; width: 78px; height: 78px; }
    .profile-main h2 { font-size: 18px; }
    .qr-print-grid { grid-template-columns: 1fr; }
}

@media print {
    @page { margin: 12mm; }
    html, body { min-width: 0; color: #111; background: #fff !important; }
    .topbar, .site-footer, .flash, .admin-page > :not(.qr-admin-section), .qr-admin-section > :not(.qr-print-section) { display: none !important; }
    .page-shell, .admin-page { width: 100%; max-width: none; margin: 0; }
    .qr-print-section { margin: 0; padding: 0; border: 0; }
    .qr-print-toolbar, .qr-print-status { display: none !important; }
    .qr-print-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8mm; }
    .qr-print-card { padding: 6mm 4mm; border: 1px solid #c9cfcc; border-radius: 0; background: #fff; break-inside: avoid; }
    .qr-code { width: 42mm; height: 42mm; max-width: none; }
    .qr-code canvas, .qr-code img { width: 40mm; height: 40mm; }
    .qr-print-card h3 { color: #111; font-size: 10pt; }
    .qr-print-card p { color: #444; font-size: 7pt; }
}