/* HAMMAM — Claude-like settings UI: type, air, boxes only for data */

:root {
  --bg: #141413;
  --surface: #1a1917;
  --field: #21201c;
  --hairline: rgba(255, 255, 255, 0.09);
  --hover: rgba(255, 255, 255, 0.05);
  --active: rgba(255, 255, 255, 0.1);

  --text: #f5f4ef;
  --text-2: #b8b5ad;
  --text-3: #78756d;

  --ok: #6db88a;
  --warn: #c9a24a;
  --bad: #d17b7b;

  --claude-code: #e8956f;
  --claude-code-dim: rgba(232, 149, 111, 0.62);
  --claude-code-muted: rgba(232, 149, 111, 0.42);
  --caret: #da7756;

  --radius: 8px;
  --page: 880px;
  --sidebar: 200px;
  --menu: #232220;
  --icon: rgba(245, 244, 239, 0.72);

  --ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, Consolas, "Cascadia Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

/* Scrollbars — dark, thin, no OS chrome (Claude-like) */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.28);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
*::-webkit-scrollbar-button,
*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:vertical:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment {
  display: none;
  width: 0;
  height: 0;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1, "liga" 1;
}

button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 7px 10px;
  width: 100%;
  outline: none;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(218, 119, 86, 0.35);
  box-shadow: 0 0 0 1px rgba(218, 119, 86, 0.12);
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  border: 1px solid var(--hairline);
  transition: background-color 99999s ease-out 0s;
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset !important;
  box-shadow: 0 0 0 1000px var(--field) inset !important;
}
input:-webkit-autofill:focus {
  border-color: rgba(218, 119, 86, 0.35);
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset, 0 0 0 1px rgba(218, 119, 86, 0.12) !important;
  box-shadow: 0 0 0 1000px var(--field) inset, 0 0 0 1px rgba(218, 119, 86, 0.12) !important;
}
input:autofill,
input:autofill:hover,
input:autofill:focus {
  box-shadow: 0 0 0 1000px var(--field) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: var(--claude-code-muted);
}
.input-code::placeholder {
  color: var(--claude-code-dim);
  font-family: var(--mono);
}
input.hmm-caret-field,
textarea.hmm-caret-field {
  caret-color: transparent;
}
.hmm-caret-wrap {
  position: relative;
  width: 100%;
}
.hmm-caret-measure {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  pointer-events: none;
  top: 0;
  left: 0;
  height: 0;
  overflow: hidden;
}
.hmm-caret-bar {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 1.05em;
  margin-top: -0.52em;
  background: var(--caret);
  border-radius: 1px;
  pointer-events: none;
  opacity: 0;
  transition: left 0.09s ease-out;
  box-shadow: 0 0 8px rgba(218, 119, 86, 0.45);
}
.hmm-caret-wrap.is-focused .hmm-caret-bar {
  opacity: 1;
  animation: hmm-caret-blink 1.05s step-end infinite;
}
@keyframes hmm-caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
input[type="file"] { font-size: 14px; padding: 8px; }
input[type="checkbox"] { width: auto; accent-color: #c9c5bc; }

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2378756d' d='M4.5 6 8 9.5 11.5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 13px; }

