.gt-shortcuts, .gt-actions, .gt-tabs, .gt-index, .gt-order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.gt-shortcuts { margin-bottom: 20px; }
.group-tools { max-width: 960px; font-size: 1rem; }
.group-tools [hidden], [data-rule-source][hidden] { display: none !important; }
.group-tools h2 { margin: 0 0 .55rem; font-size: 1.125rem; }
.group-tools h3 { margin: 0; font-size: 1rem; }
.group-tools .gt-book-title { margin: 1.5rem 0 .8rem; font-size: clamp(1.2rem, 3vw, 1.65rem); }
.group-tools .btn, .gt-shortcuts .btn { min-height: 44px; font-size: .875rem; white-space: normal; }
.group-tools .form-field, .group-tools .badge { font-size: .875rem; }
.group-tools .form-field input, .group-tools .form-field textarea, .group-tools .form-field select {
  font-size: 1rem;
  min-height: 44px;
  width: 100%;
}
.group-tools .form-field textarea { min-height: 80px; }
.gt-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 12px; }
.gt-grow { flex: 1 1 230px; min-width: 0; }
.gt-management, .gt-category, .gt-save, .gt-filters {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(12px, 3vw, 20px);
}
.gt-management { padding-block: 5px; }
.gt-management summary { display: list-item; min-height: 44px; padding-block: 11px; cursor: pointer; }
.gt-management .gt-actions { padding: 0 0 10px; }
.gt-category { margin-top: 14px; scroll-margin-top: 82px; overflow-wrap: anywhere; }
.gt-rules { margin: 0; }
.gt-rules > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); gap: .25rem 1rem; padding: .8rem 0; }
.gt-rules > div + div, .gt-edit-rule + .gt-edit-rule { border-top: 1px solid var(--border); }
.gt-rules dt, .gt-rules dd { margin: 0; line-height: 1.55; }
.gt-rules dt { color: var(--forest); font-weight: 700; }
.gt-rules dd { white-space: pre-wrap; }
.gt-rules p, .gt-category p { margin-top: .35rem; }
.gt-hint, .gt-empty, .gt-memo, .gt-notice { font-size: .875rem; color: #52645b; line-height: 1.55; }
.gt-memo, .gt-notice { padding: .5rem .65rem; border-radius: 6px; background: #eef4ef; white-space: pre-wrap; }
.gt-index .btn { text-decoration: none; color: var(--forest); }
.gt-edit-list, .gt-history-list { list-style: none; margin: 0; padding: 0; }
.gt-edit-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.gt-edit-head .form-field { flex: 1 1 190px; }
.gt-order { flex-shrink: 0; }
.gt-order .btn { min-width: 44px; justify-content: center; padding: 0; font-size: 1.1rem; }
.gt-order [draggable] { cursor: grab; }
.gt-edit-rule { display: grid; gap: 10px; justify-items: start; padding: 14px 0; }
.gt-edit-rule > :is(.form-field, .gt-edit-head, .gt-options) { width: 100%; }
.gt-editor, .gt-receipts, .gt-save { margin-top: 16px; }
.gt-editor > .gt-actions, .gt-save .gt-actions, .gt-receipt .btn, .gt-history-list .btn { margin-top: 10px; }
.gt-options { margin: 0; border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.gt-options legend { font-size: .875rem; padding: 0; }
.gt-options label {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 5px 10px;
  background: #f3f6f3;
  font-size: .875rem;
}
.gt-options input { width: 1em; height: 1em; accent-color: var(--green); }
.gt-options .gt-hint { flex-basis: 100%; margin: 0; }
.gt-filters, .gt-receipt-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.gt-filters .form-field, .gt-receipt-form .form-field { flex: 1 1 160px; min-width: 0; }
.gt-receipt-form { margin-top: .8rem; }
.gt-receipt h3 { margin-top: .65rem; }
.gt-receipt .gt-yen { font-size: 1.35rem; font-weight: 700; margin: .15rem 0; }
.gt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .875rem; }
.gt-meta time { font-variant-numeric: tabular-nums; }
.gt-diff { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: .4rem; }
.gt-diff > div { padding: .65rem; background: #f5f7f4; border-radius: 6px; }
.gt-diff p { margin-bottom: 0; white-space: pre-wrap; }
.gt-dialog .dialog-body { display: grid; gap: 10px; }
.gt-history > .btn, .gt-receipts > .btn { margin-top: 12px; }
.community-initial, .community-questions { display: grid; gap: .75rem; min-width: 0; }
.community-initial { border: 1px solid var(--border); border-radius: 12px; margin: 0; padding: .85rem; }
.community-initial legend { padding-inline: .35rem; font-weight: 700; }
.community-initial [hidden], .community-initial[hidden] { display: none !important; }
.community-initial > .btn { justify-self: start; min-height: 44px; }
.community-notice-button { min-width: 38px; }
.community-notice-button [data-notice-count] { min-width: 1.25rem; font-weight: 700; }
.community-notice-button [hidden] { display: none; }
.user-button .avatar { position: relative; overflow: hidden; }
.user-button .avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.community-avatar, .community-avatar-preview { object-fit: cover; border-radius: 50%; }
.community-avatar { width: 28px; height: 28px; }
.community-avatar-preview { width: 92px; height: 92px; display: block; margin-block: .6rem; }
.community-compose { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; padding-block: .8rem; }
.community-compose .gt-grow { min-width: min(100%,230px); }
.community-messages { max-height: min(64vh, 40rem); overflow-y: auto; }
.community-thread { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0; }
.community-message { width: fit-content; max-width: min(92%,38rem); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: .55rem .75rem; }
.my-message .community-message { margin-inline-start: auto; background: var(--green-light); }
.community-message p { white-space: pre-wrap; overflow-wrap: anywhere; }
.community-message time { font-size: .75rem; color: #52645b; }
.community-report, .gt-change-details > div { border-top: 1px solid var(--border); padding-block: .75rem; }
.gt-change-details summary { min-height: 44px; padding-block: .6rem; cursor: pointer; }
.result-policy { display: grid; gap: .75rem; padding-block: .6rem; }
.result-policy > .btn { justify-self: start; }
.result-approval-diff { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 3fr); gap: .5rem; }
.result-approval-diff dt { font-weight: 700; }
.result-approval-diff dd { margin: 0; overflow-wrap: anywhere; }
.import-table input { width: 8rem; min-height: 40px; font-size: .875rem; }
.import-table td:nth-child(3) input, .import-table td:nth-child(5) input { width: 10rem; }
.import-table td:nth-child(4) input, .import-table td:nth-child(6) input, .import-table td:nth-child(9) input { width: 4.5rem; }
.import-table td { padding: .3rem; }

.lineup-history { margin-bottom: 1rem; }
.lineup-tools { flex-wrap: wrap; }
.lineup-tools .btn { min-height: 42px; }
.lineup-plan { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.lineup-plan span { flex: 1 1 12rem; }
.oauth-buttons { display: grid; gap: .65rem; margin: .85rem 0; }
.oauth-buttons .btn { min-height: 44px; }
@media (max-width: 540px) {
  .gt-rules > div, .gt-diff { grid-template-columns: 1fr; }
  .gt-editor .gt-save { position: sticky; bottom: calc(69px + env(safe-area-inset-bottom)); z-index: 2; padding: 10px; }
}
.match-photo-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));gap:1rem}
.match-photo-card{display:grid;align-content:start;gap:.5rem;min-width:0}
.match-photo-card img{display:block;max-width:100%;width:100%;height:auto;border-radius:.75rem}
.match-photo-card small{display:block}
.stats-toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:.625rem;margin-block:.75rem}
.stats-toolbar .form-field{min-width:min(100%,10rem);flex:1 1 10rem;margin:0}
.stats-toolbar .btn{flex-shrink:0}
.stats-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,7rem),1fr));gap:.75rem}
.stats-summary dd{margin:0;font-size:1.15rem;font-weight:650}
.rank-breakdown{min-width:13.5rem}
.rank-bars{width:100%;max-width:20rem;display:block;border-radius:.25rem;margin-block:.4rem}
.rank-fill-0{fill:#3b8e60}.rank-fill-1{fill:#4f83be}.rank-fill-2{fill:#c4872f}.rank-fill-3{fill:#b95861}
.stats-trend{display:block;width:100%;height:auto;margin-block:.5rem}
.stats-trend circle{fill:currentColor;cursor:pointer}.stats-trend circle:focus{outline:none;stroke:#db902d;stroke-width:3}
.stats-lock{margin-block:1rem}
.entry-events{min-width:0;border:1px solid var(--line);border-radius:.75rem;padding:.625rem}
.entry-events input[type=number]{width:100%}
[data-manual-tobi][hidden],[data-yaku-custom][hidden]{display:none!important}
.match-yaku{align-items:end;margin-block:.75rem}
