/* TikNotes unified responsive UI v3 — additive styling, no backend logic changes */
:root{--tn-ink:#20242a;--tn-muted:#697382;--tn-green:#07865a;--tn-green-soft:#e9f7ef;--tn-line:#e5e9ee;--tn-bg:#f7f9fb;--tn-white:#fff;--tn-radius:16px;--tn-shadow:0 6px 24px rgba(23,36,51,.045);color-scheme:light}
*,*::before,*::after{box-sizing:border-box}
html{font-size:16px;-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0!important;min-width:320px;color:var(--tn-ink)!important;background:var(--tn-bg)!important;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif!important;line-height:1.55}
a{color:inherit;text-decoration:none}a:hover{color:var(--tn-green)}
:where(button,input,textarea,select,a,summary):focus-visible{outline:3px solid rgba(5,150,105,.36)!important;outline-offset:2px}
:where(img,video,iframe){max-width:100%;height:auto}
:where(.shell){width:100%!important;max-width:none!important;min-height:100dvh!important;margin:0!important;padding:0!important;display:flex!important;flex-direction:column!important}
:where(.shell > header,.shell > .top){width:100%!important;max-width:none!important;min-height:68px!important;padding:12px max(20px,calc((100vw - 1120px)/2))!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:16px!important;border-bottom:1px solid var(--tn-line)!important;background:var(--tn-white)!important;position:relative;z-index:3}
:where(.brand){font-weight:800!important;font-size:24px!important;letter-spacing:-1.2px!important;white-space:nowrap;color:#22262d!important}
:where(.brand span,.brand .green,.brand-notes){color:var(--tn-green)!important}
:where(.shell > main){width:min(100% - 40px,1000px)!important;max-width:1000px!important;margin:0 auto!important;padding:30px 0 115px!important;flex:1 0 auto!important;min-width:0}
:where(.shell > main > h1,main h1){font-size:clamp(1.65rem,3vw,2.25rem)!important;line-height:1.18!important;letter-spacing:-.035em!important;margin:0 0 12px!important;font-weight:760!important}
:where(h2){font-size:1.24rem;line-height:1.3;letter-spacing:-.02em}
:where(.muted,.subtitle,.description,.hint,.foot,.note){color:var(--tn-muted)!important}
:where(.shell main > section,.shell main > article,.shell main > .panel,.shell main .slide,.shell main .card,.shell main .metric,.shell main .empty,.shell main .note,.shell main .item){border-radius:var(--tn-radius)!important}
:where(.shell main .slide,.shell main .panel,.shell main .metric,.shell main .card){background:#fff!important;border:1px solid var(--tn-line)!important;box-shadow:var(--tn-shadow)}
:where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),textarea,select){font:inherit!important;max-width:100%!important;min-height:46px!important;padding:11px 14px!important;border:1px solid #d9dfe7!important;border-radius:11px!important;background:#fff!important;color:var(--tn-ink)!important;box-shadow:none!important}
:where(textarea){min-height:100px!important;resize:vertical}
:where(label){font-weight:600;line-height:1.45}
:where(button,.button,input[type=submit]){font:inherit;font-weight:650!important;border-radius:11px!important;min-height:43px;cursor:pointer;transition:background .16s,transform .16s,border-color .16s}
:where(button:not(.secondary):not(.small),.button:not(.secondary),input[type=submit]){background:#24272e!important;color:white!important;border:1px solid #24272e!important}
:where(button:not(.secondary):hover,.button:not(.secondary):hover,input[type=submit]:hover){background:#343943!important}
:where(button.secondary,.button.secondary){background:#f1f3f5!important;border:1px solid #e9ecef!important;color:#24272e!important}
:where(button:disabled){opacity:.55;cursor:not-allowed}
:where(.tabs,.chips,.categories,.filters,.toolbar,.tools,.row){display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
:where(.tabs,.categories,.chips){overflow-x:auto;scrollbar-width:thin;flex-wrap:nowrap;padding:3px 0 8px}
:where(.tabs a,.categories a,.chips a){white-space:nowrap;border-radius:999px!important}
:where(.active){color:var(--tn-green)}
:where(table){width:100%;border-collapse:collapse}
:where(th,td){padding:12px;text-align:left;border-bottom:1px solid var(--tn-line)}
:where(.notice){border-radius:12px!important;padding:12px 15px!important}
:where(.shell .bottom){position:fixed!important;bottom:0!important;left:0!important;right:0!important;top:auto!important;z-index:50!important;display:flex!important;align-items:stretch!important;justify-content:center!important;width:100vw!important;max-width:none!important;min-height:74px!important;margin:0!important;padding:8px max(10px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom))!important;background:rgba(255,255,255,.98)!important;border-top:1px solid var(--tn-line)!important;box-shadow:0 -4px 20px rgba(17,24,39,.04)!important;backdrop-filter:blur(16px)!important;gap:0!important}
:where(.shell .bottom a){display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;flex:0 1 150px!important;width:auto!important;max-width:150px!important;min-width:0!important;margin:0!important;padding:5px 8px!important;border:0!important;border-radius:10px!important;color:#667181!important;font-size:12px!important;line-height:1.1!important;font-weight:600!important;text-align:center!important;white-space:nowrap}
:where(.shell .bottom a.active){color:var(--tn-green)!important;background:var(--tn-green-soft)!important}
:where(.shell .bottom a:hover){color:var(--tn-green)!important}
.tn-nav-icon{display:block;width:22px;height:22px;flex:none;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.tn-nav-label{display:block}
:where(.shell main .note){overflow:hidden}
:where(.shell main .metrics){display:grid!important;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}
:where(.shell main .slide){padding:18px!important;margin:16px 0!important}
:where(.shell main .toolbar){justify-content:space-between}
:where(.shell main .upload){display:flex;flex-wrap:wrap;gap:10px;align-items:center}
:where(.shell main .upload input[type=file]){flex:1;min-width:180px}
:where(.shell main .empty){background:#fff;padding:28px!important;border:1px dashed #d6dce3;text-align:center}
:where(.shell main .identity){max-width:100%;overflow-wrap:anywhere}
:where(.shell main .note,.shell main .item){overflow-wrap:anywhere}
@media(min-width:900px){:where(.shell > main){padding-top:42px!important}.shell .bottom{min-height:72px!important}.shell .bottom a{flex-basis:160px!important}.shell main .slide{padding:24px!important}}
@media(max-width:600px){body{background:#fff!important}:where(.shell > header,.shell > .top){min-height:58px!important;padding:10px 16px!important}:where(.brand){font-size:22px!important}:where(.shell > main){width:100%!important;padding:22px 16px 112px!important}:where(.shell main .slide){padding:14px!important;margin:12px 0!important}:where(.shell .bottom){min-height:68px!important}:where(.shell .bottom a){font-size:11px!important;padding:5px 2px!important}:where(.shell main .metrics){grid-template-columns:repeat(2,minmax(0,1fr))!important}:where(.shell main .toolbar){gap:8px}:where(.shell main .tools){gap:5px}:where(.shell main .tools button){padding:8px!important}:where(.shell main .upload){flex-direction:column;align-items:stretch}:where(.shell main .upload input[type=file]){width:100%}}
@media(max-width:360px){:where(.shell > main){padding-left:12px!important;padding-right:12px!important}:where(.shell .bottom a){font-size:10px!important}.tn-nav-icon{width:20px;height:20px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* TikNotes v4: create workflow + responsive layout */
.tn-hero{padding:clamp(22px,5vw,48px);border-radius:22px;background:#f6f8f7;margin:16px 0 30px}.tn-eyebrow{font-size:11px;letter-spacing:.13em;font-weight:800;color:#059669}.tn-hero h1{font-size:clamp(27px,4vw,42px);letter-spacing:-.045em;line-height:1.12;margin:12px 0}.tn-hero p{color:#687078;margin:0 0 24px}.tn-new-form{max-width:320px}.tn-primary-action,.tn-publish{display:inline-flex;align-items:center;justify-content:space-between;gap:20px;background:#24272e!important;color:white!important;border:0;border-radius:12px;padding:15px 20px;font-weight:750;text-decoration:none;cursor:pointer;width:100%}.tn-section{margin:24px 0 40px}.tn-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px}.tn-section-title h2{margin:0;font-size:19px}.tn-section-title a{font-size:13px;color:#059669;text-decoration:none;font-weight:700}.tn-draft-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.tn-draft-card{border:1px solid #e5e9e7;border-radius:15px;padding:18px;display:flex;align-items:center;gap:14px;text-decoration:none;color:#24272e;background:white;min-width:0}.tn-draft-card:hover{border-color:#059669;box-shadow:0 6px 20px #00000008}.tn-draft-symbol{background:#eff8f3;color:#059669;border-radius:11px;padding:14px;font-size:24px}.tn-draft-info{flex:1;min-width:0}.tn-draft-info strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tn-draft-info small{display:block;color:#79818a;margin-top:5px}.tn-empty{border:1px dashed #d7ddda;border-radius:14px;padding:28px;text-align:center}.tn-empty p{color:#737b84}.tn-editor-head{display:flex;align-items:center;justify-content:space-between;margin:8px 0 22px}.tn-back{text-decoration:none;color:#4b5563;font-size:14px;font-weight:650}.tn-status{background:#eaf7f0;color:#08754d;border-radius:99px;padding:7px 12px;font-size:12px;font-weight:700}.tn-editor-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:stretch;margin:22px 0 36px}.tn-editor-actions>*{flex:1 1 160px}.tn-editor-actions form{display:flex}.tn-save,.tn-preview{display:inline-flex;align-items:center;justify-content:center;border-radius:12px;padding:15px 18px;text-decoration:none;font-weight:750;cursor:pointer}.tn-save{background:#f3f4f6!important;color:#24272e!important;border:1px solid #e5e7eb}.tn-preview{background:white!important;color:#24272e!important;border:1px solid #d1d5db}.tn-preview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:24px 0}.tn-preview-card{border:1px solid #e5e7eb;border-radius:16px;overflow:hidden;padding:14px;background:white;min-width:0}.tn-preview-card img{display:block;width:100%;aspect-ratio:4/3;object-fit:contain;background:#f7f7f7;border-radius:10px;margin:12px 0}.tn-preview-card audio{width:100%;margin-top:12px}.tn-preview-count{font-size:12px;color:#6b7280;font-weight:700}.tn-media-missing{background:#f3f4f6;border-radius:10px;padding:40px 12px;text-align:center;color:#9ca3af}.tn-success{padding:18px;background:#eaf7f0;border-radius:12px;color:#08754d}.shell{min-height:100dvh}.shell main{padding-bottom:calc(96px + env(safe-area-inset-bottom))}@media(max-width:650px){.tn-draft-grid,.tn-preview-grid{grid-template-columns:1fr}.tn-hero{margin-top:0;border-radius:16px;padding:22px}.tn-new-form{max-width:none}.tn-editor-actions{display:grid;grid-template-columns:1fr 1fr}.tn-editor-actions .tn-publish{grid-column:1/-1}.tn-editor-actions form{grid-column:1/-1}.tn-editor-actions form .tn-publish{width:100%}}

/* v5: stable app chrome, responsive navigation and actionable content */
:root{--tn-ink:#17191d;--tn-green:#17865b;--tn-muted:#68717e;--tn-line:#e8ebee}
html,body{min-width:320px;max-width:100%;overflow-x:clip}
body{background:#fafbfa;color:var(--tn-ink)}
.shell{min-height:100dvh;display:flex;flex-direction:column;width:100%;max-width:none!important}
.shell>main{width:min(100% - 32px,1060px);margin:0 auto;flex:1;padding-bottom:100px}
.shell>header{width:100%;max-width:none!important;padding-inline:max(18px,calc((100vw - 1060px)/2))}
.shell .bottom{position:fixed!important;inset:auto 0 0 0!important;width:100vw!important;max-width:none!important;z-index:50;display:flex;justify-content:space-evenly;align-items:center;background:#fff;border-top:1px solid var(--tn-line);padding:8px 12px max(9px,env(safe-area-inset-bottom))!important;box-sizing:border-box}
.shell .bottom a{min-width:58px;min-height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-decoration:none}
.shell .bottom .tn-nav-icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tn-list-actions,.tn-preview-footer{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tn-action-link{display:inline-flex;align-items:center;justify-content:center;padding:9px 15px;border:1px solid var(--tn-line);border-radius:10px;background:#fff;color:var(--tn-ink);text-decoration:none;font-size:13px;font-weight:650;min-height:40px}
.tn-public-slide{display:grid;gap:12px;margin-bottom:14px;padding:16px!important;border-radius:16px}
.tn-public-image{display:block;width:100%;max-height:560px;object-fit:contain;border-radius:12px;background:#f0f2f2}
.tn-public-audio{width:100%}
.tn-editor-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:stretch}
.tn-editor-actions>*{flex:1 1 170px;min-height:48px}
.tn-preview-footer{margin:22px 0}
@media(max-width:640px){.shell>main{width:calc(100% - 28px)!important;padding-bottom:110px}.tn-editor-actions{display:grid;grid-template-columns:1fr 1fr}.tn-editor-actions>*:last-child{grid-column:1/-1}.tn-list-actions{width:100%;justify-content:flex-start}.tn-public-slide{padding:12px!important}}
@media(min-width:1000px){.shell>main{padding-bottom:75px}.shell .bottom{width:100vw!important}.shell .bottom a{flex-direction:row;gap:8px}}

/* TikNotes v6: consistent touch-first, square 1:1 slide system */
:root{--tn-ink:#181b20;--tn-green:#16875d;--tn-bg:#f8f9fa;--tn-radius:18px;--tn-shadow:0 8px 28px rgba(15,23,42,.045)}
body{background:var(--tn-bg)!important} :where(.shell > main){width:min(calc(100% - 32px),1040px)!important}
:where(.shell main button,.shell main .button){min-height:44px;touch-action:manipulation}
:where(.shell main .card,.shell main .panel,.shell main .item){transition:box-shadow .18s ease,border-color .18s ease}
:where(.shell main .card:hover,.shell main .panel:hover){border-color:#cbd5d1!important;box-shadow:0 10px 28px rgba(15,23,42,.075)!important}
:where(.shell main h1){font-weight:800!important;letter-spacing:-.045em!important}
.tn-square-media{aspect-ratio:1/1;width:100%;max-width:100%;background:#f0f2f3;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:14px;position:relative}
.tn-square-media img,.tn-square-media .tn-public-image{display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;margin:0!important;border:0!important;background:#eef1f2}
.tn-square-media:has(audio){margin-bottom:64px}
.tn-square-media audio{position:absolute;top:calc(100% + 10px);left:0;width:100%;height:46px}
.tn-square-media:has(audio){overflow:visible}
.tn-square-media:has(audio) img{border-radius:14px}
.tn-preview-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr))!important;gap:18px!important;align-items:start}
.tn-preview-card{min-width:0!important;padding:16px!important;background:#fff;border:1px solid #e5e9ee;border-radius:18px!important;box-shadow:var(--tn-shadow)}
.tn-preview-card .tn-square-media{margin:12px 0 14px}
.tn-preview-card .tn-square-media:has(audio){margin-bottom:70px}
.tn-preview-card p{line-height:1.6;overflow-wrap:anywhere}
.tn-slide-deck{max-width:560px;margin:16px auto!important}
.tn-slide-deck .tn-public-slide{padding:16px!important;margin:0!important;border:1px solid #e3e8eb!important;border-radius:20px!important;background:#fff!important;box-shadow:var(--tn-shadow)}
.tn-slide-deck .tn-public-slide[hidden]{display:none!important}
.tn-slide-deck .tn-public-slide .tn-square-media{margin:12px 0 18px}
.tn-slide-deck .tn-public-slide .tn-square-media:has(audio){margin-bottom:76px}
.tn-slide-kicker{font-size:12px;font-weight:750;letter-spacing:.06em;text-transform:uppercase;color:#64748b}
.tn-carousel-head{display:flex;align-items:center;justify-content:space-between;max-width:560px;margin:24px auto 0}
.tn-carousel-head h2{margin:0!important}.tn-carousel-counter{font-size:13px;color:#64748b;font-weight:700}
.tn-deck-controls{max-width:560px;margin:12px auto 30px;display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tn-deck-controls button{width:100%;min-height:46px;margin:0!important}
.tn-deck-controls button:first-child{background:#e9eef0!important;border-color:#e9eef0!important;color:#222!important}
.tn-deck-controls button:disabled{opacity:.4;cursor:not-allowed}
.tn-player-label{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:700;color:#64748b;margin:14px 0 6px}
#slide-image[hidden]{display:none!important}
.slide .tn-square-media{border-radius:14px 14px 0 0!important}
.slide .tn-square-media:has(audio){margin-bottom:0!important}
#slide-image{aspect-ratio:1/1!important;width:100%!important;height:100%!important;object-fit:contain!important}
:where(.tn-editor-actions){display:flex;flex-wrap:wrap;gap:10px;align-items:stretch}
:where(.tn-editor-actions button,.tn-editor-actions a){flex:1 1 160px;display:flex;align-items:center;justify-content:center;text-align:center;min-height:48px!important}
@media(max-width:600px){:where(.shell > main){width:calc(100% - 28px)!important;padding-top:20px!important}.tn-preview-grid{grid-template-columns:1fr!important}.tn-preview-card{padding:12px!important}.tn-slide-deck .tn-public-slide{padding:12px!important}.tn-square-media{border-radius:12px}.tn-editor-actions{display:grid!important;grid-template-columns:1fr 1fr}.tn-editor-actions>*:last-child{grid-column:1/-1}.tn-deck-controls button{font-size:14px!important}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