.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--icon);
}
.ico-nav { width: 17px; height: 17px; opacity: 0.85; }
.ico-brand { width: 20px; height: 20px; color: #d4a574; }
.ico-block { width: 20px; height: 20px; }
.ico-inline { width: 16px; height: 16px; margin-right: 6px; }
.ico-btn { width: 16px; height: 16px; margin-right: 8px; color: #1a1917; opacity: 0.85; }
.ico-avatar { width: 18px; height: 18px; color: var(--text-2); }
.ico-chevron { width: 14px; height: 14px; color: var(--text-3); transition: transform 0.15s ease; }

/* Typography */
.page-title,
.block-title,
.login-title {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}
.block-title {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.3;
}
.block-title-tight { margin-top: 4px; }
.login-title {
  margin: 0;
  font-size: 1.625rem;
  line-height: 1.15;
  text-align: center;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.field-hint {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
.btn-primary {
  background: #ebe8e0;
  color: #1a1917;
}
.btn-primary:hover { background: #f5f3ec; }
.btn-with-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  vertical-align: middle;
}
.btn-with-ico .ico-inline {
  margin: 0;
  opacity: 0.85;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: block;
}
.toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.toolbar-wrap .toolbar-actions { margin-left: auto; }

.btn-secondary {
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--hairline);
}
.btn-secondary:hover { background: var(--hover); }

.hmm-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.hmm-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hmm-file-name {
  font-size: 14px;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hmm-file-name.is-empty { color: var(--text-3); }

.hmm-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.hmm-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.hmm-switch-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--hairline);
  transition: background 0.15s ease;
  position: relative;
}
.hmm-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ebe8e0;
  transition: transform 0.15s ease;
}
.hmm-switch input:checked + .hmm-switch-track {
  background: rgba(218, 119, 86, 0.28);
  border-color: rgba(218, 119, 86, 0.5);
}
.hmm-switch input:checked + .hmm-switch-track::after {
  transform: translateX(18px);
  background: #f0c4a8;
}
.hmm-switch input:focus-visible + .hmm-switch-track {
  outline: 2px solid rgba(218, 119, 86, 0.45);
  outline-offset: 2px;
}

.btn-text {
  font-size: 14px;
  color: var(--text-2);
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.2;
}
.btn-text.btn-with-ico {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-text:hover { color: var(--text); background: var(--hover); }
.btn-text-danger { color: #d9a0a0; }
.btn-text-danger:hover { color: #efcaca; }

.btn-mini {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-2);
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--hairline);
  background: transparent;
}
.btn-mini:hover { background: var(--hover); color: var(--text); }

.btn-danger {
  font-size: 12px;
  color: var(--bad);
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  border-radius: 5px;
}
.btn-danger:hover { background: rgba(209, 123, 123, 0.08); }

/* Login — centered card (stable at any viewport) */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(232, 149, 111, 0.07), transparent 58%),
    var(--bg);
}
.login-shell {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(20px, env(safe-area-inset-top, 0px))
    max(20px, env(safe-area-inset-right, 0px))
    max(20px, env(safe-area-inset-bottom, 0px))
    max(20px, env(safe-area-inset-left, 0px));
}
.login-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 22.5rem;
  padding: clamp(1.75rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2rem) clamp(1.5rem, 3.5vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 28px 72px rgba(0, 0, 0, 0.42);
}
.login-head {
  margin: 0 0 1.75rem;
  text-align: center;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
}
.login-fields {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
}
.login-field {
  display: block;
  width: 100%;
  margin: 0;
}
.login-field .hmm-caret-wrap,
.login-field input {
  display: block;
  width: 100%;
  max-width: 100%;
}
.login-form input {
  min-height: 2.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  line-height: 1.35;
}
.login-form input::placeholder {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  opacity: 1;
}
.login-alert {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: center;
  color: #efcaca;
  background: rgba(209, 123, 123, 0.1);
  border: 1px solid rgba(209, 123, 123, 0.28);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
}
.login-alert.hidden {
  display: none;
}
.btn-login {
  width: 100%;
  margin-top: 0.25rem;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.btn-login:disabled {
  opacity: 0.72;
  cursor: wait;
}
.btn-login.is-busy {
  position: relative;
  color: transparent;
}
.btn-login.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(26, 25, 23, 0.25);
  border-top-color: #1a1917;
  border-radius: 50%;
  animation: login-spin 0.65s linear infinite;
}
@keyframes login-spin {
  to { transform: rotate(360deg); }
}
.field { display: block; }
.field-error {
  min-height: 1.1em;
  font-size: 13px;
  color: var(--bad);
}
@media (max-width: 380px) {
  .login-card {
    max-width: none;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  }
}

