/* ════════════════════════════════════
   APP - LIBRARY (and the frame both screens share)
   The same palette and type as the homepage: warm slate surfaces, seams, one flame accent,
   no mono labels. Deck tiles are little card stacks, like the logo.
════════════════════════════════════ */
.app{max-width:1180px;margin:0 auto;padding:40px 32px 72px;}

/* The app's two screens: Library and Generate (app.js: setAppTab). One pane shows at a time. */
.app-pane{display:none;}
#appView[data-tab="library"] #paneLibrary,
#appView[data-tab="generate"] #paneGenerate{display:block;animation:paneIn .32s var(--ease-out);}
@keyframes paneIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}

/* Greeting, and the free plan's count */
.dash-head{display:flex;align-items:flex-end;justify-content:space-between;gap:22px 40px;flex-wrap:wrap;margin-bottom:28px;}
.dash-hello{min-width:0;flex:1 1 380px;}
.dash-date{font-size:14px;font-weight:600;color:var(--text3);margin-bottom:10px;}
.dash-hello .dash-title{font-size:clamp(34px,4.6vw,52px);font-weight:800;letter-spacing:-0.035em;line-height:1;font-variation-settings:'opsz' 96;text-wrap:balance;overflow-wrap:anywhere;}
.dash-sub{font-size:16.5px;color:var(--text2);margin-top:12px;line-height:1.5;}
.usage-card{display:flex;align-items:center;gap:16px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:13px 14px 13px 18px;flex:0 1 380px;min-width:0;box-shadow:var(--lift-1);}
.usage-bar-left{flex:1;min-width:0;}
.usage-bar-label{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13.5px;color:var(--text2);margin-bottom:9px;}
.usage-bar-label strong{color:var(--text);font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;}
.usage-track{height:6px;background:var(--surface3);border-radius:99px;overflow:hidden;}
.usage-fill{height:100%;background:linear-gradient(90deg,var(--ember),var(--accent));border-radius:99px;transition:width .6s var(--ease);}
.usage-fill.full{background:var(--danger);}
.usage-fill.warn{background:#d97706;}
.usage-bar-right{display:flex;gap:8px;flex-shrink:0;}
.btn-upgrade-inline{background:var(--accent);color:#fff;border:none;height:38px;padding:0 15px;border-radius:var(--r-sm);font-family:inherit;font-size:13.5px;font-weight:700;cursor:pointer;transition:background .2s,transform .2s var(--ease);white-space:nowrap;box-shadow:var(--flame-shadow);}
.btn-upgrade-inline:hover{background:var(--accent-hover);}
.btn-upgrade-inline:active{transform:scale(.97);}

/* Quick actions: one row */
.quick-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 -2px 44px;padding:2px;}
.quick-actions::-webkit-scrollbar{display:none;}
.quick-action-btn{display:inline-flex;align-items:center;gap:8px;flex-shrink:0;height:44px;padding:0 17px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--border);color:var(--text);font-family:inherit;font-size:14.5px;font-weight:600;cursor:pointer;white-space:nowrap;box-shadow:var(--lift-1);transition:border-color .15s,background .15s,transform .2s var(--ease);}
.quick-action-btn svg{width:16px;height:16px;color:var(--text2);flex-shrink:0;transition:color .15s;}
.quick-action-btn:hover{border-color:var(--border2);background:var(--surface2);}
.quick-action-btn:hover svg{color:var(--accent);}
.quick-action-btn:active{transform:scale(.97);}
.quick-action-btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:700;box-shadow:var(--flame-shadow);}
.quick-action-btn.primary svg,.quick-action-btn.primary:hover svg{color:#fff;}
.quick-action-btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);}
.qa-more{position:relative;}
.qa-menu{position:absolute;left:0;top:calc(100% + 8px);z-index:30;min-width:240px;padding:6px;display:grid;gap:2px;border-radius:var(--r-lg);background:var(--surface2);border:1px solid var(--border2);box-shadow:var(--lift-3);animation:menuPop .16s var(--ease-out);transform-origin:top left;}
@keyframes menuPop{from{opacity:0;transform:translateY(-4px) scale(.98);}to{opacity:1;transform:none;}}
.qa-menu[hidden]{display:none;}
.qa-menu .quick-action-btn{width:100%;height:42px;border-color:transparent;background:none;border-radius:var(--r-sm);padding:0 11px;box-shadow:none;}
.qa-menu .quick-action-btn:hover,.qa-menu .quick-action-btn:focus-visible{background:var(--surface3);border-color:transparent;}
@media (max-width:600px){.quick-actions{flex-wrap:nowrap;gap:6px;}.quick-actions > .quick-action-btn{flex:1 1 auto;justify-content:center;padding:0 12px;}.quick-actions .qa-long{display:none;}#qaMoreBtn{padding:0 13px;}.qa-menu{left:auto;right:0;transform-origin:top right;}}
.lib-search-kbd{display:none;flex-shrink:0;margin-left:auto;font-size:11.5px;font-weight:600;line-height:1;font-family:inherit;color:var(--text3);padding:4px 6px;border-radius:6px;border:1px solid var(--border2);white-space:nowrap;cursor:pointer;}
.lib-search-kbd:hover{color:var(--text);border-color:var(--text3);}
@media (min-width:769px) and (hover:hover){.lib-search-kbd{display:inline-flex;}}
.palette-overlay{align-items:flex-start;padding-top:min(14vh,120px);}
.palette{width:min(580px,calc(100vw - 32px));border-radius:var(--r-xl);background:var(--surface2);border:1px solid var(--border2);box-shadow:var(--lift-3);overflow:hidden;animation:paletteIn .18s var(--ease);}
@keyframes paletteIn{from{opacity:0;transform:translateY(-8px) scale(.98);}to{opacity:1;transform:none;}}
.palette-search{display:flex;align-items:center;gap:10px;height:58px;padding:0 12px 0 18px;border-bottom:1px solid var(--border);}
.palette-search svg{width:18px;height:18px;color:var(--text3);flex-shrink:0;}
.palette-search input{flex:1;min-width:0;height:100%;background:none;border:0;outline:0;color:var(--text);font:500 16px inherit;font-family:inherit;}
.palette-search input::placeholder{color:var(--text3);}
.palette-esc{position:static;width:auto;height:auto;padding:4px 7px;border-radius:6px;border:1px solid var(--border2);background:none;color:var(--text3);font:600 11.5px inherit;font-family:inherit;cursor:pointer;}
.palette-esc:hover{color:var(--text);}
.palette-list{max-height:min(380px,55vh);overflow-y:auto;padding:6px;overscroll-behavior:contain;}
.palette-group{padding:10px 10px 4px;font-size:12px;font-weight:600;color:var(--text3);}
.palette-item{width:100%;display:flex;align-items:center;gap:11px;padding:10px 10px;border-radius:var(--r-sm);background:none;border:0;color:var(--text);font:600 14.5px inherit;font-family:inherit;text-align:left;cursor:pointer;min-width:0;}
.palette-item svg{width:16px;height:16px;color:var(--text2);flex-shrink:0;}
.palette-item span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.palette-item small{margin-left:auto;padding-left:10px;font-size:12.5px;font-weight:500;color:var(--text3);white-space:nowrap;font-variant-numeric:tabular-nums;}
.palette-item.sel,.palette-item:hover{background:var(--surface3);}
.palette-item.sel svg{color:var(--accent);}
.palette-empty{padding:22px 12px;color:var(--text3);font-size:14px;text-align:center;}
.palette-foot{display:flex;gap:16px;padding:9px 16px;border-top:1px solid var(--border);font-size:12px;color:var(--text3);}
.palette-foot span{display:inline-flex;align-items:center;gap:5px;}
.palette-foot kbd{font:600 11px inherit;font-family:inherit;padding:2px 5px;border-radius:5px;border:1px solid var(--border2);color:var(--text2);}
@media (hover:none){.palette-foot{display:none;}}
.quick-action-btn:focus-visible,.lib-item:focus-visible,.lib-tool:focus-visible,.file-btn:focus-visible,.deck-card:focus-visible,.deck-action-btn:focus-visible,.lib-folder-del:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

/* Today: the daily review and exam plans. The main card of the Library. */
.today-card{position:relative;background:radial-gradient(70% 150% at 0% 0%,rgba(255,77,0,.16),transparent 62%),linear-gradient(180deg,#191715,var(--surface));border:1px solid var(--border2);border-radius:var(--r-2xl);margin:0 0 18px;overflow:hidden;box-shadow:var(--lift-2);}
.today-card[hidden]{display:none;}
.today-main{display:flex;align-items:center;gap:20px;padding:22px 22px 22px 24px;}
.today-ring{position:relative;width:72px;height:72px;flex-shrink:0;}
.today-ring svg{width:100%;height:100%;transform:rotate(-90deg);}
.today-ring circle{fill:none;stroke-width:5;}
.today-ring .track{stroke:rgba(255,255,255,.08);}
.today-ring .fill{stroke:var(--accent);stroke-linecap:round;transition:stroke-dashoffset .8s var(--ease);filter:drop-shadow(0 0 6px rgba(255,77,0,.45));}
.today-ring-text{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;}
.today-ring-text b{font-size:23px;font-weight:800;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;}
.today-ring-text svg{width:26px;height:26px;color:var(--accent);stroke-width:3;transform:none;}
.today-card.caught-up .today-ring .fill{stroke:var(--success);filter:drop-shadow(0 0 6px rgba(74,222,128,.4));}
.today-card.caught-up .today-ring-text svg{color:var(--success);}
.today-text{flex:1;min-width:0;}
.today-kicker{display:flex;align-items:center;gap:6px;font-size:13.5px;font-weight:700;color:var(--accent);margin-bottom:4px;}
.today-kicker svg{width:14px;height:14px;}
.today-title{font-size:clamp(21px,2.4vw,26px);font-weight:800;letter-spacing:-0.025em;line-height:1.15;}
.today-sub{font-size:14.5px;color:var(--text2);line-height:1.5;margin-top:4px;}
.today-actions{display:flex;gap:8px;flex-shrink:0;}
.today-start,.today-more{display:inline-flex;align-items:center;gap:9px;height:48px;padding:0 22px;border-radius:var(--r-md);font-family:inherit;font-size:15.5px;font-weight:700;cursor:pointer;white-space:nowrap;transition:background .2s,border-color .2s,transform .2s var(--ease);}
.today-start{background:var(--accent);border:none;color:#fff;box-shadow:var(--flame-shadow);}
.today-start svg{width:15px;height:15px;fill:#fff;}
.today-start:hover{background:var(--accent-hover);}
.today-more{background:var(--surface2);border:1px solid var(--border2);color:var(--text);font-weight:600;}
.today-more svg{width:16px;height:16px;color:var(--accent);}
.today-more:hover{border-color:var(--accent);}
.today-start:active,.today-more:active{transform:scale(.97);}
.today-exams{border-top:1px solid var(--hairline);display:flex;flex-direction:column;background:rgba(10,10,10,.28);}
.today-exams:empty{display:none;}
.exam-row{display:flex;align-items:center;gap:14px;width:100%;padding:14px 16px 14px 24px;border:none;border-bottom:1px solid var(--hairline);background:none;color:var(--text);font-family:inherit;text-align:left;min-width:0;}
.exam-row:last-child{border-bottom:none;}
.exam-row.past{opacity:.7;}
button.exam-row{cursor:pointer;transition:background .15s;}
button.exam-row:hover{background:rgba(255,255,255,.03);}
.exam-icon{width:38px;height:38px;border-radius:11px;background:var(--accent-dim);color:var(--accent);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.exam-icon svg{width:17px;height:17px;}
.exam-info{flex:1;min-width:0;display:flex;flex-direction:column;}
.exam-info b{font-size:15.5px;font-weight:700;letter-spacing:-0.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.exam-info small{font-size:13px;color:var(--text2);margin-top:1px;line-height:1.45;}
.exam-when{color:var(--text);font-weight:600;margin-left:6px;}
.exam-when.soon{color:var(--accent);}
.exam-progress{display:block;height:5px;max-width:260px;border-radius:99px;background:rgba(255,255,255,.08);overflow:hidden;margin-top:7px;}
.exam-progress i{display:block;height:100%;background:linear-gradient(90deg,var(--ember),var(--accent));border-radius:99px;}
.exam-count{font-variant-numeric:tabular-nums;}
.exam-today{font-size:13px;font-weight:700;color:var(--text2);background:var(--surface2);border:1px solid var(--border);border-radius:99px;padding:4px 11px;white-space:nowrap;flex-shrink:0;}
.exam-btn{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 14px;border-radius:var(--r-sm);border:1px solid var(--border2);background:var(--surface2);color:var(--text);font-family:inherit;font-size:13.5px;font-weight:600;cursor:pointer;white-space:nowrap;flex-shrink:0;transition:border-color .15s,background .15s,transform .2s var(--ease);}
.exam-btn svg{width:15px;height:15px;color:var(--accent);}
.exam-btn:hover{border-color:var(--accent);}
.exam-btn:active{transform:scale(.97);}
.exam-btn.flame{background:var(--accent);border-color:var(--accent);color:#fff;}
.exam-btn.flame svg{color:#fff;}
.exam-btn.flame:hover{background:var(--accent-hover);}
.exam-edit{width:38px;height:38px;border-radius:var(--r-sm);border:none;background:none;color:var(--text3);display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:color .15s,background .15s;}
.exam-edit svg{width:15px;height:15px;}
.exam-edit:hover{color:var(--text);background:var(--surface3);}
.exam-add{display:flex;align-items:center;gap:8px;width:100%;min-height:46px;padding:12px 24px;border:none;background:none;color:var(--text2);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;text-align:left;transition:color .15s,background .15s;}
.exam-add svg{width:15px;height:15px;color:var(--accent);}
.exam-add:hover{color:var(--text);background:rgba(255,255,255,.03);}
.exam-add .lib-pro,.exam-btn .lib-pro{margin-left:2px;}
.exam-btn.exam-paused{color:var(--text2);}
.exam-row:focus-visible,.exam-btn:focus-visible,.exam-edit:focus-visible,.exam-add:focus-visible,.today-start:focus-visible,.today-more:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;}
.exam-box{max-width:480px;}
.exam-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;}
.exam-field > span{font-size:13px;font-weight:700;color:var(--text2);}
.exam-field .auth-input{width:100%;box-sizing:border-box;}
.exam-field input[type="date"]{color-scheme:dark;}
.exam-decks{display:flex;flex-direction:column;gap:6px;max-height:min(36vh,280px);overflow-y:auto;overscroll-behavior:contain;}
.exam-deck .file-info{flex:1;min-width:0;}
.exam-deck .file-name,.exam-deck .file-meta{display:block;}
.exam-deck .file-meta{margin-top:1px;}
.exam-preview{display:flex;align-items:flex-start;gap:9px;font-size:13.5px;line-height:1.5;color:var(--text2);background:var(--accent-dim);border:1px solid rgba(255,77,0,.22);border-radius:12px;padding:10px 12px;margin-bottom:12px;}
.exam-preview[hidden]{display:none;}
.exam-preview svg{width:16px;height:16px;color:var(--accent);flex-shrink:0;margin-top:2px;}
.exam-msg{font-size:13px;color:var(--danger);min-height:0;margin-bottom:6px;}
.exam-msg:empty{display:none;}
.exam-actions{display:flex;align-items:center;gap:10px;}
.exam-actions .btn-save{flex:1;}
.exam-delete{display:inline-flex;align-items:center;gap:6px;height:48px;padding:0 14px;border-radius:var(--r-md);border:1px solid var(--border);background:none;color:var(--text2);font-family:inherit;font-size:13.5px;font-weight:600;cursor:pointer;}
.exam-delete[hidden]{display:none;}
.exam-delete svg{width:15px;height:15px;}
.exam-delete:hover{color:var(--danger);border-color:rgba(248,113,113,.4);}
@media(max-width:640px){
  .today-main{flex-wrap:wrap;gap:14px;padding:18px 16px;}
  .today-ring{width:60px;height:60px;}
  .today-text{flex:1 1 calc(100% - 76px);}
  .today-actions{flex:1 1 100%;}
  .today-start,.today-more{flex:1;justify-content:center;}
  .exam-row{flex-wrap:wrap;padding:13px 12px 13px 16px;row-gap:8px;}
  .exam-info{flex:1 1 calc(100% - 100px);}
  .exam-row > .exam-btn,.exam-row > .exam-today{margin-left:52px;}
  .exam-add{padding:12px 16px;}
}

/* Library: a sidebar (kinds, Your files, folders) next to the decks */
.library{display:grid;grid-template-columns:212px minmax(0,1fr);gap:36px;margin-bottom:56px;align-items:start;}
.lib-side{position:sticky;top:calc(var(--header-h) + 24px);display:flex;flex-direction:column;gap:2px;}
.lib-side-title{font-size:12.5px;font-weight:700;color:var(--text3);padding:0 12px;margin-bottom:6px;}
.lib-side-title.lib-folders-title{margin-top:20px;}
.kind-filter{display:flex;flex-direction:column;gap:2px;}
.kind-filter:not(.show) [data-kind="cards"],.kind-filter:not(.show) [data-kind="quiz"]{display:none;}
.lib-item{display:flex;align-items:center;gap:10px;width:100%;height:40px;padding:0 10px 0 12px;border-radius:var(--r-sm);border:1px solid transparent;background:none;color:var(--text2);font-family:inherit;font-size:14.5px;font-weight:600;text-align:left;cursor:pointer;transition:background .15s,color .15s,border-color .15s;}
.lib-item svg{width:16px;height:16px;flex-shrink:0;}
.lib-item span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.lib-item b{font-size:12.5px;font-weight:600;color:var(--text3);font-variant-numeric:tabular-nums;transition:opacity .15s;}
.lib-item:hover{background:var(--surface);color:var(--text);}
.lib-item[aria-pressed="true"],.lib-item.active{background:var(--surface2);border-color:var(--border);color:var(--text);box-shadow:var(--lift-1);}
.lib-item[aria-pressed="true"] svg,.lib-item.active svg{color:var(--accent);}
.lib-locked{color:var(--text3);}
.lib-pro{font-style:normal;font-size:11.5px;font-weight:700;color:var(--accent);background:var(--accent-dim);border-radius:6px;padding:1px 7px;}
.folder-tabs{display:flex;flex-direction:column;gap:2px;}
.lib-folder{position:relative;display:flex;}
.lib-folder .lib-item{padding-right:38px;}
.lib-folder-del{position:absolute;right:5px;top:50%;transform:translateY(-50%);width:28px;height:28px;border-radius:8px;border:none;background:none;color:var(--text3);display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .15s,color .15s,background .15s;}
.lib-folder-del svg{width:14px;height:14px;}
.lib-folder:hover .lib-folder-del,.lib-folder-del:focus-visible{opacity:1;}
.lib-folder:hover .lib-item b{opacity:0;}
.lib-folder-del:hover{color:var(--danger);background:rgba(248,113,113,.1);}
.lib-new{color:var(--text3);}
.lib-new:hover svg{color:var(--accent);}

.lib-main{min-width:0;}
.decks-header{display:flex;align-items:center;justify-content:space-between;gap:12px 16px;flex-wrap:wrap;margin-bottom:20px;min-height:42px;}
.decks-heading{display:flex;align-items:baseline;gap:10px;min-width:0;}
.decks-title{font-size:28px;font-weight:800;letter-spacing:-0.03em;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.decks-count{font-size:16px;font-weight:600;color:var(--text3);font-variant-numeric:tabular-nums;}
.decks-header-right{display:flex;gap:8px;align-items:center;}
.lib-search{display:flex;align-items:center;gap:8px;height:42px;width:210px;padding:0 12px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--border);color:var(--text3);cursor:text;transition:border-color .15s,width .25s var(--ease),box-shadow .2s;}
.lib-search:focus-within{border-color:var(--accent);width:250px;color:var(--text2);box-shadow:0 0 0 3px rgba(255,77,0,.16);}
.lib-search[hidden]{display:none;}
.lib-search svg{width:15px;height:15px;flex-shrink:0;}
.lib-search input{flex:1;min-width:0;height:100%;background:none;border:none;outline:none;color:var(--text);font-family:inherit;font-size:14.5px;}
.lib-search input::placeholder{color:var(--text3);}
.lib-search input::-webkit-search-cancel-button{-webkit-appearance:none;}
.lib-tool{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:42px;padding:0 15px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--border);color:var(--text);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;white-space:nowrap;transition:border-color .15s,background .15s;}
.lib-tool svg{width:15px;height:15px;color:var(--text2);flex-shrink:0;}
.lib-tool:hover{border-color:var(--border2);background:var(--surface2);}
.lib-tool[hidden]{display:none !important;}
.lib-tool-flame{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:var(--flame-shadow);}
.lib-tool-flame svg{color:#fff;}
.lib-tool-flame:hover{background:var(--accent-hover);border-color:var(--accent-hover);}
.lib-tool:disabled{opacity:.5;cursor:not-allowed;}

/* Deck tiles: a little stack of cards. Hovering one shows the ember and cinder cards of the logo. */
.decks-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:26px 16px;padding-bottom:8px;}
.decks-grid[hidden]{display:none;}
.deck-card{
  position:relative;display:flex;flex-direction:column;min-height:158px;min-width:0;
  padding:15px 15px 16px 18px;border-radius:var(--r-lg);background:linear-gradient(180deg,#191716,var(--surface));border:1px solid var(--border);cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 6px 0 -3px #1a1817,0 6px 0 -2px var(--border),0 12px 0 -6px #121110,0 12px 0 -5px #221f1d;
  transition:transform .3s var(--ease),box-shadow .3s var(--ease),border-color .2s,background .2s;
  animation:deckFade .35s ease forwards;opacity:0;
}
.deck-card:hover{transform:translateY(-4px);border-color:var(--border2);background:linear-gradient(180deg,#211e1d,var(--surface2));box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 7px 0 -3px #b83a00,0 14px 0 -6px #7a2500,0 26px 40px -24px rgba(255,77,0,.35);}
.deck-card:active{transform:translateY(-1px);}
@keyframes deckFade{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}
.deck-top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:30px;margin-bottom:10px;}
.deck-kind{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:var(--text2);white-space:nowrap;}
.deck-kind svg{width:14px;height:14px;color:var(--accent);}
.deck-name{font-size:17.5px;font-weight:700;letter-spacing:-0.02em;line-height:1.26;color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;}
.deck-meta{margin-top:auto;padding-top:14px;display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;font-size:13px;color:var(--text3);font-variant-numeric:tabular-nums;min-width:0;}
.deck-progress{display:flex;gap:2px;height:5px;margin-top:auto;flex-shrink:0;border-radius:5px;overflow:hidden;}
.deck-name:has(+ .deck-progress){margin-bottom:12px;}
.deck-progress i{display:block;height:100%;min-width:3px;}
.dp-easy{background:var(--success);}
.dp-medium{background:#facc15;}
.dp-hard{background:var(--danger);}
.dp-none{background:var(--border2);}
.deck-progress + .deck-meta{margin-top:0;padding-top:10px;}
.deck-meta .deck-due{color:var(--accent);font-weight:700;}
.deck-meta .deck-score{color:var(--text2);font-weight:600;}
.deck-folder{display:inline-flex;align-items:center;gap:5px;color:var(--text2);font-weight:600;min-width:0;max-width:100%;}
.deck-folder svg{width:13px;height:13px;color:var(--accent);flex-shrink:0;}
.deck-folder span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.deck-note-flag,.deck-file-flag{display:inline-flex;align-items:center;gap:3px;color:var(--text3);}
.deck-note-flag svg,.deck-file-flag svg{width:14px;height:14px;}
.deck-actions-row{display:flex;align-items:center;gap:1px;margin-right:-6px;opacity:0;transition:opacity .15s;}
.deck-card:hover .deck-actions-row,.deck-card:focus-within .deck-actions-row,.deck-card.tour-reveal .deck-actions-row{opacity:1;}
.deck-action-btn{width:32px;height:32px;border:none;border-radius:8px;background:none;color:var(--text3);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:color .15s,background .15s;}
.deck-action-btn svg{width:15px;height:15px;}
.deck-action-btn:hover{color:var(--text);background:var(--surface3);}
.deck-action-btn.danger:hover{color:var(--danger);background:rgba(248,113,113,.1);}
/* Phones and tablets have no hover, so the deck icons stay visible there. */
@media (hover: none){ .deck-actions-row{opacity:1;} .deck-action-btn{color:var(--text2);} }
.lib-more{grid-column:1/-1;display:flex;justify-content:center;margin-top:2px;}
.lib-more button{height:42px;padding:0 20px;border-radius:99px;border:1px solid var(--border);background:none;color:var(--text2);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:border-color .15s,color .15s;}
.lib-more button:hover{border-color:var(--border2);color:var(--text);}
.lib-empty{grid-column:1/-1;padding:34px 24px;border:1.5px dashed var(--border2);border-radius:18px;text-align:center;color:var(--text2);font-size:14.5px;line-height:1.6;}
.lib-empty b{color:var(--text);font-weight:700;}
.lib-empty small{display:block;color:var(--text3);font-size:13px;margin-top:4px;}

/* Your files: PDFs kept in Cardly */
.files-panel{position:relative;}
.files-panel[hidden]{display:none;}
.files-meter{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:14px 16px 15px;margin-bottom:14px;box-shadow:var(--lift-1);}
.files-meter[hidden]{display:none;}
.files-meter-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;font-size:14px;color:var(--text);font-weight:600;margin-bottom:9px;font-variant-numeric:tabular-nums;}
.files-meter-note{font-size:13px;color:var(--text3);font-weight:500;}
.files-meter-note button{background:none;border:none;padding:0;font:inherit;font-weight:700;color:var(--accent);cursor:pointer;}
.files-list{display:flex;flex-direction:column;gap:8px;}
.file-row{display:flex;align-items:center;gap:14px;padding:12px 10px 12px 14px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--border);min-width:0;transition:border-color .15s,background .15s;animation:deckFade .3s ease forwards;opacity:0;}
.file-row:hover{border-color:var(--border2);background:var(--surface2);}
.file-row.uploading{border-style:dashed;}
.file-row.failed{border-color:rgba(248,113,113,.35);}
.file-icon{position:relative;flex-shrink:0;width:34px;height:42px;border-radius:5px 10px 5px 5px;background-color:#f7f3ec;
  background-image:linear-gradient(#d2c9bb,#d2c9bb),linear-gradient(#d2c9bb,#d2c9bb),linear-gradient(#d2c9bb,#d2c9bb);
  background-size:18px 2px,18px 2px,11px 2px;background-position:8px 9px,8px 14px,8px 19px;background-repeat:no-repeat;}
.file-icon b{position:absolute;left:4px;right:4px;bottom:5px;text-align:center;font-size:8.5px;font-weight:800;letter-spacing:.04em;color:#fff;background:var(--accent);border-radius:3px;line-height:13px;}
.file-icon .material-spin{position:absolute;left:10px;top:13px;}
.file-info{flex:1;min-width:0;}
.file-name{font-size:15px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-0.01em;}
.file-meta{font-size:13px;color:var(--text3);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums;}
.file-row.failed .file-meta{color:var(--danger);white-space:normal;}
.file-progress{height:4px;border-radius:99px;background:var(--surface3);overflow:hidden;margin-top:8px;}
.file-progress i{display:block;height:100%;width:0;background:var(--accent);border-radius:99px;transition:width .2s;}
.file-actions{display:flex;align-items:center;gap:2px;flex-shrink:0;}
.file-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;min-width:36px;padding:0 8px;border-radius:9px;border:1px solid transparent;background:none;color:var(--text2);font-family:inherit;font-size:13.5px;font-weight:600;cursor:pointer;white-space:nowrap;transition:color .15s,background .15s,border-color .15s;}
.file-btn svg{width:16px;height:16px;flex-shrink:0;}
.file-btn:hover{color:var(--text);background:var(--surface3);}
.file-btn.use{border-color:var(--border2);color:var(--text);padding:0 12px;margin-right:4px;}
.file-btn.use svg{color:var(--accent);}
.file-btn.use:hover{border-color:var(--accent);background:var(--accent-dim);}
.file-btn.danger:hover{color:var(--danger);background:rgba(248,113,113,.1);}
.file-btn:disabled{opacity:.45;cursor:default;}
.files-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:42px 24px 40px;border:1.5px dashed var(--border2);border-radius:var(--r-xl);}
.files-empty-art{position:relative;width:96px;height:72px;}
.files-empty-art .file-icon{position:absolute;top:8px;width:44px;height:56px;box-shadow:0 14px 28px -14px rgba(0,0,0,.8);background-size:24px 2px,24px 2px,15px 2px;background-position:10px 12px,10px 18px,10px 24px;}
.files-empty-art .file-icon:nth-child(1){left:2px;transform:rotate(-9deg);opacity:.75;}
.files-empty-art .file-icon:nth-child(2){left:50px;transform:rotate(8deg);opacity:.75;}
.files-empty-art .file-icon:nth-child(3){left:26px;top:2px;}
.files-empty-art .file-icon b{font-size:10px;line-height:15px;bottom:7px;}
.files-empty-art .file-icon:nth-child(-n+2) b{visibility:hidden;}
.files-empty h3{font-size:22px;font-weight:800;letter-spacing:-0.02em;line-height:1.15;margin:18px 0 8px;}
.files-empty p{font-size:14.5px;color:var(--text2);line-height:1.6;max-width:440px;}
.files-empty .lib-tool{margin-top:20px;height:46px;padding:0 20px;font-size:15px;border-radius:12px;}
.files-empty small{display:block;margin-top:10px;font-size:13px;color:var(--text3);}
.files-note{padding:16px 18px;border-radius:14px;background:var(--surface);border:1px solid var(--border);color:var(--text2);font-size:14px;line-height:1.6;}
.files-drop-note{display:none;position:absolute;inset:-8px;z-index:3;align-items:center;justify-content:center;gap:10px;border-radius:20px;border:2px dashed var(--accent);background:rgba(10,10,10,.86);color:var(--accent);font-size:15px;font-weight:700;pointer-events:none;}
.files-drop-note svg{width:20px;height:20px;}
.files-panel.drag-over .files-drop-note{display:flex;}

/* Generator: keep new PDFs in Your files, or start from saved ones */
.keep-files{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-top:1px solid var(--border);cursor:pointer;position:relative;}
.keep-files[hidden]{display:none;}
.cbox-input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none;}
.keep-files input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none;}
.keep-files-box,.pick-box{width:18px;height:18px;border-radius:5px;border:1.5px solid var(--border2);background:var(--surface);display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px;transition:background .15s,border-color .15s;}
.keep-files-box svg,.pick-box svg{width:12px;height:12px;stroke-width:3;color:#fff;opacity:0;}
.keep-files input:checked + .keep-files-box,.pick-row input:checked + .pick-box{background:var(--accent);border-color:var(--accent);}
.keep-files input:checked + .keep-files-box svg,.pick-row input:checked + .pick-box svg{opacity:1;}
.keep-files input:focus-visible + .keep-files-box,.pick-row input:focus-visible + .pick-box{outline:2px solid var(--accent);outline-offset:2px;}
.keep-files.off{cursor:default;}
.keep-files.off .keep-files-box{opacity:.5;}
.keep-files-text{min-width:0;}
.keep-files-text b{display:block;font-size:13.5px;font-weight:600;color:var(--text);}
.keep-files-text small{display:block;font-size:12.5px;color:var(--text3);margin-top:2px;line-height:1.45;}
.keep-files-text small button{background:none;border:none;padding:0;font:inherit;font-weight:700;color:var(--accent);cursor:pointer;}
.material-add[hidden]{display:none;}
.material-add:disabled{opacity:.5;cursor:not-allowed;}
.material-add:disabled:hover{border-color:var(--border2);color:var(--text);}
.file-picker-box{max-width:480px;}
#filePickerAdd:disabled{opacity:.45;cursor:not-allowed;box-shadow:none;}
.file-picker-list{display:flex;flex-direction:column;gap:6px;max-height:min(52vh,420px);overflow-y:auto;margin:-8px 0 16px;overscroll-behavior:contain;}
.pick-row{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;border:1px solid var(--border);background:var(--surface2);cursor:pointer;position:relative;transition:border-color .15s;}
.pick-row:hover{border-color:var(--border2);}
.pick-row input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none;}
.pick-row .file-icon{width:28px;height:35px;background-size:15px 2px,15px 2px,9px 2px;background-position:6px 8px,6px 12px,6px 16px;}
.pick-row .file-icon b{font-size:7px;line-height:11px;bottom:4px;left:3px;right:3px;}
.pick-row.taken,.pick-row.off{opacity:.5;cursor:default;}
.pick-row .file-name{font-size:14px;}
.pick-row .file-meta{font-size:12.5px;margin-top:1px;}
.pick-empty{padding:22px;text-align:center;color:var(--text2);font-size:14px;border:1.5px dashed var(--border2);border-radius:14px;}
.preview-files{margin:0 0 16px;}
.preview-files[hidden]{display:none;}
.preview-files-label{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:700;color:var(--text2);margin-bottom:8px;}
.preview-files-label svg{width:13px;height:13px;}
.preview-file-chips{display:flex;flex-wrap:wrap;gap:6px;}
.preview-file-chip{display:inline-flex;align-items:center;gap:7px;max-width:100%;height:34px;padding:0 11px 0 9px;border-radius:9px;background:var(--surface2);border:1px solid var(--border);color:var(--text);font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:border-color .15s;}
.preview-file-chip svg{width:14px;height:14px;color:var(--accent);flex-shrink:0;}
.preview-file-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.preview-file-chip:hover{border-color:var(--border2);}

/* First visit: no decks yet */
.app-empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;background:radial-gradient(80% 90% at 50% 0%,rgba(255,77,0,.1),transparent 60%),var(--surface);border:1px solid var(--border);border-radius:var(--r-2xl);padding:52px 28px 36px;margin-bottom:48px;box-shadow:var(--lift-2);}
.app-empty-art{position:relative;width:78px;height:58px;margin-bottom:24px;}
.app-empty-art i{position:absolute;width:62px;height:42px;border-radius:10px;}
.app-empty-art i:nth-child(1){left:16px;top:16px;background:#7a2500;}
.app-empty-art i:nth-child(2){left:8px;top:8px;background:#b83a00;}
.app-empty-art i:nth-child(3){left:0;top:0;background-color:var(--accent);background-image:linear-gradient(rgba(255,255,255,.4),rgba(255,255,255,.4)),linear-gradient(rgba(255,255,255,.9),rgba(255,255,255,.9)),linear-gradient(rgba(255,255,255,.9),rgba(255,255,255,.9));background-size:34px 3px,34px 3px,18px 3px;background-position:11px 11px,11px 19px,11px 27px;background-repeat:no-repeat;}
.app-empty-title{font-size:clamp(28px,3.2vw,38px);font-weight:800;letter-spacing:-0.03em;line-height:1.05;}
.app-empty-sub{font-size:16px;color:var(--text2);max-width:440px;line-height:1.6;margin-top:12px;}
.app-empty-steps{list-style:none;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;width:100%;max-width:600px;margin:28px 0 26px;padding:0;}
.app-empty-steps li{display:flex;flex-direction:column;align-items:center;gap:3px;padding:16px 10px;border-radius:14px;background:var(--surface2);border:1px solid var(--border);}
.app-empty-steps span{width:26px;height:26px;border-radius:50%;background:var(--accent);color:#fff;font-size:13px;font-weight:800;display:flex;align-items:center;justify-content:center;margin-bottom:6px;}
.app-empty-steps b{font-size:14.5px;font-weight:700;color:var(--text);}
.app-empty-steps small{font-size:13px;color:var(--text3);line-height:1.4;}
.btn-start-now{display:inline-flex;align-items:center;gap:8px;height:50px;padding:0 24px;border-radius:var(--r-md);border:none;background:var(--accent);color:#fff;font-family:inherit;font-size:16px;font-weight:700;cursor:pointer;box-shadow:var(--flame-shadow);transition:background .2s,transform .2s var(--ease);}
.btn-start-now svg{width:18px;height:18px;transition:transform .2s var(--ease);}
.btn-start-now:hover{background:var(--accent-hover);}
.btn-start-now:hover svg{transform:translateX(3px);}
.btn-start-now:active{transform:scale(.98);}
.app-empty-links{display:flex;flex-direction:column;align-items:center;gap:2px;margin-top:16px;}
.app-empty-import{background:none;border:none;color:var(--text2);font-family:inherit;font-size:14px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border-radius:8px;transition:color .15s;}
.app-empty-import svg{width:15px;height:15px;}
.app-empty-import:hover{color:var(--accent);}

/* Generate: the heading and the write-it-yourself button */
.gen-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px 20px;flex-wrap:wrap;margin-bottom:22px;}
.gen-head-text{min-width:0;}
.gen-head .gen-title{margin-bottom:0;}
.gen-sub{font-size:16.5px;color:var(--text2);line-height:1.5;margin-top:10px;}
.btn-write-deck{display:inline-flex;align-items:center;gap:8px;height:42px;padding:0 15px;background:var(--surface);border:1px solid var(--border);color:var(--text);border-radius:var(--r-md);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;box-shadow:var(--lift-1);transition:border-color .15s,background .15s;}
.btn-write-deck svg{width:15px;height:15px;color:var(--text2);}
.btn-write-deck:hover{border-color:var(--border2);background:var(--surface2);color:var(--text);}
.btn-write-deck:hover svg{color:var(--accent);}

/* Pro, for free accounts */
.pro-upsell{border:1px solid var(--border);border-radius:var(--r-2xl);overflow:hidden;margin-bottom:24px;background:var(--surface);box-shadow:var(--lift-2);}
.pro-upsell-header{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;flex-wrap:wrap;padding:30px 28px 28px;background:radial-gradient(120% 160% at 100% 0%,rgba(255,77,0,.2),transparent 55%),var(--surface);border-bottom:1px solid var(--border);}
.pro-upsell-kicker{display:inline-flex;align-items:center;gap:6px;font-size:13.5px;font-weight:700;color:var(--accent);margin-bottom:10px;}
.pro-upsell-kicker svg{width:15px;height:15px;}
.pro-upsell-title{font-size:clamp(26px,3vw,36px);font-weight:800;letter-spacing:-0.03em;line-height:1;}
.pro-upsell-sub{font-size:15px;color:var(--text2);margin-top:10px;}
.pro-upsell-header .btn-header-cta{height:46px;padding:0 22px;border-radius:var(--r-md);font-size:15px;}
.pro-upsell-header .btn-header-cta:hover{background:var(--accent-hover);transform:none;}
/* Eight items: four across, two across on tablets, one on phones, so every row is full. */
/* Monthly or yearly: the homepage pricing and the Pro panel (one switch style for both). */
.billing-switch{display:inline-flex;gap:4px;padding:4px;border-radius:var(--r-md);background:var(--bg);border:1px solid var(--border2);}
.billing-switch button{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 16px;border:0;border-radius:9px;background:transparent;color:var(--text2);font:inherit;font-size:14.5px;font-weight:600;cursor:pointer;}
.billing-switch button[aria-checked="true"]{background:var(--surface3);color:var(--text);box-shadow:0 0 0 1px var(--border2) inset;}
.billing-switch button:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.billing-save{font-size:12px;font-weight:700;color:var(--accent);background:var(--accent-dim);border-radius:6px;padding:2px 7px;}
.pro-upsell-buy{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
/* The plan chooser (#planModal): two rows to pick from, then Stripe. */
.plan-box{max-width:440px;}
.plan-box .pro-upsell-kicker{margin-bottom:8px;}
.plan-box .modal-title{font-size:22px;}
.plan-box .modal-sub{margin-bottom:18px;}
.plan-options{display:flex;flex-direction:column;gap:10px;margin-bottom:6px;}
.plan-option{display:grid;grid-template-columns:20px 1fr auto;column-gap:12px;row-gap:3px;align-items:center;width:100%;padding:14px 16px;border-radius:14px;border:1px solid var(--border2);background:var(--bg);color:var(--text);font:inherit;text-align:left;cursor:pointer;transition:border-color .15s,background .15s;}
.plan-option:hover{border-color:var(--text3);}
.plan-option[aria-checked="true"]{border-color:var(--accent);background:linear-gradient(180deg,rgba(255,77,0,.08),rgba(255,77,0,0)),var(--bg);}
.plan-option:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.plan-radio{grid-row:1/3;width:18px;height:18px;border-radius:50%;border:2px solid var(--border2);transition:border .15s;}
.plan-option[aria-checked="true"] .plan-radio{border:5px solid var(--accent);}
.plan-name{font-size:15.5px;font-weight:700;display:flex;align-items:center;gap:8px;}
.plan-price{font-size:13.5px;color:var(--text2);white-space:nowrap;}
.plan-price b{font-size:20px;font-weight:800;color:var(--text);letter-spacing:-0.02em;}
.plan-note{grid-column:2/4;font-size:13px;color:var(--text2);}
.plan-fine{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:12px;font-size:12.5px;color:var(--text3);}
.plan-fine svg{width:13px;height:13px;}
.pro-upsell-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:var(--border);}
.pro-upsell-item{display:flex;align-items:flex-start;gap:12px;padding:20px 20px;background:var(--surface);transition:background .2s;}
.pro-upsell-item:hover{background:var(--surface2);}
.pro-upsell-lock{width:36px;height:36px;border-radius:10px;background:var(--accent-dim);color:var(--accent);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.pro-upsell-lock svg{width:16px;height:16px;}
.pro-upsell-item-title{font-size:14.5px;font-weight:700;margin-bottom:3px;letter-spacing:-0.01em;}
.pro-upsell-item-desc{font-size:13.5px;color:var(--text2);line-height:1.5;}
.pro-upsell.flash{animation:upsellFlash 1.6s ease;}
@keyframes upsellFlash{0%,100%{border-color:var(--border);}25%,60%{border-color:var(--accent);}}

@media(max-width:1000px){
  .pro-upsell-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:900px){
  .library{grid-template-columns:minmax(0,1fr);gap:14px;}
  .lib-side{position:static;flex-direction:row;align-items:center;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:2px 16px 6px;}
  .lib-side::-webkit-scrollbar{display:none;}
  .lib-side-title{display:none;}
  .kind-filter,.folder-tabs{flex-direction:row;gap:6px;flex-shrink:0;}
  .folder-tabs::before{content:'';width:1px;height:22px;background:var(--border2);align-self:center;margin:0 4px 0 2px;flex-shrink:0;}
  .lib-folder{flex-shrink:0;}
  .lib-item{width:auto;flex-shrink:0;height:38px;border-radius:99px;border-color:var(--border);background:var(--surface);padding:0 14px 0 12px;box-shadow:none;}
  .lib-item span{overflow:visible;}
  .lib-item:hover{background:var(--surface2);}
  .lib-item[aria-pressed="true"],.lib-item.active{background:var(--text);border-color:var(--text);color:#151413;}
  .lib-item[aria-pressed="true"] b,.lib-item.active b{color:#6b635a;}
  .lib-folder .lib-item{padding-right:14px;}
  .lib-folder.active .lib-item{padding-right:36px;}
  .lib-folder-del{display:none;}
  .lib-folder.active .lib-folder-del{display:flex;opacity:1;color:#6b635a;}
  .lib-folder.active .lib-folder-del:hover{background:rgba(0,0,0,.08);color:#c0392b;}
  .lib-folder:hover .lib-item b{opacity:1;}
  .lib-folder.active .lib-item b{display:none;}
  .lib-locked{display:none;}
}
@media(max-width:768px){
  .app{padding:26px 16px 40px;}
  .dash-head{margin-bottom:20px;}
  .usage-card{flex:1 1 100%;}
  .quick-actions{margin:0 -16px 32px;padding:2px 16px;}
  .decks-title{font-size:24px;}
  .decks-header-right{flex:1 1 100%;}
  .decks-header-right:has(> .lib-search[hidden]){flex:0 0 auto;}
  .lib-search,.lib-search:focus-within{flex:1;width:auto;}
  .pro-upsell-header{padding:22px 20px;}
  .app-empty-state{padding:36px 18px 26px;}
  .gen-head{margin-bottom:16px;}
  .gen-sub{font-size:15px;margin-top:6px;}
}
@media(max-width:560px){
  .decks-grid{grid-template-columns:minmax(0,1fr);gap:20px;}
  .deck-card{min-height:0;}
  .deck-name{font-size:17px;}
  .file-row{flex-wrap:wrap;row-gap:6px;padding:12px 10px 10px 12px;}
  .file-actions{flex-basis:100%;padding-left:46px;}
  .file-btn.use{margin-right:auto;}
  .pro-upsell-grid{grid-template-columns:minmax(0,1fr);}
  .app-empty-steps{grid-template-columns:minmax(0,1fr);gap:8px;}
  .app-empty-steps li{flex-direction:row;gap:12px;text-align:left;padding:12px 14px;}
  .app-empty-steps span{margin:0;flex-shrink:0;}
  .app-empty-steps small{margin-left:auto;text-align:right;}
}
@media (prefers-reduced-motion: reduce){
  .deck-card,.file-row{animation:none;opacity:1;}
  .deck-card:hover{transform:none;}
  #appView[data-tab] .app-pane,.qa-menu{animation:none;}
}

/* RESPONSIVE */

@media(max-width:768px){
  .generator{grid-template-columns:1fr;}
  .panel:first-child{border-right:none;border-bottom:1px solid var(--border);}
  .panel:last-child{border-top:none;}
  .study-view{padding:22px 16px 48px;}
  .legal-view{padding:40px 20px 80px;}
  .app-footer{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px;padding:16px 0 24px;}
  .app-footer-left{flex-wrap:wrap;gap:8px;}
  .app-footer-links{gap:10px;}
  /* prevent zoom issues */
  input,textarea,select{font-size:16px !important;}
}

.exam-count .exam-today{background:none;border:0;padding:0;font-size:inherit;color:var(--accent);font-weight:700;}

/* Phones: what you tap is at least 44 px (the rest of this rule is at the end of app.css; these live here because
   this file loads after it). */
@media(max-width:768px){
  .btn-write-deck,.lib-tool,.lib-search,.lib-search:focus-within{height:44px;}
  .exam-btn{height:44px;}
  .exam-edit{width:44px;height:44px;}
}
/* Deck tile icons: 44 px only when the tiles are one column wide; two columns have no room for four of them. */
@media(max-width:560px){
  .deck-action-btn{width:44px;height:44px;}
  .deck-actions-row{margin-right:-10px;}
}
