:root {
  --bg: #f3f5f1;
  --panel: #fffefb;
  --green: #7fd39b;
  --green-deep: #57b878;
  --green-soft: #e8f6ed;
  --ink: #17382d;
  --ink-deep: #10281f;
  --muted: #758079;
  --muted-light: #a0a7a2;
  --line: #d8ddd8;
  --line-dark: #bfc6c0;
  --danger: #bd493b;
  --success: #3b9160;
  --shadow: 0 22px 60px rgba(34, 55, 43, 0.1);
  --font: "Avenir Next", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 5%, rgba(206, 232, 213, 0.65), transparent 28rem),
    radial-gradient(circle at 92% 82%, rgba(241, 222, 209, 0.55), transparent 24rem),
    var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-glow {
  position: fixed;
  z-index: -1;
  border: 1px solid rgba(23, 56, 45, 0.065);
  border-radius: 50%;
  pointer-events: none;
}

.page-glow-one {
  top: -260px;
  left: -220px;
  width: 560px;
  height: 560px;
}

.page-glow-two {
  right: -260px;
  bottom: -260px;
  width: 600px;
  height: 600px;
}

.noscript {
  padding: 10px;
  background: var(--danger);
  color: white;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  box-shadow: 0 7px 17px rgba(23, 56, 45, 0.18);
}

.brand-mark svg {
  width: 21px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--muted-light);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.simple-header,
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-hint {
  color: var(--muted);
  font-size: 11px;
}

/* Login */