/* App shell + login — custom cursors */
.panel-body,
.login-body {
  background: var(--bg);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23ebe8e0' stroke='%231a1917' stroke-width='1.1' d='M4 3l1 12 3-4 3 5 2-1-3-5 5-1z'/%3E%3C/svg%3E") 2 2, default;
}
.panel-body input,
.panel-body textarea,
.panel-body .hmm-caret-field,
.login-body input,
.login-body textarea,
.login-body .hmm-caret-field {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='20' viewBox='0 0 16 20'%3E%3Cpath fill='%23da7756' d='M7 1h2v13H7z'/%3E%3C/svg%3E") 7 10, text;
}
.panel-body button,
.panel-body .tab-btn,
.panel-body .chip-btn,
.panel-body a,
.login-body button {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23ebe8e0' stroke='%231a1917' stroke-width='1.1' d='M4 3l1 12 3-4 3 5 2-1-3-5 5-1z'/%3E%3C/svg%3E") 2 2, pointer;
}
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  border-right: 1px solid var(--hairline);
}

.sidebar-brand {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 10px 20px;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}
.tab-active .ico-nav { color: var(--text); opacity: 1; }
.tab-btn:hover { background: var(--hover); color: var(--text); }
.tab-active {
  background: var(--active);
  color: var(--text);
}

.sidebar-foot {
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}
.account-wrap { position: relative; }
.account-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
}
.account-btn:hover { background: var(--hover); }
.account-btn.is-open { background: var(--active); }
.account-btn.is-open .ico-chevron { transform: rotate(180deg); }
.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--hairline);
}
.account-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.who-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge { font-size: 11px; color: var(--text-3); font-family: var(--mono); letter-spacing: 0.02em; }

.hmm-menu {
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: var(--menu);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  padding: 6px;
  min-width: 220px;
}
.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 6px;
}
.menu-head-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.menu-head-sub {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.menu-divider {
  height: 1px;
  background: var(--hairline);
  margin: 4px 6px;
}
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}
.menu-item:hover:not(:disabled) { background: var(--hover); }
.menu-item:disabled { opacity: 0.55; cursor: default; }
.menu-item-danger:hover:not(:disabled) { background: rgba(209, 123, 123, 0.1); color: #efcaca; }
.menu-item-ico {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}
.menu-item-ico .ico { width: 17px; height: 17px; }
.menu-item-label { flex: 1; min-width: 0; }
.menu-item-hint {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
}
.kbd-hint {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.2);
}

.workspace {
  flex: 1;
  min-width: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 20px 28px 36px;
  width: 100%;
}

.page-header {
  margin-bottom: 18px;
}
.page-desc {
  margin: 6px 0 0;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-3);
}

.view {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Stats — no boxes */
.stats-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--hairline);
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
}
.stat-val {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.block { /* section spacing only */ }

.block-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.block-head-tight { margin-bottom: 14px; }
.block-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--field);
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}
.block-ico .ico { width: 20px; height: 20px; color: var(--text-2); }
.block-head .block-title { margin: 0; }
.block-desc {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.45;
}

/* Settings rows (Claude-style) */
.settings {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.settings-compact .setting-row { padding: 8px 0; }
.settings-compact .setting-desc { margin-top: 2px; font-size: 12px; }
.settings-compact .setting-actions { padding-top: 12px; }
.setting-row:last-of-type { border-bottom: none; }
.setting-meta {
  flex: 1;
  min-width: 0;
  max-width: 280px;
}
.setting-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.setting-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-3);
}
.setting-control {
  flex: 0 1 260px;
  width: 100%;
  max-width: 260px;
  min-width: 0;
}
.setting-control-sm { max-width: 112px; flex-basis: 112px; }

#keys-form .setting-control-fixed,
#bin-form .setting-control-fixed {
  flex: 0 0 240px;
  width: 240px;
  max-width: 240px;
}
#keys-form .hmm-pick-host,
#bin-form .hmm-pick-host {
  max-width: none;
  width: 100%;
}
.bin-pack {
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 8px;
  width: 100%;
  align-items: stretch;
}
.bin-ver {
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}
#bin-form .setting-control-switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.hmm-file-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.hmm-file-stack .hmm-file-btn {
  width: 100%;
}
.hmm-file-stack .hmm-file-name {
  font-size: 12px;
  line-height: 1.35;
  max-width: 100%;
}
.dur-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.dur-days-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.dur-days-wrap input {
  flex: 1;
  min-width: 0;
}
.field-unit {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-3);
  font-family: var(--mono);
}

