*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}
body{margin:0;font:15px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:#f5f6f8;color:#222;overflow-wrap:anywhere}
header{position:relative;display:flex;justify-content:space-between;align-items:center;padding:8px 16px;background:#1f2937;color:#fff;flex-wrap:wrap;min-height:52px}
header nav{display:flex;align-items:center;flex-wrap:wrap}
header a,header .link{color:#e5e7eb;text-decoration:none;margin-left:14px;padding:6px 0;min-height:44px;display:inline-flex;align-items:center}.brand{font-weight:700;margin:0!important;font-size:17px}
.navtoggle{position:absolute;opacity:0;pointer-events:none}.hamburger{display:none}
main{max-width:1100px;margin:16px auto;padding:0 14px}h1{font-size:22px;line-height:1.3}h2{font-size:18px;margin-top:28px}
table{width:100%;border-collapse:collapse;background:#fff;margin:10px 0}th,td{padding:7px 9px;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:top}th{background:#f9fafb;font-size:13px}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:14px;margin:14px 0;max-width:100%}.narrow{max-width:380px}
label{display:block;margin:8px 0}input:not([type=checkbox]),select,textarea{display:block;width:100%;max-width:100%;padding:8px;border:1px solid #cbd5e1;border-radius:5px;font:inherit;margin-top:3px;min-height:44px}
input[type=checkbox]{width:20px;height:20px;vertical-align:middle}
.check{display:inline-flex;gap:6px;align-items:center}.row{display:flex;gap:12px;flex-wrap:wrap}.row label{flex:1 1 200px}
.btn{display:inline-flex;align-items:center;justify-content:center;background:#2563eb;color:#fff;border:0;border-radius:6px;padding:8px 14px;min-height:44px;cursor:pointer;text-decoration:none;font:inherit}
.btn.sec{background:#6b7280}.btn.danger{background:#dc2626}.btn.warn{background:#d97706}.btn.small{padding:4px 12px;font-size:14px;min-height:44px}
.link{background:none;border:0;cursor:pointer;font:inherit}.inline{display:inline}.actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.flash{padding:9px 12px;border-radius:6px;margin:8px 0}.flash.ok{background:#dcfce7}.flash.err{background:#fee2e2}
.muted{color:#6b7280;font-size:13px}code{background:#eef;padding:1px 4px;border-radius:3px;word-break:break-all}.tag{background:#e0e7ff;font-size:11px;padding:1px 5px;border-radius:3px}
pre{white-space:pre-wrap;word-break:break-word;margin:4px 0;font-size:13px;max-width:100%;overflow-x:auto}.out{background:#f3f4f6;padding:8px;max-height:300px;overflow:auto}
.chat{display:flex;flex-direction:column;gap:8px}.msg{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:8px 12px;min-width:0}
.msg pre{white-space:pre-wrap}.msg details pre{white-space:pre;max-height:360px;overflow:auto}
.msg.user{background:#eff6ff}.msg.tool{background:#f9fafb;font-size:13px}.msg.error{background:#fee2e2}.meta{font-size:12px;color:#6b7280}
.pending{border-color:#f59e0b}.dangerzone{border-color:#fca5a5}th.rot{font-size:11px}
.scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
.matrix td,.matrix th{text-align:center}.matrix td:first-child,.matrix th:first-child{text-align:left;position:sticky;left:0;background:#fff;z-index:1;min-width:110px}
.matrix th:first-child{background:#f9fafb}
.qr svg{max-width:100%;height:auto;display:block}
.chatform{position:sticky;bottom:0;z-index:5;box-shadow:0 -4px 12px rgba(0,0,0,.08)}

@media (max-width:760px){
  body{font-size:16px}
  .hamburger{display:flex;flex-direction:column;justify-content:center;gap:5px;width:44px;height:44px;cursor:pointer;padding:10px}
  .hamburger span{display:block;height:3px;background:#e5e7eb;border-radius:2px}
  header nav{display:none;width:100%;flex-direction:column;align-items:stretch;padding:6px 0}
  .navtoggle:checked~nav{display:flex}
  header nav a,header nav .link,header nav form{margin:0;display:block;width:100%;text-align:left}
  header nav a,header nav .link{padding:12px 4px;min-height:44px;border-top:1px solid #374151}
  main{padding:0 10px;margin-top:12px}h1{font-size:19px}
  /* Tablolar yatay kaydırılır */
  table:not(.matrix){display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;white-space:nowrap}
  table:not(.matrix) td form input:not([type=checkbox]){min-width:150px}
  .btn,.btn.small{min-height:44px;padding:8px 14px;font-size:15px}
  input:not([type=checkbox]),select,textarea{min-height:44px;font-size:16px}
  input[type=checkbox]{width:26px;height:26px}
  .narrow{max-width:none}
  .card{padding:12px}
  .row{flex-direction:column;gap:0}.row label{flex:1 1 auto}
  .actions .btn{flex:1 1 auto}
  .chatform{margin:10px -10px 0;border-radius:10px 10px 0 0;padding:10px}
  .chatform label{margin:2px 0;font-size:13px}
  .chatform .row{flex-direction:row;gap:8px}.chatform .row label{flex:1 1 0;min-width:0}
  .chatform .msglabel{font-size:0}.chatform .msglabel textarea{font-size:16px}
  .chatform .btn{width:100%}
  .chatform textarea{min-height:60px}
  th.rot{writing-mode:vertical-rl;transform:rotate(180deg);white-space:nowrap;padding:8px 4px;font-size:12px}
  .matrix td{padding:8px 4px}
}
