/* Cardfolio progressive disclosure foundation. Loaded last on every first-party page. */
:root{
  --pf-canvas:#f5f6f4;--pf-surface:#ffffff;--pf-surface-soft:#eef1ed;
  --pf-ink:#20251f;--pf-muted:#7e887d;--pf-quiet:#a3aba2;
  --pf-green:#3e8f6c;--pf-green-soft:#e3f1ea;--pf-blue:#426ed8;--pf-blue-soft:#eaf0ff;
  --pf-warn:#a47743;--pf-danger:#ba655c;--pf-shadow:0 2px 8px rgba(31,42,34,.055),0 14px 28px rgba(31,42,34,.045);
  --pf-radius-card:20px;--pf-radius-control:13px;--pf-motion:180ms cubic-bezier(.22,.61,.36,1);
}
body.pf-shell{background:var(--pf-canvas);color:var(--pf-ink)}
.pf-shell :where(.pf-topbar,.rh-top,.qq-header,.r2-topbar,.sk5-header){position:relative;z-index:20}
.pf-topbar{display:flex;align-items:center;min-height:60px;gap:12px;color:var(--pf-ink)}
.pf-topbar-title{min-width:0;display:flex;align-items:baseline;gap:8px;font-weight:700;letter-spacing:-.025em}
.pf-topbar-title small{font-size:11px;color:var(--pf-muted);font-weight:500}
.pf-back,.pf-more-trigger{display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:0;border:0;border-radius:12px;background:var(--pf-surface);color:var(--pf-ink);box-shadow:var(--pf-shadow);font:inherit;cursor:pointer;transition:transform var(--pf-motion),background var(--pf-motion)}
.pf-back{font-size:27px;line-height:1;font-weight:300}
.pf-more-trigger{font-size:16px;letter-spacing:2px;margin-left:auto;color:var(--pf-muted)}
.pf-back:hover,.pf-more-trigger:hover{background:var(--pf-surface-soft)}
.pf-back:active,.pf-more-trigger:active{transform:scale(.96)}
.pf-more-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:80;min-width:184px;padding:6px;background:rgba(255,255,255,.94);border:0;border-radius:15px;box-shadow:0 10px 30px rgba(24,32,27,.15);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.pf-more-menu[hidden]{display:none}
.pf-more-menu button,.pf-more-menu a{display:flex;align-items:center;width:100%;min-height:42px;padding:0 12px;border:0;border-radius:10px;background:transparent;color:var(--pf-ink);font:inherit;text-decoration:none;text-align:left;cursor:pointer}
.pf-more-menu button:hover,.pf-more-menu a:hover{background:var(--pf-surface-soft)}
.pf-detail{display:grid;gap:12px;margin-top:4px;padding-bottom:calc(28px + env(safe-area-inset-bottom));animation:pf-detail-in var(--pf-motion) both}
.pf-detail-card{min-width:0;padding:18px;background:var(--pf-surface);border:0;border-radius:var(--pf-radius-card);box-shadow:var(--pf-shadow)}
.pf-detail-card h1,.pf-detail-card h2,.pf-detail-card h3{margin:0;letter-spacing:-.035em}
.pf-detail-card h1{font-size:24px;line-height:1.1}
.pf-detail-card h2{font-size:15px}
.pf-detail-card p{margin:6px 0 0;color:var(--pf-muted);font-size:13px;line-height:1.55}
.pf-reveal-group{overflow:hidden;background:var(--pf-surface);border:0;border-radius:16px;box-shadow:var(--pf-shadow)}
.pf-reveal-group>summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:0 14px;list-style:none;cursor:pointer;font-size:14px;font-weight:650}
.pf-reveal-group>summary::-webkit-details-marker{display:none}
.pf-reveal-group>summary::after{content:'＋';color:var(--pf-muted);font-size:18px;font-weight:300;transition:transform var(--pf-motion)}
.pf-reveal-group[open]>summary::after{content:'−'}
.pf-reveal-body{padding:0 14px 14px;animation:pf-reveal-in var(--pf-motion) both}
.pf-status{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 10px;border-radius:999px;background:var(--pf-green-soft);color:var(--pf-green);font-size:11px;font-weight:650}
.pf-status::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}
.pf-status.warn{background:#f7efe2;color:var(--pf-warn)}
.pf-status.danger{background:#faece9;color:var(--pf-danger)}
.pf-bottom-status{position:fixed;z-index:70;left:50%;bottom:calc(12px + env(safe-area-inset-bottom));transform:translate(-50%,8px);min-height:34px;padding:0 13px;border-radius:999px;background:rgba(33,39,34,.88);color:#fff;font-size:12px;opacity:0;pointer-events:none;transition:opacity var(--pf-motion),transform var(--pf-motion);backdrop-filter:blur(14px)}
.pf-bottom-status.is-visible{opacity:1;transform:translate(-50%,0)}
@keyframes pf-detail-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@keyframes pf-reveal-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media(min-width:700px){
  .pf-shell .pf-topbar{min-height:68px}
  .pf-detail{max-width:960px;margin-inline:auto}
  .pf-detail-card{padding:22px}
}
@media(prefers-reduced-motion:reduce){
  .pf-shell *, .pf-shell *::before, .pf-shell *::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

.pf-shell .pf-primary{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin-top:16px;padding:0 16px;border:0;border-radius:13px;background:var(--pf-blue);color:#fff;font:inherit;font-weight:650;box-shadow:0 7px 16px rgba(66,110,216,.18);cursor:pointer}
.pf-shell .pf-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.pf-shell .pf-detail-kicker{margin-bottom:9px;color:var(--pf-muted);font-size:11px;font-weight:650;letter-spacing:.08em}
.pf-shell .pf-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}
.pf-shell .pf-detail-grid div{min-width:0}
.pf-shell .pf-detail-grid span,.pf-shell .pf-detail-value{display:block;color:var(--pf-muted);font-size:11px}
.pf-shell .pf-detail-grid strong{display:block;margin-top:3px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600}
.pf-shell .pf-category-detail{display:flex;align-items:center;gap:8px;color:var(--pf-ink);font-size:14px;font-weight:600}
.pf-shell .pf-category-detail i{width:12px;height:12px;border-radius:50%;background:var(--pf-green);box-shadow:0 0 0 4px var(--pf-green-soft)}
.pf-shell.pf-detail-mode .rh-top .pf-more-trigger{display:grid}
@media(max-width:699px){.pf-shell .pf-detail{margin-inline:0}.pf-shell .pf-detail-card{padding:16px}.pf-shell .pf-detail-grid{gap:11px 12px}}

.pf-shell .pf-detail-card-head{padding:16px 18px 15px}
.pf-shell .pf-detail-card-head h1{font-size:21px}
.pf-shell .pf-detail-card-head p{margin-top:5px}
.pf-shell .pf-detail-mode .memo,.pf-shell .pf-detail-mode .qq-card{margin:0;border:0;border-radius:var(--pf-radius-card);box-shadow:var(--pf-shadow)}
.pf-shell .pf-detail-mode #memos,.pf-shell .pf-detail-mode #qq-list{display:grid;gap:12px;min-width:0}
.pf-shell .pf-detail-mode .memo .memo-text{max-height:none;white-space:pre-wrap;overflow:visible;text-align:left}
.pf-shell .pf-detail-mode .qq-card .qq-scroll{overflow:visible}
@media(max-width:699px){.pf-shell .pf-detail-mode #memos,.pf-shell .pf-detail-mode #qq-list{gap:10px}}

.pf-shell .pf-detail-mode .instance-card,.pf-shell .pf-detail-mode .mobile-proxy-card,.pf-shell .pf-detail-mode .mobile-online-device-card{margin:0;box-shadow:var(--pf-shadow)}
.pf-shell .pf-detail-mode #instances,.pf-shell .pf-detail-mode #v2-proxy-cards,.pf-shell .pf-detail-mode #device-list{display:grid;gap:12px;min-width:0}

.pf-shell.pf-photo-detail .photo-stage{max-width:720px;margin-inline:auto;border-radius:var(--pf-radius-card);box-shadow:var(--pf-shadow)}
.pf-shell.pf-photo-detail .info-sheet{max-width:720px;margin-inline:auto;border:0;border-radius:var(--pf-radius-card);box-shadow:var(--pf-shadow)}
.pf-shell.pf-photo-detail .photo-strip{display:none!important}

/* QQ keeps its content header separate so the compact shared bar never squeezes the title into a column. */
.pf-shell .qq-header{position:relative;top:auto;display:block;min-height:0;padding-top:12px;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.pf-shell .qq-header .qq-heading-row{display:none}
.pf-shell .qq-page>.pf-generated-topbar{margin-bottom:2px}


/* Desktop keeps navigation persistent and gives detail a second reading column. */
@media(min-width:1100px){
  .pf-shell #sidebar{transform:translateX(0)!important;visibility:visible!important;position:fixed!important;width:232px!important;max-width:232px!important;z-index:120!important}
  .pf-shell .workspace,.pf-shell>main,.pf-shell main{margin-left:232px!important;width:calc(100% - 232px)!important}
  .pf-shell .workspace>main{max-width:1120px!important;margin-right:auto!important;margin-left:0!important;padding-left:28px!important;padding-right:28px!important}
  .pf-shell>main,.pf-shell main{max-width:1120px!important;margin-right:auto!important;padding-left:28px!important;padding-right:28px!important}
  .pf-shell .sk5-workspace,.pf-shell #memo-home-navigation,.pf-shell #app-sidebar-root{margin-left:232px!important;width:calc(100% - 232px)!important}
  .pf-shell .r2-main{width:min(1120px,calc(100% - 36px))!important;max-width:none!important;margin-left:232px!important;margin-right:36px!important;padding-left:28px!important;padding-right:28px!important}
  .pf-shell .pf-detail-mode .pf-detail{display:grid;grid-template-columns:minmax(0,1fr);max-width:none!important;margin-right:0!important}
  .pf-shell .pf-detail-mode .pf-detail-card-head{grid-column:1}
  .pf-shell .pf-detail-mode .pf-detail-card:not(.pf-detail-card-head),
  .pf-shell .pf-detail-mode .pf-reveal-group{max-width:720px}
}
.pf-shell .back{display:none!important}
.pf-shell .pf-detail-section-label{margin-top:12px;color:var(--pf-muted);font-size:11px;font-weight:650;letter-spacing:.04em}
.pf-shell.pf-memo-edit-mode main{max-width:none;min-height:100dvh;padding-bottom:calc(16px + env(safe-area-inset-bottom))}
.pf-shell .pf-memo-edit-root{gap:10px;margin-top:0;min-height:calc(100dvh - 64px)}
.pf-shell .pf-memo-editor-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 2px 4px}
.pf-shell .pf-memo-editor-head h1{margin:0;font-size:22px;line-height:1.1}
.pf-shell .pf-memo-editor-head .pf-detail-kicker{display:block;margin-bottom:4px}
.pf-shell .pf-memo-editor-head .pf-primary{min-height:40px;margin:0;padding:0 15px;font-size:13px}
.pf-shell.pf-memo-edit-mode #memos{display:block;min-width:0}
.pf-shell.pf-memo-edit-mode #memos .memo{min-height:calc(100dvh - 150px);margin:0;padding:22px 20px;border-radius:18px;box-shadow:var(--pf-shadow)}
.pf-shell.pf-memo-edit-mode #memos .memo-input-wrap{height:auto;min-height:calc(100dvh - 290px);overflow:visible}
.pf-shell.pf-memo-edit-mode #memos .memo .memo-input-wrap textarea{position:static!important;width:100%!important;height:auto!important;min-height:calc(100dvh - 290px)!important;max-height:none!important;transform:none!important;padding:0!important;resize:none;font-size:18px;line-height:1.75}
.pf-shell.pf-memo-edit-mode #memos .memo-tools{margin-top:18px}
@media(max-width:699px){
  .pf-shell.pf-memo-edit-mode main{padding:0 14px calc(12px + env(safe-area-inset-bottom))}
  .pf-shell .pf-memo-editor-head{padding:10px 2px 8px}
  .pf-shell .pf-memo-editor-head h1{font-size:20px}
  .pf-shell.pf-memo-edit-mode #memos .memo{min-height:calc(100dvh - 116px);padding:19px 17px;border-radius:16px}
  .pf-shell.pf-memo-edit-mode #memos .memo-input-wrap,.pf-shell.pf-memo-edit-mode #memos .memo .memo-input-wrap textarea{min-height:calc(100dvh - 250px)!important}
}

@media(min-width:1100px){
  .pf-shell.pf-detail-mode main,.pf-shell.pf-detail-mode .r2-main{display:grid!important;grid-template-columns:minmax(0,1fr) 380px;column-gap:20px;align-items:start}
  .pf-shell.pf-detail-mode main>.pf-topbar,.pf-shell.pf-detail-mode .r2-main>.pf-topbar{grid-column:1 / -1!important}
  .pf-shell.pf-detail-mode main>.pf-detail,.pf-shell.pf-detail-mode .r2-main>.pf-detail{grid-column:2!important;grid-row:2 / span 20!important;position:sticky;top:18px;max-height:calc(100dvh - 36px);overflow:auto;padding-bottom:10px}
  .pf-shell.pf-detail-mode main>*:not(.pf-detail):not(.pf-topbar),.pf-shell.pf-detail-mode .r2-main>*:not(.pf-detail):not(.pf-topbar){grid-column:1!important}
  .pf-shell :is(#menu-toggle,.app-sidebar-toggle,#memo-nav-open){display:none!important}
}
.pf-shell .pf-editable{cursor:text;border-radius:8px;transition:background var(--pf-motion),box-shadow var(--pf-motion)}
.pf-shell .pf-editable:hover{background:var(--pf-surface-soft)}
.pf-shell .pf-editable[contenteditable="true"]{outline:0;background:var(--pf-blue-soft);box-shadow:0 0 0 2px rgba(66,110,216,.18);padding-inline:4px}
@media(max-width:699px){.pf-shell :is(.qq-filter,.mc-trigger,.mc-toolbar>button,.filter-chip,.r2-button,.r2-select,.secondary-menu-button,.sort-menu-panel button){min-height:44px}}