@media (min-width: 720px) {
  .settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
  }
  .settings-grid .setting-row-pair { grid-column: span 1; }
  .settings-grid .setting-row:not(.setting-row-pair),
  .settings-grid .setting-actions {
    grid-column: 1 / -1;
  }
}
.setting-control-sm input { text-align: left; }
.setting-control-fit { flex: 0 0 auto; max-width: none; display: flex; justify-content: flex-end; }
.setting-actions .btn { display: inline-flex; align-items: center; }
.setting-extra {
  margin-top: 10px;
  max-width: 200px;
}
.setting-actions {
  padding-top: 20px;
}
.segmented-wrap {
  flex-wrap: wrap;
  max-width: 100%;
}

.hmm-pick-host { max-width: 260px; }
.hmm-file-compact { gap: 8px; }
.hmm-file-compact .hmm-file-name { font-size: 13px; max-width: 180px; }
.hmm-pick { position: relative; }

.hmm-pick-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: var(--field);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}
.hmm-pick-trigger:hover { border-color: rgba(255, 255, 255, 0.18); }
.hmm-pick-trigger.is-open {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.hmm-pick-trigger-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hmm-pick-trigger-hint {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
  flex-shrink: 0;
}

.hmm-pick-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-3);
}

.hmm-pick-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 100%;
  background: var(--menu);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  padding: 4px;
}

.hmm-pick-search {
  width: calc(100% - 8px);
  margin: 4px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--field);
  padding: 8px 10px;
  font-size: 14px;
}
.hmm-pick-search:focus {
  border-color: var(--hairline);
  box-shadow: none;
}

.hmm-pick-list {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.hmm-pick-list::-webkit-scrollbar {
  width: 6px;
}
.hmm-pick-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}

.hmm-pick-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}
.hmm-pick-opt-label { flex: 1; min-width: 0; }
.hmm-pick-opt-end {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 72px;
}
.hmm-pick-hint {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
}
.hmm-pick-opt:hover,
.hmm-pick-opt.is-on {
  background: var(--hover);
}
.hmm-pick-check {
  width: 16px;
  height: 16px;
  color: var(--caret);
  flex-shrink: 0;
}
.hmm-pick-opt.is-on .hmm-pick-opt-label {
  color: var(--text);
}
.hmm-pick-check-spacer {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 14px;
  align-items: flex-end;
}
.field-sm { flex: 0 1 160px; min-width: 120px; }
.field-xs { flex: 0 1 88px; min-width: 72px; }
.field-grow { flex: 1 1 200px; min-width: 140px; }
.field-check { flex: 0 0 auto; }
.form-actions { flex: 0 0 auto; }

.check, .check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
}
.check-inline.hmm-switch-inline {
  gap: 10px;
  color: var(--text-2);
}
.check-inline-label { font-size: 14px; }
.check { padding: 8px 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.toolbar-wrap { row-gap: 12px; }

.search-field {
  position: relative;
  flex: 1 1 180px;
  max-width: 260px;
  min-width: 160px;
  display: flex;
  align-items: center;
}
.search-ico {
  position: absolute;
  left: 10px;
  display: flex;
  pointer-events: none;
}
.search-ico .ico { width: 16px; height: 16px; color: var(--text-3); }
.search-field .input-inline {
  padding-left: 34px;
  width: 100%;
  max-width: none;
}
.input-inline {
  flex: 1 1 140px;
  max-width: 220px;
  min-width: 120px;
  width: auto;
}
.input-narrow { max-width: 140px; }

/* Segmented control */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--hairline);
}
.chip-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 6px;
}
.chip-btn:hover { color: var(--text); }
.chip-active {
  color: var(--text);
  background: var(--active);
}

