:root {
  font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
  color: #35445d;
  background: #f7f8fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --muted: #8c9fba;
  --border: #ccd6e4;
  --accent: #f5a800;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

.page { width: min(1080px, calc(100% - 64px)); margin: 76px auto; }
.form-card {
  background: #fff;
  border: 1px solid #dce3ed;
  border-radius: 16px;
  padding: 38px 40px 32px;
  box-shadow: 0 4px 24px #24364b04;
}
label { display: block; font-size: 17px; font-weight: 600; line-height: 1.5; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 3px 0 12px; }
input, textarea {
  display: block;
  width: 100%;
  color: #35445d;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input { height: 51px; padding: 0 16px; font-size: 16px; }
textarea {
  min-height: 280px;
  padding: 16px;
  resize: vertical;
  font: 15px/1.8 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
input::placeholder, textarea::placeholder { color: #94a6c0; opacity: 1; }
input:hover, textarea:hover { border-color: #a8b8cc; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #ffb80019; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #dc6262; }
input:disabled, textarea:disabled { background: #fafbfd; color: #728097; }
.url-field { margin-top: 27px; }
.label-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.limit { font-size: 12px; color: #98a7ba; }
.field-error { font-size: 13px; color: #c33b3b; line-height: 1.6; margin: 8px 0 0; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 25px; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 134px;
  min-height: 46px;
  padding: 11px 24px;
  border: 1px solid #efa500;
  border-radius: 8px;
  background: #ffb900;
  color: #3d310d;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}
button:hover:not(:disabled) { background: #ffca35; box-shadow: 0 3px 10px #b17b0018; }
button:focus-visible { outline: 3px solid #f9ca59; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .65; }
.send-icon { width: 17px; height: 17px; }
.spinner { width: 16px; height: 16px; border: 2px solid #3d310d30; border-top-color: #3d310d; border-radius: 50%; animation: spin .8s linear infinite; }
.result { display: flex; align-items: flex-start; gap: 12px; padding: 15px 17px; margin-top: 20px; border: 1px solid #bde4cb; border-radius: 9px; color: #246c42; background: #f3fbf6; }
.result.error { border-color: #f0cdcd; color: #a83d3d; background: #fff7f7; }
.result-icon { flex-shrink: 0; width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-size: 12px; line-height: 1; margin-top: 1px; }
.result-copy { min-width: 0; }
.result p { margin: 0; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
#result-title { font-weight: 600; }
#result-detail { margin-top: 3px; opacity: .9; }
noscript { display: block; margin-top: 18px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .page { width: calc(100% - 28px); margin: 24px auto; }
  .form-card { padding: 25px 20px 22px; border-radius: 12px; }
  label { font-size: 16px; }
  .hint { font-size: 13px; }
  .limit { font-size: 10px; }
  input { font-size: 16px; }
  textarea { min-height: 300px; font-size: 14px; }
  .form-actions { margin-top: 20px; }
  button { width: 100%; min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 2s !important; }
}

h1 { margin: 0; color: #2d3c53; font-size: 25px; font-weight: 600; letter-spacing: -.4px; line-height: 1.4; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
.section-description { margin: 8px 0 26px; color: #8596ac; font-size: 14px; line-height: 1.65; }
.loading-view { padding: 100px 20px; text-align: center; color: #8c9fba; font-size: 14px; }
.login-card { width: min(100%, 460px); margin: 56px auto; padding: 38px; }
.login-mark { width: 46px; height: 46px; display: grid; place-items: center; background: #fff4d4; color: #b47e00; border-radius: 12px; margin-bottom: 22px; }
.login-mark svg { width: 25px; height: 25px; }
.stack-form { display: flex; flex-direction: column; gap: 22px; }
.stack-form label { font-size: 14px; margin-bottom: 8px; }
.stack-form .hint { margin-top: -3px; margin-bottom: 10px; font-size: 12px; }
.stack-form .form-actions { margin-top: 0; }
.narrow-form { max-width: 520px; }
.full-width { width: 100%; }
.form-message { margin: 0; padding: 12px 14px; border: 1px solid #f0cdcd; background: #fff7f7; color: #a83d3d; font-size: 13px; line-height: 1.65; border-radius: 8px; overflow-wrap: anywhere; }
.form-message.success { border-color: #bde4cb; background: #f3fbf6; color: #246c42; }
.app-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.account-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-identity > div { min-width: 0; }
.account-avatar { flex-shrink: 0; display: grid; place-items: center; width: 42px; height: 42px; background: #fff1cb; color: #9a7000; border: 1px solid #f2dfa4; border-radius: 50%; font-size: 16px; font-weight: 600; }
.account-name { margin: 0; color: #35445d; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.account-role { margin: 3px 0 0; font-size: 12px; color: #8c9fba; }
.button-quiet { min-width: 0; min-height: 38px; padding: 8px 14px; font-size: 12px; color: #6e7f96; background: transparent; border: 1px solid #dce3ed; white-space: nowrap; }
.button-quiet:hover:not(:disabled) { background: #fff; box-shadow: none; }
.app-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.nav-button { min-width: 0; min-height: 40px; padding: 9px 17px; border: 1px solid transparent; color: #8090a7; background: transparent; font-size: 13px; }
.nav-button:hover:not(:disabled) { background: #f0f2f5; box-shadow: none; }
.nav-button.active { border-color: #e7dba9; color: #8a690f; background: #fff7df; }
.admin-grid { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); gap: 44px; }
.admin-create > .hint { margin-top: 7px; margin-bottom: 24px; font-size: 12px; }
.admin-directory { padding-left: 30px; border-left: 1px solid #edf0f5; }
.count-badge { display: inline-grid; place-items: center; min-width: 25px; min-height: 25px; padding: 2px 7px; border-radius: 7px; background: #f2f4f7; color: #8392a7; font-size: 12px; }
.users-list { margin-top: 18px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 0; border-bottom: 1px solid #edf0f5; }
.user-copy { min-width: 0; }
.user-name { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.user-username { margin: 4px 0 0; font-size: 12px; color: #91a0b5; overflow-wrap: anywhere; }
.user-status { margin: 7px 0 0; font-size: 11px; color: #389563; }
.user-status.inactive { color: #a78b73; }
.user-row button { flex-shrink: 0; }
.empty-state { padding: 26px 0; margin: 0; color: #91a0b5; font-size: 13px; line-height: 1.7; }
.admin-directory > .form-message { margin-top: 16px; }
@media (max-width: 800px) {
  .admin-grid { grid-template-columns: 1fr; gap: 32px; }
  .admin-directory { border-left: 0; padding-left: 0; border-top: 1px solid #edf0f5; padding-top: 27px; }
}
@media (max-width: 600px) {
  .login-card { margin: 50px auto; padding: 28px 24px; }
  .app-header { margin: 6px 4px 20px; }
  .account-name { font-size: 14px; }
  .account-avatar { width: 36px; height: 36px; font-size: 14px; }
  .account-identity { gap: 9px; }
  .app-header .button-quiet, .user-row .button-quiet { width: auto; min-height: 38px; }
  .app-nav { gap: 2px; margin-bottom: 14px; }
  .nav-button { width: auto; min-height: 40px; padding: 9px 12px; font-size: 12px; }
  h1 { font-size: 22px; }
  .section-description { font-size: 13px; }
}

.domains-add > .hint { margin: 8px 0 24px; font-size: 12px; }
.domain-bulk-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.domain-bulk-actions button { min-width: 0; width: 100%; padding-inline: 12px; }
.button-delete-outline { border-color: #e8baba; color: #b94444; background: #fff; }
.button-delete-outline:hover:not(:disabled) { background: #fff1f1; box-shadow: none; }
#domains-input { min-height: 190px; font-size: 14px; }
.domains-list { margin-top: 18px; }
.domain-row { padding: 17px 0; border-bottom: 1px solid #edf0f5; }
.domain-row-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.domain-copy { min-width: 0; }
.domain-name { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.domain-scope { margin: 5px 0 0; font-size: 11px; color: #91a0b5; }
.row-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 7px; }
.row-actions .button-quiet { padding: 7px 12px; min-height: 34px; }
.button-danger-quiet { color: #bd5a5a; border-color: #ecd9d9; }
.button-danger-quiet:hover:not(:disabled) { background: #fff7f7; }
.button-small { min-width: 0; min-height: 35px; padding: 8px 14px; font-size: 12px; }
.button-danger { background: #bd4c4c; border-color: #b44747; color: #fff; }
.button-danger:hover:not(:disabled) { background: #ab3f3f; box-shadow: none; }
.domain-edit-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.domain-edit-form label { font-size: 12px; }
.domain-edit-form input { height: 43px; margin-top: 7px; font-size: 14px; }
.delete-confirmation { display: flex; flex-direction: column; gap: 12px; padding: 14px; margin-top: 14px; background: #fff8f8; border: 1px solid #f0dddd; border-radius: 8px; }
.delete-confirmation > p:not(.form-message) { margin: 0; font-size: 12px; color: #925858; line-height: 1.6; }
@media (max-width: 600px) {
  .app-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .nav-button { width: 100%; }
  .row-actions button { width: auto; }
  .domain-row-header { align-items: flex-start; }
  .domain-row-header .row-actions { gap: 5px; }
  .domain-row-header .button-quiet { padding: 6px 9px; }
}
