/* 助手 The helper's page (#/agent). Phone first: one column, big tap targets, nothing wider than the screen.
 * Only tokens from tokens.css, so it follows light and dark. */
.ag-page { max-width: 44rem; }
.ag-hello h1 { margin-bottom: var(--s-1); }
.ag-sec { display: grid; gap: var(--s-3); margin-top: var(--s-6); }
.ag-sec > .label { display: flex; align-items: center; gap: var(--s-2); }
.ag-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; padding: 0 var(--s-2); border-radius: 999px; background: var(--btn); color: var(--on-btn); font-size: var(--t-xs); }

.ag-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ag-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); min-height: 52px; padding: var(--s-3) var(--s-4); color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); }
.ag-row:first-child { border-top: 0; }
.ag-row-t { overflow-wrap: anywhere; }
@media (hover: hover) { .ag-row:hover { background: var(--soft); } }
.ag-quiet { display: flex; align-items: center; gap: var(--s-2); color: var(--grey); }

.ag-card { display: grid; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ag-card.is-open { border-color: var(--btn); box-shadow: inset 3px 0 0 var(--btn); }
.ag-card-t { line-height: 1.6; overflow-wrap: anywhere; }
.ag-card .row-btns .btn { min-height: 44px; }
.ag-status { font-weight: 600; }
.st-done { color: var(--fine); }
.st-failed, .st-uncertain { color: var(--stop); }
.st-executing { color: var(--watch); }
.ag-old > summary, .ag-steps > summary { cursor: pointer; color: var(--grey); font-size: var(--t-sm); min-height: 44px; display: flex; align-items: center; }
.ag-old { display: grid; gap: var(--s-3); }

.ag-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ag-chip { min-height: 40px; padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; font-size: var(--t-sm); cursor: pointer; }
@media (hover: hover) { .ag-chip:hover { background: var(--soft); } }
.ag-log { display: grid; gap: var(--s-4); }
.ag-log:empty { display: none; }
.ag-q { justify-self: end; max-width: 88%; padding: var(--s-2) var(--s-3); background: var(--soft); border-radius: var(--r-lg); white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-a { display: grid; gap: var(--s-2); min-width: 0; }
.ag-text { line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-steps ol { margin: 0; padding-left: 1.25rem; color: var(--grey); font-size: var(--t-sm); display: grid; gap: var(--s-1); }
.ag-wait { animation: ag-wait 1.6s ease-in-out infinite; }
@keyframes ag-wait { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .ag-wait { animation: none; } }

.ag-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); align-items: end; }
.ag-form textarea { min-height: 3.5rem; max-height: 9rem; resize: vertical; }
.ag-form .btn, .ag-form input { min-height: 44px; }
.ag-rules { color: var(--grey); }

.ag-notes, .ag-jobl { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.ag-note { display: grid; gap: var(--s-1); padding: var(--s-3) 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.ag-note .lk { min-height: 32px; padding: 0 var(--s-1); border: 0; background: transparent; font: inherit; font-size: var(--t-sm); cursor: pointer; }
@media (hover: hover) { .ag-note .lk:hover { text-decoration: underline; } }
.ag-jobs > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.ag-job { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: start; padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.ag-job .mk { margin-top: 3px; }

@media (max-width: 899.98px) {
  .ag-sec { margin-top: var(--s-5); }
  .ag-card .row-btns { display: grid; grid-template-columns: 1fr 1fr; }
}
