/* Screen rules (docs/UI-RULES-20261116.md), set by the owner item by item on 11/16.
   Three text sizes only: titles 17, body 15 (the size of a Threads post), notes 13; weights 400
   and 600. One gutter, compact cards, buttons in three kinds at 44px (40px small), corners
   8 / 12 / pill, one chip shape, and no two controls touching. Sizes are in rem on a 15px root,
   so the 大きめ text setting still scales everything. Loaded last: it only brings values that
   earlier sheets set differently onto the rules. */
:root:not([data-text-size="large"]){font-size:15px}
:root{--fs-h:1.1333rem;--fs-b:1rem;--fs-c:.8667rem;--ui-pad:16px;--ui-pad-y:12px;--ui-gap:12px;--ui-r:8px;--ui-r-card:12px;--ui-h:44px;--ui-h-sm:40px;--post-size:var(--fs-b);--post-line:1.6}

/* Cards: one inner padding, compact top and bottom, the same space between them. */
body .card,body .pf-summary,body .pf-slide{padding:var(--ui-pad-y) var(--ui-pad)!important;margin:0 0 var(--ui-gap)}
body .pf-slide{border-radius:var(--ui-r-card)}
body .ux-disclosure{padding:0 var(--ui-pad);margin:0 0 var(--ui-gap);border-radius:var(--ui-r-card)}
body .ux-heading{margin:16px 0 8px}

