/* 設計パターン。style.css と flow.css の上に重ねる */
.agrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.acard { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.acard .dtop h3 { margin: 0; font-size: 16px; }
.acard .en { font-family: var(--latin); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.acard p { margin: 0; font-size: 13px; color: var(--ink2); }
.gh { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12.5px; }
.gh h4 { margin: 0 0 4px; font-size: 11.5px; }
.gh .good h4 { color: var(--k-test); }
.gh .hard h4 { color: #b45309; }
.gh ul { margin: 0; padding-left: 1.1em; color: var(--ink2); }
.exs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; }
.exs b { color: var(--muted); margin-right: 2px; }
.exs a { font-weight: 700; color: #1d4ed8; text-decoration: none; border: 1px solid #c7d2fe; background: #eef2ff; border-radius: 7px; padding: 1px 8px; }
.exs a:hover { background: #e0e7ff; }
.ftree { font-family: var(--latin); font-size: 11.5px; line-height: 1.6; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 10px 12px; margin: 0; overflow-x: auto; white-space: pre; }
.treenote { font-size: 11px; color: var(--muted); margin-bottom: -4px; }
.tip { font-size: 12.5px; color: #92400e; background: #fffbeb; border-radius: 8px; padding: 6px 10px; }

/* GoF */
.gfilter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gfilter button { appearance: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink2); }
.gfilter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.gcats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.gcat { font-size: 12.5px; color: var(--ink2); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; gap: 8px; align-items: baseline; }
.gcat b { color: #fff; font-size: 12px; border-radius: 6px; padding: 1px 8px; flex: none; }
.c-create { --g: #2563eb; }
.c-struct { --g: #7c3aed; }
.c-behave { --g: #059669; }
.gcat b, .gbadge { background: var(--g); }
.ggrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gcard { appearance: none; text-align: left; font: inherit; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; min-width: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.gcard:hover { border-color: #94a3b8; transform: translateY(-1px); }
.gcard.on { border-color: var(--g); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g) 25%, transparent); }
.gcard.must { background: color-mix(in srgb, #f59e0b 5%, white); }
.gtop { display: flex; align-items: center; gap: 6px; }
.gbadge { color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 1px 6px; flex: none; }
.stars { font-size: 11px; color: #f59e0b; letter-spacing: 1px; margin-left: auto; flex: none; }
.gcard .gen { font-family: var(--latin); font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.gcard .gja { font-size: 11.5px; color: var(--muted); }
.gcard .gone { font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.gcard .gweb { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.gcard:focus-visible, .gfilter button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

.gsheet { width: 460px; }
.gsheet .gtitle { font-family: var(--latin); font-size: 21px; font-weight: 600; margin: 0 34px 2px 0; }
.gsheet .sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gsheet h4 { margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
.gsheet p { margin: 0; color: var(--ink2); font-size: 13.5px; }
.code { font-family: var(--latin); font-size: 12px; line-height: 1.6; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 10px 12px; margin: 0; overflow-x: auto; white-space: pre; }
.code .cm { color: #94a3b8; }

@media (max-width: 1100px) {
  .agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .agrid, .gcats { grid-template-columns: 1fr; }
  .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gsheet { width: auto; }
}

/* ④ AI を組み込むときの型（紫は AI の印） */
.aipgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.aipcard { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.aiph { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.aiph h3 { margin: 0; font-size: 15.5px; }
.aiph .en { font-family: var(--latin); font-size: 11px; color: var(--muted); }
.aikind { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; background: #ede9fe; color: #5b21b6; }
.aikind.k-ヒント { background: var(--line2); color: var(--ink2); }
.fmini { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; background: #f5f3ff; border-radius: 10px; padding: 9px 10px; }
.fcol { display: inline-flex; flex-direction: column; gap: 3px; }
.fbox { background: #fff; border: 1px solid #c4b5fd; border-radius: 7px; padding: 3px 8px; font-size: 11.5px; font-weight: 700; color: #4c1d95; white-space: nowrap; text-align: center; }
.farr { color: #8b5cf6; font-weight: 700; }
.floop { display: inline-flex; flex-direction: column; align-items: center; font-size: 10px; color: #6d28d9; font-weight: 700; line-height: 1.2; padding: 0 2px; }
.floop i { font-style: normal; font-size: 15px; }
.aipcard p { margin: 0; font-size: 12.5px; color: var(--ink2); }
.aipcard .fit { font-size: 12.5px; }
.aipcard .fit b { color: var(--k-test); font-size: 11.5px; margin-right: 6px; }
.like { font-size: 12px; color: var(--ink2); background: var(--line2); border-radius: 8px; padding: 6px 10px; }
.like b { display: block; font-size: 11px; color: var(--muted); }
.like button { appearance: none; font: inherit; font-family: var(--latin); font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 1px 7px; margin-right: 6px; cursor: pointer; color: var(--ink); }
.like button:hover { border-color: #94a3b8; }
.like button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.alink { font-size: 12px; color: #1d4ed8; }
.asrc { margin-top: auto; font-size: 11.5px; color: var(--muted); }
.asrc a { color: #1d4ed8; }
#ai .src { margin-top: 14px; }
@media (max-width: 1100px) { .aipgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .aipgrid { grid-template-columns: 1fr; } .fbox { white-space: normal; } }