/* Table — the one box */
.table-frame {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.table-frame table {
  width: 100%;
  border-collapse: collapse;
}
.table-frame th,
.table-frame td {
  padding: 7px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.table-frame th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.15);
}
.table-frame tbody tr:last-child td { border-bottom: none; }
.table-frame tbody tr:hover td { background: var(--hover); }
.table-frame code {
  font-family: var(--mono);
  font-size: 13px;
}
.key-copy {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  vertical-align: middle;
  outline: none;
}
.key-copy:active .key-code { opacity: 0.88; }
.table-frame code.key-code {
  color: var(--claude-code);
  letter-spacing: 0.02em;
  pointer-events: none;
  padding: 3px 7px;
  margin: -3px -7px;
  border-radius: 5px;
  transition:
    color 0.14s ease,
    background-color 0.14s ease,
    box-shadow 0.14s ease;
}
.key-copy:hover .key-code,
.key-copy:focus-visible .key-code {
  color: #fff7f0;
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.cell-actions {
  text-align: right;
  white-space: nowrap;
}
.row-actions {
  display: inline-flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
}
.btn-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--ui);
  line-height: 1;
  color: var(--text-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.btn-row:hover {
  background: var(--hover);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
}
.btn-row-warn {
  color: #d9a0a0;
  border-color: rgba(209, 123, 123, 0.22);
}
.btn-row-warn:hover {
  color: #efcaca;
  background: rgba(209, 123, 123, 0.08);
  border-color: rgba(209, 123, 123, 0.35);
}
.btn-row-icon {
  min-width: 28px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 400;
  font-family: var(--ui);
}
.btn-row-danger {
  color: #d17b7b;
  border-color: rgba(209, 123, 123, 0.22);
}
.btn-row-danger:hover {
  color: #efcaca;
  background: rgba(209, 123, 123, 0.1);
}
.table-logs .log-txt {
  color: var(--claude-code);
  font-family: var(--mono);
  font-size: 13px;
}
.table-logs .log-dim { color: var(--claude-code-dim); }
.table-logs .log-detail {
  max-width: 420px;
  overflow-wrap: anywhere;
}
.table-logs .log-row td:nth-child(5) { max-width: 420px; }
.table-logs .log-row td:nth-child(6) {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-frame .muted { color: var(--text-3); }

.badge-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.status-ok   { color: var(--ok);   font-family: var(--mono); font-size: 13px; }
.status-warn { color: var(--warn); font-family: var(--mono); font-size: 13px; }
.status-bad  { color: var(--bad);  font-family: var(--mono); font-size: 13px; }
.status-mut  { color: var(--text-3); font-family: var(--mono); font-size: 13px; }

.empty-row td {
  text-align: center;
  padding: 32px !important;
  color: var(--text-3);
}

.toast-host {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 28px;
}
.toast-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(0, 0, 0, 0.22), transparent 72%),
    rgba(8, 8, 7, 0.12);
  backdrop-filter: blur(5px) saturate(105%);
  opacity: 0;
  transition: opacity 0.36s ease;
}
.toast-host.is-active .toast-scrim {
  opacity: 1;
}
.toast-banner {
  position: relative;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(440px, calc(100vw - 56px));
  padding: 10px 22px 12px 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.012em;
  color: rgba(245, 244, 239, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 38%),
    rgba(26, 25, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 22px 56px rgba(0, 0, 0, 0.48),
    0 4px 14px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px) saturate(125%);
  opacity: 0;
  transform: translateY(12px) scale(0.945);
  filter: blur(3px);
  transition:
    opacity 0.34s ease,
    transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.34s ease;
}
.toast-glyph {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  color: rgba(245, 244, 239, 0.92);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.toast-glyph svg {
  width: 16px;
  height: 16px;
  display: block;
}
.toast-msg {
  padding: 2px 0 4px;
  text-align: left;
  text-wrap: balance;
}
.toast-banner.is-copy .toast-msg {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.toast-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transform-origin: left center;
  transform: scaleX(1);
  opacity: 0.85;
}
.toast-progress.is-running {
  animation: toast-drain linear forwards;
}
@keyframes toast-drain {
  from { transform: scaleX(1); opacity: 0.9; }
  to { transform: scaleX(0); opacity: 0.35; }
}
.toast-banner.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}
.toast-banner.is-leaving {
  opacity: 0;
  transform: translateY(-6px) scale(0.975);
  filter: blur(2px);
  transition-duration: 0.32s;
}
.toast-banner.is-ok .toast-glyph {
  color: #1a1917;
  background: linear-gradient(165deg, #f0ebe3 0%, #e8e2d8 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.12);
}
.toast-banner.is-ok .toast-progress.is-running {
  background: linear-gradient(90deg, var(--claude-code-muted), rgba(232, 149, 111, 0.15));
}
.toast-banner.is-copy .toast-glyph {
  color: var(--claude-code);
  background: rgba(232, 149, 111, 0.12);
  box-shadow: inset 0 0 0 1px rgba(232, 149, 111, 0.22);
}
.toast-banner.is-copy .toast-progress.is-running {
  background: linear-gradient(90deg, var(--claude-code-dim), rgba(232, 149, 111, 0.12));
}
.toast-banner.is-err {
  color: rgba(248, 236, 236, 0.94);
  border-color: rgba(209, 123, 123, 0.28);
  background:
    linear-gradient(180deg, rgba(209, 123, 123, 0.1) 0%, rgba(209, 123, 123, 0) 42%),
    rgba(28, 24, 24, 0.94);
}
.toast-banner.is-err .toast-glyph {
  color: #f2d4d4;
  background: rgba(209, 123, 123, 0.16);
  box-shadow: inset 0 0 0 1px rgba(209, 123, 123, 0.28);
}
.toast-banner.is-err .toast-progress.is-running {
  background: linear-gradient(90deg, rgba(209, 123, 123, 0.55), rgba(209, 123, 123, 0.12));
}
@media (prefers-reduced-motion: reduce) {
  .toast-banner,
  .toast-scrim {
    transition-duration: 0.01ms !important;
  }
  .toast-banner.is-visible,
  .toast-banner.is-leaving {
    transform: none;
    filter: none;
  }
  .toast-progress.is-running {
    animation: none;
    transform: scaleX(0);
  }
}

body.hmm-modal-open { overflow: hidden; }

.hmm-confirm {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}
.hmm-confirm-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(10, 10, 9, 0.62);
  backdrop-filter: blur(6px);
  cursor: default;
}
.hmm-confirm-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 22px 22px 18px;
  background: #1e1d1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: hmm-dialog-in 0.16s ease-out;
}
@keyframes hmm-dialog-in {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.hmm-confirm-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}
.hmm-confirm-msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.hmm-confirm-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.btn-dialog-ghost,
.btn-dialog-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}
.btn-dialog-ghost {
  color: var(--text-2);
  border: 1px solid transparent;
}
.btn-dialog-ghost:hover {
  color: var(--text);
  background: var(--hover);
  border-color: var(--hairline);
}
.btn-dialog-ok {
  background: #ebe8e0;
  color: #1a1917;
  border: 1px solid transparent;
}
.btn-dialog-ok:hover { background: #f5f3ec; }
.btn-dialog-ok .ico-dialog { color: #1a1917; opacity: 0.7; }
.btn-dialog-ghost .ico-dialog { opacity: 0.75; }

.hmm-confirm-danger .btn-dialog-ok {
  background: rgba(209, 123, 123, 0.14);
  color: #f2d0d0;
  border-color: rgba(209, 123, 123, 0.35);
}
.hmm-confirm-danger .btn-dialog-ok:hover {
  background: rgba(209, 123, 123, 0.22);
  color: #ffeaea;
}
.hmm-confirm-danger .btn-dialog-ok .ico-dialog { color: currentColor; opacity: 0.85; }

.ico-dialog { width: 15px; height: 15px; flex-shrink: 0; }

@media (max-width: 800px) {
  .setting-row {
    flex-direction: column;
    gap: 12px;
  }
  .setting-meta { max-width: none; }
  .setting-control { max-width: none; flex-basis: auto; }
  .setting-control-sm { max-width: none; }
  .setting-control-fit { justify-content: flex-start; }
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
  }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .tab-btn { width: auto; flex: 1; text-align: center; min-width: 80px; }
  .page { padding: 24px 16px 48px; }
  .page-title { font-size: 24px; }
}