/* Type: titles, body, notes. */
body{font-size:var(--fs-b)}
body :is(.ux-heading h2,.pf-head h2,.card h2,.card h3,.card h4,.mp-title h3,.mp-title h4,#feedback-materials-title,.ux-queue-date h3,#ap-report-view h4,.pf-summary-head strong,.feedback-menu strong,.intake-dialog h2,#intake-dialog-title,.ideation-dialog h2,.mp-dialog h3){font-size:var(--fs-h)!important;font-weight:600;letter-spacing:0;line-height:1.4}
body #monthly-review .mp-title :is(h3,h4){font-size:var(--fs-h)!important;font-weight:600}
body :is(p,li,dd,td,th,label,textarea,input,select,button,summary,.feedback-notice,.notif-item,.schedule-text,.ux-queue-copy,.pf-post,.lib-item,.feedback-table,.pf-note,.pf-note .pf-link,.feedback-notice .ux-text-button){font-size:var(--fs-b)!important}
body :is(.ux-help,.intake-help,.mp-muted,.pf-muted,.pf-tally,.pf-summary dt,.mp-eyebrow,.lib-item-meta,.lib-item-meta span,.bulk-bar .count,.app-footer-copy,.app-footer-links a,.filter-btn span,.header-nav .tab span,.feedback-stats span,.feedback-stats small,.feedback-metric-note,.ni-time,.failure-detail-at,.account-label,.topic-chip-empty,.feedback-select span,caption,.mp-preview-strip,#intake-progress,#intake-business-summary){font-size:var(--fs-c)!important}
body :is(label,summary,.filter-btn,.btn-primary,.btn-secondary,.btn-danger,.pf-btn,th,strong,b){font-weight:600}
body :is(.feedback-menu button,.feedback-menu span,.failure-banner-btn,.failure-banner-short,.ux-text-button,.app-footer-links a,.feedback-row-extra>summary,.lib-item-edit>summary,.ux-fold-plain>summary){font-weight:400}
body .header-nav .tab.active span{font-weight:600}
body .feedback-menu span{color:var(--muted)}

/* Buttons: filled, outlined or text; 44px, small ones 40px; corners 8px; never touching. */
body :is(.btn-primary,.btn-secondary,.btn-danger,.pf-btn){box-sizing:border-box;min-height:var(--ui-h);padding:0 16px!important;border-radius:var(--ui-r);line-height:1.4}
body :is(.btn-primary,.btn-secondary,.btn-danger).btn-sm,body .feedback-row-extra>button{min-height:var(--ui-h-sm);padding:0 12px!important}
body :is(.ux-actions,.intake-actions,.intake-style-actions,.pf-actions,.mp-review-next,.feedback-memo-actions,.lib-item-edit .ux-actions){display:flex;flex-wrap:wrap;gap:8px;align-items:stretch}
body :is(select,textarea,input[type=text],input[type=date],input[type=time],input[type=number],input[type=url],input[type=email],input[type=password]){border-radius:var(--ui-r)}
body textarea{line-height:1.6}
body .app-footer-links a,body .ux-head-link{min-height:44px;display:inline-flex;align-items:center}
/* Safari keeps its own select shape unless the native look is turned off. */
body :is(select,.account-selector select,.intake-panel select){-webkit-appearance:none;appearance:none;line-height:normal;box-sizing:border-box;height:var(--ui-h-sm);min-height:var(--ui-h-sm)!important;padding:0 36px 0 12px!important;border:1px solid var(--border);border-radius:var(--ui-r)!important;background:var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center/12px;color:var(--text)}
@media(max-width:640px){
  /* Buttons that belong together share the row in equal parts; a lone main button takes the row. */
  body :is(.feedback-memo-actions,.ux-memo-form .ux-actions,.mp-review-next,.ux-queue-tools>.ux-actions,#intake-entry-actions,.intake-style-actions){display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  body :is(.feedback-memo-actions,.ux-memo-form .ux-actions,.mp-review-next,.ux-queue-tools>.ux-actions,#intake-entry-actions,.intake-style-actions)>button{width:100%;margin:0}
  body #feedback-memo-status:empty{display:none}
  body #feedback-memo-status{grid-column:1/-1}
  body :is(#ux-reference-load,.ux-material-notice>button,#intake-review-now){width:100%}
}

/* Home. */
body .feedback-menu{gap:8px;margin:12px 0}
body .feedback-menu button{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:2px;min-height:76px;padding:var(--ui-pad-y) var(--ui-pad)}
body .feedback-menu strong{margin:0}
body .feedback-notice{padding:8px 0}
body .feedback-notice .ux-text-button{min-height:44px}
body .feedback-memo label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body .ideation-hint{margin:8px 0}

/* Selection row in 予約投稿: everything from the left, the delete button before the count. */
body #bulk-bar{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:8px 12px}
body #bulk-bar>label{flex-basis:100%}
body #bulk-bar .count{margin:0;order:2}
body #delete-selected-btn{order:1}
body #delete-selected-btn:disabled{opacity:1;color:var(--muted)!important;border-color:var(--border)!important}
/* A reservation row: date, state and topic on one line; 編集・作り直し・予約取り消し in one row. */
body #schedule-list .schedule-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
body #schedule-list .schedule-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:8px}
body #schedule-list .schedule-actions>.ux-expand{grid-column:1/-1}
body #schedule-list .schedule-actions>button.btn-sm{min-height:var(--ui-h-sm);padding:0 4px!important;font-size:var(--fs-c)!important;white-space:nowrap}
body #schedule-list .schedule-actions>.feedback-row-extra{grid-column:2/-1;min-width:0}
body #schedule-list .feedback-row-extra>button.btn-sm{display:inline-block;margin:8px 8px 0 0;white-space:nowrap}
body .ux-queue-date h3{margin:12px 0 4px}

/* Report: numbers under their names, no colons. */
.feedback-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 12px}
.feedback-stats>div{display:grid;align-content:start;gap:0;min-width:0}
.feedback-stats span,.feedback-stats small{color:var(--muted)}
.feedback-stats strong{font-size:var(--fs-h)!important;font-variant-numeric:tabular-nums}
@media(max-width:640px){.feedback-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
body .feedback-table :is(td,th){padding:6px 8px!important}
body #ap-reports button{min-height:var(--ui-h)}

/* ネタ帳: 文章スタイル compact, tone and emoji side by side. */
body .intake-style-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body .intake-style-grid>div{display:grid;gap:4px;min-width:0}
body #intake-style-form{display:grid;gap:8px}
body #intake-style-form label,body .intake-panel #intake-style-form>label{margin:0!important;font-size:var(--fs-c)!important;color:var(--muted)}
body #intake-style-form select{width:100%}
body #intake-writing-style>.btn-secondary{margin-top:8px}
body .lib-item{padding:8px 0}
body .ux-memo-form{display:grid;gap:8px}

/* Windows (お仕事のこと, 壁打ち): the same sizes and buttons as the screens. */
body .intake-dialog-body{padding:var(--ui-pad)}
body .intake-top{margin-bottom:8px}
body .intake-dialog label,body .intake-panel .intake-dialog label{margin:12px 0 4px!important;font-size:var(--fs-h)!important}
body .intake-dialog .intake-help{margin:4px 0;line-height:1.6}
body .intake-answer-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:12px}
body .intake-answer-actions>button{width:100%;min-height:var(--ui-h)!important}
body .intake-answer-actions>button[hidden]{display:none}
body .intake-bottom{border-top:0;margin-top:8px;padding-top:0}
body #intake-help:empty{display:none}

/* Top bar: notices, account and settings are one 40px bordered shape. PC keeps their words;
   phones put the name, bell and gear on one row, the account box below only with 2+ accounts. */
.ux-gear{display:block;flex-shrink:0}
body :is(.notif-bell,.header-right .user-dropdown-trigger){box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;height:var(--ui-h-sm);min-height:var(--ui-h-sm);padding:0 12px;border:1px solid var(--border);border-radius:var(--ui-r);background:var(--card);color:var(--text);font-size:var(--fs-c)!important;font-weight:600}
body .header-right .user-dropdown-trigger .arrow{display:none}
/* The app's name is a heading on PC too, the same 17px as the 使い方 page (11/16 ななみんさん:
   on PC it fell to the 15px button size and looked smaller than on the guide). */
body .header-top .feedback-brand{font-size:var(--fs-h)!important;font-weight:600}
body .account-selector select{height:var(--ui-h-sm)}
@media(max-width:640px){
  body .header-top{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px;padding:12px 16px}
  body .header-top h1{flex:1 1 auto;min-width:0;margin:0;font-size:var(--fs-h)!important;font-weight:600;letter-spacing:0}
  body .header-top .feedback-brand{min-height:40px;padding:0;font-size:var(--fs-h)!important;font-weight:600}
  body .header-right{display:contents}
  body .ux-notifications{order:1}
  body #user-menu{order:2}
  body .account-selector{order:3;flex:1 1 100%;min-width:0;display:flex}
  body .account-selector:has(#account-select option:only-child),body .account-selector:not(:has(#account-select option)){display:none!important}
  body .account-selector select{width:100%;min-width:0!important;max-width:none}
  body :is(.notif-bell,.header-right .user-dropdown-trigger){flex:0 0 40px;width:40px;padding:0;gap:0;justify-content:center}
  body :is(.notif-bell,.header-right .user-dropdown-trigger) [data-i18n]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  body .notif-bell .notif-badge{position:absolute;top:-6px;right:-6px}
  body #notif-panel{position:fixed;top:calc(env(safe-area-inset-top,0px) + 60px);left:max(16px,env(safe-area-inset-left,0px));right:max(16px,env(safe-area-inset-right,0px));width:auto}
}
body .notif-badge{font-size:var(--fs-c)!important;font-weight:600;min-width:18px;height:18px}
/* Settings menu: compact rows and segmented choices. */
body .user-dropdown-menu button{min-height:40px;padding:8px 16px}
body .ux-menu-group{margin:8px 16px 0;font-size:var(--fs-c)!important}
body .ux-text-size-options{gap:4px;padding:4px 16px}
body .ux-text-size-options label{min-height:36px!important;padding:4px!important;font-size:var(--fs-c)!important}
body .user-dropdown-menu .divider{margin:4px 0}

/* Chips: one shape, colour only for its role; the empty topic is a small text button. */
body :is(.badge,.pf-chip,.mp-status,.topic-chip:not(.topic-chip-empty)){display:inline-flex;align-items:center;min-height:22px;padding:0 10px;border:0;border-radius:999px;background:var(--soft);color:var(--muted);font-size:var(--fs-c)!important;font-weight:600;line-height:1}
body .badge-failed{background:var(--red-soft,#fbe7e5);color:var(--red)}
body .pf-chip.is-on,body .pf-chip.is-done{color:var(--green)}
body .topic-chip-empty{display:inline-flex;align-items:center;min-height:28px;padding:0!important;border:0!important;border-radius:0!important;background:none!important;color:var(--muted)!important;text-decoration:underline;text-underline-offset:3px}

/* Folds: no rule under an opened heading; 44px rows. */
body .ux-disclosure[open]>summary{border-bottom:0;margin-bottom:4px}
body :is(.ux-disclosure,.feedback-row-extra,.lib-item-edit,.ux-fold-plain)>summary{box-sizing:border-box;min-height:var(--ui-h);padding-top:10px;padding-bottom:10px;line-height:24px}

/* Notices. */
body .pf-note,body .ux-notice-line{border-radius:var(--ui-r)}
.notif-item.notif-error::before,.notif-item.notif-success::before{content:"";display:inline-block;width:8px;height:8px;margin-right:8px;border-radius:50%;vertical-align:2px;background:var(--red)}
.notif-item.notif-success::before{background:var(--green)}
body #notif-panel .mp-link{min-height:32px;margin-left:8px}
/* The local-only sample strip reads as body text: left-aligned, one sentence per line. */
body .mp-preview-strip{text-align:left}

/* 11/16 round 1 leftovers: the last off sizes and weights, and the two touching pairs. */
body .failure-banner-title{font-size:var(--fs-b)!important;font-weight:600}
body .failure-banner-short{font-size:var(--fs-b)!important;font-weight:400}
body .feedback-menu button span,body .feedback-menu .ux-phrase,body .ux-menu-sub,body .ux-head-link,body #lib-legacy div{font-size:var(--fs-c)!important}
body .user-dropdown-menu :is(button,button span,legend,.ux-menu-group){font-weight:400}
body .user-dropdown-menu .ux-menu-group{font-weight:600}
body #ux-interview-preview :is(h3,h4){font-size:var(--fs-h)!important;font-weight:600}
body .pf-sheet :is(#pf-settings-title,legend){font-weight:600}
/* お仕事のこと, once registered: 文章から更新 and 質問に答えて更新 as two equal buttons 8px apart. */
body #intake-update-method:not([hidden]){display:block;margin-top:8px}
body #intake-update-method #intake-entry-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;max-width:none}
body #intake-update-method #intake-entry-actions>button{width:100%;margin:0}
/* 作り方の変更: the last field and 保存 no longer touch. */
body .pf-sheet-foot{margin-top:12px}
body .ideation-message strong{display:block;font-size:var(--fs-c)!important;font-weight:600;color:var(--muted)}
/* 作り方の変更: choices as 44px rows with no extra gap; fields 8px apart. */
body .pf-field{gap:8px}
body .pf-field:has(.pf-radio){gap:0}
/* A choice reads as body text; the question above it carries the weight. Window titles are titles. */
body :is(label:has(>input[type=radio]),label:has(>input[type=checkbox]),.pf-radio){font-weight:400}
body #pf-settings-title{font-size:var(--fs-h)!important}
/* ネタ帳 (11/16 round 1, No.15 "スクロール量を減らしましょう"): 全文表示 and 編集 share one row;
   文章スタイル's two notes sit together; 保存 is sized to its word so the other button fits on one line. */
body .lib-item{display:flow-root}
body .lib-item>.ux-more{float:left;margin:0 20px 0 0}
body #intake-writing-style .intake-help{margin:4px 0}
body .intake-style-actions{grid-template-columns:minmax(88px,auto) minmax(0,1fr)!important}
/* Cards after 10本作成: the row's place and kind are notes like the rest (no 11px, no 700). */
body :is(.pf-row-meta,.pf-row-pos){font-size:var(--fs-c)!important}
body .pf-row-pos{font-weight:600}
body .pf-error{font-weight:600}
body .dr-actions [data-review-action="edit"]{font-weight:600}
body #intake-saved-style{margin:0}
body #intake-style-form{margin-top:4px}
body #intake-style-form>.intake-help:first-child{margin:0}
/* 予約投稿 top: カレンダー表示 and 一括編集 side by side; no empty note line; the heading link sits on the title line. */
body .ux-queue-tools :is(#calendar-toggle-btn,#bulk-edit-btn){grid-column:auto!important}
body #ux-queue-note:empty{display:none}
body .ux-queue-tools{margin:8px 0}
body .ux-queue-tools>.ux-actions{margin-bottom:8px}
body .ux-heading:has(.ux-head-link){align-items:center}
/* Report: each term of the note wraps as a whole (no "平均反/応"). */
body .feedback-metric-note span{display:inline-block;margin-right:12px}
/* Card bar: 採用・編集・削除 as three equal buttons, each label on one line. */
body .pf-card-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
body .pf-card-actions .pf-btn{padding:0 8px!important;white-space:nowrap}
/* お仕事のこと window: the usage line is a note like the line above it. */
body #intake-usage,body #intake-usage *{font-size:var(--fs-c)!important}
/* On narrow phones with large text, 予約取り消し did not fit a third of the row and ran 4px past
   the screen at 320px; the buttons now go to a second line instead (11/17). */
@media(max-width:400px){body #schedule-list .schedule-actions{grid-template-columns:repeat(auto-fit,minmax(6.6em,1fr))}}
/* Failed rows (11/17): the reason is a note (13px, the third size; it was a fourth, 14px). */
body #schedule-list .failure-detail,body #schedule-list .failure-detail-label{font-size:var(--fs-c)!important}
/* Failed rows (11/17): 再投稿 and 下書きへ, two equal buttons. */
body #schedule-list .schedule-actions:has(>.ux-to-draft){grid-template-columns:repeat(2,minmax(0,1fr))}
/* A row left with one button (production has no 壁打ち yet) uses the full width. */
@media(max-width:640px){body :is(.feedback-memo-actions,.ux-memo-form .ux-actions,.mp-review-next,.ux-queue-tools>.ux-actions,#intake-entry-actions,.intake-style-actions)>button:only-of-type{grid-column:1/-1}}
/* 11/16 production check (owner's iPhone): nothing may sit on top of text.
   お仕事のこと: the title row is as tall as 変更 and leaves room for it, so the summary starts
   below the button instead of running under it. */
body .intake-panel #intake-edit-business{top:12px;right:16px}
body #ux-interview-card h2{display:flex;align-items:center;min-height:var(--ui-h-sm);margin:0 0 4px;padding-right:72px}
/* 文章スタイル: 口調 and 絵文字 as two rows with the name on the left, so every choice
   ("やわらかい話し言葉", "使う（1〜2個）") shows whole at phone width. */
body .intake-style-grid{grid-template-columns:1fr!important}
body .intake-style-grid>div{grid-template-columns:3.5em minmax(0,1fr);align-items:center;gap:8px}
/* Narrow phones (375px): a short button label never breaks; these rows trade side padding for room. */
body :is(.intake-answer-actions,#intake-entry-actions,.intake-style-actions,.pf-card-actions,#schedule-list .schedule-actions)>button{white-space:nowrap}
@media(max-width:400px){body :is(.intake-answer-actions,#intake-entry-actions,.intake-style-actions)>button{padding-left:8px!important;padding-right:8px!important}}
/* No short last lines: sentences avoid a lone word at the end, labels and titles split evenly. */
body :is(p,li,dd,.ux-help,.intake-help,.pf-note,.feedback-notice){text-wrap:pretty}
body :is(h2,h3,h4,label,legend,.failure-banner-title){text-wrap:balance}
/* 口調 looked like a text box (an older id rule took away the ⌄ and the light border); it now
   matches 絵文字 and every other select. */
body .intake-panel #intake-style-tone{border:1px solid var(--border);background:var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center/12px}