.login-screen {
  width: min(1120px, calc(100% - 44px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 23px 0;
  display: flex;
  flex-direction: column;
}

.login-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 16px;
  min-height: 590px;
  margin: 22px 0;
}

.login-visual,
.login-card {
  border-radius: 27px;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 52px 50px 31px;
  background: var(--ink-deep);
  color: white;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.login-visual::before {
  content: "";
  position: absolute;
  z-index: -2;
  right: -100px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: var(--green);
}

.visual-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
}

.visual-orbit-one {
  right: -95px;
  bottom: -115px;
  width: 380px;
  height: 380px;
}

.visual-orbit-two {
  right: 42px;
  bottom: -205px;
  width: 310px;
  height: 310px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.eyebrow > span {
  width: 20px;
  height: 1px;
  background: currentColor;
}

.eyebrow-light {
  color: rgba(255, 255, 255, 0.4);
}

.login-visual h1 {
  margin: 0;
  font-size: clamp(39px, 5vw, 62px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.login-visual h1 em {
  color: var(--green);
  font-family: "Songti SC", "STSong", serif;
  font-weight: 400;
}

.visual-lead {
  max-width: 410px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.53);
  font-size: 12px;
  line-height: 1.85;
}

.visual-terminal {
  width: min(410px, 94%);
  margin: 30px 0 27px;
  padding: 17px 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
}

.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-brand {
  color: rgba(255, 255, 255, 0.54);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.terminal-live {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.terminal-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.terminal-number {
  margin: 19px 0 15px;
  color: white;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.terminal-message {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-message span {
  color: rgba(255, 255, 255, 0.32);
  font-size: 7px;
}

.terminal-message p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.77);
  font-size: 10px;
}

.terminal-message strong {
  color: var(--green);
  font-size: 15px;
  letter-spacing: 0.1em;
}

.visual-features {
  display: flex;
  gap: 20px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.visual-features span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 1px;
}

.login-card {
  display: grid;
  place-items: center;
  padding: 42px 48px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 254, 251, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-card-inner {
  width: min(100%, 365px);
}

.login-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 21px;
  border-radius: 13px;
  background: var(--green-soft);
  color: var(--ink);
}

.login-icon svg {
  width: 20px;
}

.login-kicker {
  margin: 0 0 5px;
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 700;
}

.login-card h2 {
  margin: 0 0 7px;
  color: var(--ink-deep);
  font-size: 27px;
  letter-spacing: -0.04em;
}

.login-description {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.login-form {
  margin-top: 29px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
}

.login-label-row label {
  margin: 0 0 8px;
}

.login-label-row span {
  margin-bottom: 8px;
  color: var(--muted-light);
  font-size: 8px;
}

.login-input {
  height: 49px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-input:focus-within {
  border-color: var(--green-deep);
  box-shadow: 0 0 0 3px rgba(127, 211, 155, 0.15);
}

.login-input > svg {
  width: 17px;
  flex: 0 0 auto;
  margin-left: 14px;
  color: var(--muted-light);
}

.login-input input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.login-input input::placeholder {
  color: #adb3ae;
}

.login-input button {
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.login-message {
  min-height: 17px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 9px;
  line-height: 1.6;
}

.green-button {
  position: relative;
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.green-button:hover:not(:disabled) {
  background: var(--green-deep);
  box-shadow: 0 8px 18px rgba(87, 184, 120, 0.2);
  transform: translateY(-1px);
}

.green-button:active:not(:disabled) {
  transform: translateY(0);
}

.green-button:disabled {
  opacity: 0.55;
}

.login-submit {
  width: 100%;
  height: 50px;
  border-radius: 11px;
  font-size: 12px;
}

.spinner {
  position: absolute;
  right: 17px;
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}

.is-loading .spinner {
  display: block;
}

.login-security {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 8px;
  line-height: 1.6;
}

.login-security svg {
  width: 14px;
}

.simple-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 8px;
}

/* Workspace */

.workspace {
  width: min(1180px, calc(100% - 52px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 22px 0 27px;
}

.app-header {
  min-height: 40px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.connection-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c09142;
}

.connection-status.ready i {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(59, 145, 96, 0.12);
}

.connection-status.error i {
  background: var(--danger);
}

.user-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
}

.user-name {
  color: var(--muted);
  font-size: 9px;
}

.logout-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.logout-button svg {
  width: 14px;
}

.tool-main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 54px 0 45px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 0;
  color: var(--ink-deep);
  font-size: clamp(35px, 5vw, 47px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.page-heading > div > p:last-child {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.balance-box {
  min-width: 132px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  text-align: left;
}

.balance-box span {
  display: block;
  color: var(--muted-light);
  font-size: 8px;
}

.balance-box strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.terminal-card {
  padding: 25px 25px 23px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: rgba(255, 254, 251, 0.92);
  box-shadow: 0 20px 55px rgba(35, 54, 43, 0.075);
  backdrop-filter: blur(15px);
}

.card-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 21px;
}

.card-titlebar > div > span {
  color: var(--muted-light);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.card-titlebar h2 {
  margin: 4px 0 0;
  color: var(--ink-deep);
  font-size: 18px;
  letter-spacing: -0.03em;
}

.api-mode {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fbf2df;
  color: #987137;
  font-size: 7px;
  font-weight: 700;
}

.api-mode.ready {
  background: var(--green-soft);
  color: var(--success);
}

.form-row {
  display: flex;
  gap: 9px;
  margin-top: 9px;
}

.form-row:first-of-type {
  margin-top: 0;
}

.field {
  position: relative;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.field > span:first-child {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: white;
  color: var(--ink);
  font-size: 11px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input {
  padding: 0 12px;
}

.field input::placeholder {
  color: #acb1ad;
}

.field input:focus,
.field select:focus {
  border-color: var(--green-deep);
  box-shadow: 0 0 0 3px rgba(127, 211, 155, 0.13);
}

.keyword-row > .green-button,
.phone-row > .green-button {
  align-self: flex-end;
  flex: 0 0 42%;
}

.split-row > * {
  flex: 1;
  min-width: 0;
}

.select-field {
  gap: 0;
}

.select-field > span:first-child {
  position: absolute;
  top: 9px;
  left: 12px;
  z-index: 1;
  color: var(--muted-light);
  font-size: 6px;
  pointer-events: none;
}

.select-field select {
  padding: 12px 31px 0 11px;
  appearance: none;
  cursor: pointer;
}

.select-arrow {
  position: absolute;
  top: 24px;
  right: 13px;
  width: 0;
  height: 0;
  border-top: 5px solid var(--ink);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  pointer-events: none;
}

.order-strip {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  padding: 7px 11px;
  border: 1px solid rgba(87, 184, 120, 0.2);
  border-radius: 7px;
  background: var(--green-soft);
  animation: rise-in 250ms ease both;
}

.order-strip-mark {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--green-deep);
  color: white;
  font-size: 8px;
  font-weight: 800;
}

.order-strip > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-strip > div strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-strip > div span {
  color: var(--muted);
  font-size: 7px;
}

.order-timer {
  margin-left: auto;
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.order-state {
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--success);
  font-size: 7px;
  font-weight: 700;
}

.sms-box-wrap {
  position: relative;
  margin-top: 9px;
}

.sms-box-wrap textarea {
  width: 100%;
  min-height: 180px;
  display: block;
  resize: vertical;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: white;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.75;
}

.sms-box-wrap textarea:focus {
  border-color: var(--green-deep);
}

.sms-box-wrap textarea:not(:placeholder-shown) + .sms-empty {
  display: none;
}

.sms-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--muted-light);
  text-align: center;
}

.sms-empty strong {
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
}

.sms-empty small {
  margin-top: 4px;
  font-size: 7px;
}

.waiting-dots {
  display: flex;
  gap: 4px;
}

.waiting-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-deep);
  animation: dot-pulse 900ms ease-in-out infinite alternate;
}

.waiting-dots i:nth-child(2) {
  animation-delay: 160ms;
}

.waiting-dots i:nth-child(3) {
  animation-delay: 320ms;
}

.receive-button {
  width: 100%;
  margin-top: 9px;
}

.secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(23, 56, 45, 0.08);
}

.soft-button {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease;
}

.soft-button:hover:not(:disabled) {
  background: var(--green-deep);
}

.soft-button:disabled {
  opacity: 0.5;
}

.quick-keywords {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}

.quick-keywords > span {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-size: 7px;
}

.quick-keywords > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.keyword-chip {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 7px;
  cursor: pointer;
}

.keyword-chip:hover {
  border-color: var(--green-deep);
  color: var(--ink);
}

.page-note {
  margin: 14px 3px 0;
  color: var(--muted-light);
  font-size: 7px;
  line-height: 1.7;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 31, 24, 0.47);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(500px, 100%);
  max-height: min(720px, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(9, 26, 19, 0.28);
  animation: modal-in 200ms ease both;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 21px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header > div > span {
  color: var(--muted-light);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.modal-header h2 {
  margin: 4px 0 0;
  color: var(--ink-deep);
  font-size: 19px;
  letter-spacing: -0.03em;
}

.modal-header button {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modal-header button svg {
  width: 13px;
}

.modal-body {
  overflow-y: auto;
  padding: 19px 22px;
}

.modal-body p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.85;
}

.modal-body .hint-box {
  margin-top: 13px;
  padding: 12px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--ink);
  font-size: 9px;
  line-height: 1.75;
}

.modal-form {
  display: grid;
  gap: 13px;
}

.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.modal-form input,
.modal-form textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: white;
  color: var(--ink);
  font-size: 10px;
}

.modal-form textarea {
  min-height: 95px;
  resize: vertical;
}

.modal-form input:focus,
.modal-form textarea:focus {
  border-color: var(--green-deep);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 22px 20px;
}

.modal-footer:empty {
  display: none;
}

.modal-footer .green-button,
.modal-footer .plain-button {
  min-width: 105px;
}

.plain-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.record-list,
.message-library {
  display: grid;
  gap: 8px;
}

.record-item {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 245, 0.7);
}

.record-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--muted-light);
  font-size: 7px;
}

.record-item p {
  color: var(--ink);
  font-size: 9px;
  word-break: break-word;
}

.record-code {
  display: inline-block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.empty-record {
  padding: 35px 12px;
  color: var(--muted-light);
  font-size: 9px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 40;
  bottom: max(23px, env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100% - 30px);
  padding: 10px 15px;
  border-radius: 9px;
  background: var(--ink-deep);
  color: white;
  font-size: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.workspace.reveal {
  animation: rise-in 350ms ease both;
}

.login-card.shake {
  animation: shake 300ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(127, 211, 155, 0.35);
  outline-offset: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes dot-pulse {
  from { opacity: 0.3; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(-2px); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

@media (max-width: 860px) {
  .login-screen {
    width: min(720px, calc(100% - 30px));
  }

  .login-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-visual {
    min-height: 370px;
    padding: 40px 34px 27px;
  }

  .login-card {
    padding: 38px 32px;
  }

  .tool-main {
    padding-top: 43px;
  }
}

@media (max-width: 600px) {
  .login-screen,
  .workspace {
    width: 100%;
    padding-right: max(15px, env(safe-area-inset-right));
    padding-left: max(15px, env(safe-area-inset-left));
  }

  .login-screen {
    padding-top: max(15px, env(safe-area-inset-top));
  }

  .header-hint,
  .user-name
  {
    display: none;
  }

  .login-layout {
    gap: 11px;
    margin: 17px 0;
  }

  .login-visual,
  .login-card {
    border-radius: 21px;
  }

  .login-visual {
    min-height: 320px;
    padding: 32px 24px 24px;
  }

  .login-visual h1 {
    font-size: clamp(33px, 10.5vw, 41px);
  }

  .visual-lead {
    font-size: 10px;
  }

  .visual-terminal {
    margin: 23px 0 20px;
  }

  .terminal-number {
    font-size: 17px;
  }

  .visual-features {
    gap: 12px;
    font-size: 7px;
  }

  .login-card {
    padding: 29px 23px 25px;
    place-items: start center;
  }

  .login-card h2 {
    font-size: 24px;
  }

  .app-header {
    padding-top: max(0px, env(safe-area-inset-top));
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-copy small {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .connection-status {
    max-width: 112px;
    padding: 6px 8px;
  }

  #connection-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-avatar {
    display: none;
  }

  .logout-button {
    width: 28px;
    height: 28px;
  }

  .tool-main {
    padding: 37px 0 31px;
  }

  .page-heading {
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 17px;
  }

  .page-heading h1 {
    font-size: 35px;
  }

  .page-heading > div > p:last-child {
    max-width: 230px;
    font-size: 9px;
    line-height: 1.65;
  }

  .balance-box {
    min-width: 105px;
    padding-left: 12px;
  }

  .balance-box strong {
    font-size: 17px;
  }

  .terminal-card {
    padding: 19px 15px 18px;
    border-radius: 15px;
  }

  .card-titlebar {
    margin-bottom: 18px;
  }

  .card-titlebar h2 {
    font-size: 17px;
  }

  .form-row {
    gap: 7px;
  }

  .keyword-row > .green-button,
  .phone-row > .green-button {
    flex-basis: 45%;
  }

  .field input,
  .field select,
  .green-button {
    min-height: 43px;
  }

  .sms-box-wrap textarea {
    min-height: 190px;
  }

  .secondary-actions {
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
  }

  .soft-button {
    min-height: 42px;
  }

  .quick-keywords {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .simple-footer {
    gap: 15px;
  }

  .modal-card {
    max-height: calc(100dvh - 24px);
    border-radius: 15px;
  }
}

@media (max-width: 370px) {
  .connection-status {
    display: none;
  }

  .login-visual {
    min-height: 300px;
  }

  .order-state {
    display: none;
  }

  .visual-features span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
