.card { padding: 24px; }
[data-task-panel][hidden] { display: none !important; }
.premium-content > .card + .card { margin-top: 0; }

form { min-width: 0; }
label {
  display: block;
  min-width: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
input:not([type=checkbox]):not([type=radio]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--cvh-control-height);
  margin: 7px 0 16px;
  padding: 9px 12px;
  border: 1px solid #d7deea;
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 500;
  line-height: 1.45;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
textarea { min-height: 112px; resize: vertical; }
input:not([type=checkbox]):not([type=radio]):not([type=file]),
select {
  height: var(--cvh-control-height);
  box-sizing: border-box;
  line-height: 1.35;
}
.ts-wrapper {
  width: 100%;
  max-width: 380px;
  margin: 7px 0 16px;
}
.ts-wrapper.single {
  height: var(--cvh-control-height);
  min-height: var(--cvh-control-height);
}
.form-field-short .ts-wrapper { max-width: 220px; }
.form-field-medium .ts-wrapper { max-width: 460px; }
.form-field-long .ts-wrapper { max-width: 760px; }
.form-field-full .ts-wrapper { max-width: 100%; }
.ts-wrapper.single .ts-control {
  height: var(--cvh-control-height);
  min-height: var(--cvh-control-height);
  box-sizing: border-box;
  flex-wrap: nowrap;
  align-items: center;
  padding: 0 38px 0 12px;
  border: 1px solid #d7deea;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: none;
}
.ts-wrapper.single .ts-control > .item {
  overflow: hidden;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ts-wrapper.single .ts-control::after { right: 13px; border-width: 5px 4px 0; border-color: #64748b transparent transparent; }
.ts-wrapper.focus .ts-control {
  border-color: #5898ff;
  box-shadow: 0 0 0 3px rgb(50 109 245 / 13%);
}
.ts-dropdown {
  z-index: 1060;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid #dbe2ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgb(15 23 42 / 16%);
  color: #334155;
  font-size: 13px;
  overflow: hidden;
}
.ts-dropdown .option {
  margin: 1px 0;
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 550;
}
.ts-dropdown .option.active { background: #eef5ff; color: #214eea; }
.ts-dropdown .option.selected { background: #214eea; color: #fff; }
.ts-dropdown .no-results { padding: 14px 10px; color: #64748b; text-align: center; }
.ts-control > input { min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
.tomselected[aria-invalid="true"] + .ts-wrapper .ts-control { border-color: #e11d48; box-shadow: 0 0 0 3px rgb(225 29 72 / 10%); }
.interval-input .ts-wrapper { min-width: 130px; max-width: none; margin: 7px 0 10px; }
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: #bbc5d5; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus {
  border-color: #5898ff;
  box-shadow: 0 0 0 3px rgb(50 109 245 / 13%);
}
input::placeholder, textarea::placeholder { color: #9aa6b7; font-weight: 400; }
input:disabled, select:disabled, textarea:disabled { background: #f2f4f7; color: #7b8797; cursor: not-allowed; }
input[type=checkbox], input[type=radio] { accent-color: var(--cvh-indigo); }

.form-field { width: 100%; }
[data-registration-form] .registration-password-field { margin-bottom: 16px; }
[data-registration-form] .registration-password-control { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
[data-registration-form] .registration-password-control > input { flex: 1; min-width: 0; margin: 0; }
[data-registration-form] .registration-password-toggle { display: flex; align-items: center; justify-content: center; flex: 0 0 44px; min-width: 44px; width: 44px; height: var(--cvh-control-height); padding: 0; margin: 0; }
[data-registration-form] .registration-password-toggle:focus-visible { outline: 3px solid #7495ff; outline-offset: 2px; }
[data-registration-form] .registration-password-field .field-help { margin: 6px 0 0; }
[data-registration-form] .registration-field-error { display: block; margin-top: 6px; color: #b4233a; font-size: 12px; font-weight: 500; line-height: 1.5; }
[data-registration-form] .registration-field-error[hidden], [data-registration-form] .registration-password-toggle[hidden] { display: none; }
.form-field-short { max-width: 220px; }
.form-field-medium { max-width: 460px; }
.form-field-long { max-width: 760px; }
.form-field-full { max-width: 100%; }
form > label > input:not([type=checkbox]):not([type=radio]):not([type=file]) { max-width: 760px; }
form > label > input[type=number] { max-width: 180px; }
form > label > input[type=datetime-local] { max-width: 340px; }
form > label > select { max-width: 380px; }
.settings-grid > label { max-width: 520px; }
.settings-grid > label > input[type=number] { max-width: 180px; }
.settings-grid > label > input[type=datetime-local] { max-width: 340px; }
.settings-grid > label > select { max-width: 380px; }
.compact-select { max-width: 380px; }
.profile-preference-field { align-self: start; min-width: 0; }
.profile-preference-field > label { display: block; width: fit-content; }
.profile-preference-field > select,
.profile-preference-field > .ts-wrapper { width: fit-content; max-width: 100%; }
.profile-timezone-field > .ts-wrapper,
.profile-timezone-field > select { width: min(300px, 100%); }
.profile-preference-field > .field-help { display: block; max-width: 520px; }
.recurring-task-name { max-width: 520px; }
.recurring-timing-row {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
  margin-top: 2px;
}
.recurring-timing-row > label { min-width: 0; }

form > button:last-child { margin-top: 2px; }
.form-check { display: flex; align-items: flex-start; gap: 9px; margin: 8px 0; font-weight: 500; }
.form-check-input { flex: 0 0 auto; margin-top: 2px; }
.channel-picker { margin: 18px 0; padding: 17px 18px; border: 1px solid var(--cvh-border); border-radius: 12px; background: #f8fafc; }
.channel-picker > strong { display: block; margin-bottom: 10px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}
.settings-grid > * { min-width: 0; }
.settings-grid > .reminder-title-row { grid-column: 1 / -1; }
.premium-content > .settings-grid { gap: 18px; }
.premium-content > .settings-grid > .card { height: 100%; }

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin: 0 0 22px;
}
.filter-bar input, .filter-bar select, .filter-bar button { margin-bottom: 0; }

.inline {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}
.inline form { margin: 0; }
.inline input:not([type=checkbox]):not([type=radio]),
.inline select { width: auto; min-width: 120px; flex: 1 1 140px; margin: 0; }
.inline button { flex: 0 0 auto; }
td > form + form { margin-top: 10px; }
form[id^="product-"] {
  display: grid;
  grid-template-columns: minmax(90px, 130px) minmax(90px, 130px) auto;
  gap: 12px;
  align-items: end;
}
form[id^="product-"] input { margin-bottom: 0; }
form[id^="product-"] label:last-child { display: flex; min-height: var(--cvh-control-height); align-items: center; gap: 8px; padding-bottom: 1px; }

.table-wrap { width: 100%; min-width: 0; overflow: auto; }
.api-key-value { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.api-key-value code { display: block; max-width: min(680px, 65vw); overflow-wrap: anywhere; white-space: normal; user-select: all; }
.api-key-value button { flex: 0 0 auto; }
.task-edit-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 70px rgba(15, 23, 42, .24); }
.task-edit-dialog::backdrop { background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); }
.task-edit-dialog > form { padding: 26px; overflow: auto; max-height: calc(100vh - 48px); }
.task-edit-dialog .dialog-actions { justify-content: flex-end; margin-top: 24px; }
.card.table-wrap { padding: 0; overflow: auto; }
.card.table-wrap > h2, .card.table-wrap > .top { padding: 22px 24px 14px; }
.card.table-wrap > h2 { margin: 0; }
.card.table-wrap > table, .card.table-wrap > .table-wrap { margin: 0; }
.card > .table-wrap { margin-right: -24px; margin-left: -24px; width: calc(100% + 48px); }
table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; }
th, td { display: table-cell; padding: 15px 20px; border-bottom: 1px solid #e3e8f0; vertical-align: middle; text-align: left; }
th {
  border-bottom-color: #d9e0ea;
  background: #f7f9fc;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
table tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .14s ease; }
tbody tr:hover { background: #fafbfe; }
td { color: #334155; line-height: 1.5; }
td.code {
  max-width: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #26344d;
  font-size: 12px;
  white-space: nowrap;
}
td .code { white-space: normal; }
.billing-order-number { white-space: nowrap; }
.billing-history-table table { min-width: 1080px; }
.billing-history-table td:nth-child(5), .billing-history-table td:nth-child(6), .billing-history-table td:nth-child(7) { white-space: nowrap; }
.empty { padding: 42px 24px !important; color: #64748b; text-align: center; }
.empty-state-icon { display: block; margin: 0 auto 9px; color: #94a3b8; font-size: 28px; }
.soon { padding: 60px 22px; text-align: center; }
.soon strong { display: block; margin-bottom: 8px; font-size: 28px; }

@media (max-width: 991.98px) {
  .settings-grid { grid-template-columns: 1fr; }
  .premium-content > .settings-grid { gap: 18px; }
  .filter-bar { grid-template-columns: minmax(220px, 1fr) minmax(160px, .6fr) auto; }
}

@media (max-width: 639.98px) {
  .card { padding: 20px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar button { width: 100%; }
  .card > .table-wrap { margin-right: -20px; margin-left: -20px; width: calc(100% + 40px); }
  th, td { padding: 13px 15px; }
  form[id^="product-"] { grid-template-columns: 1fr; }
  .form-field-short, .form-field-medium, .form-field-long,
  form > label > input:not([type=checkbox]):not([type=radio]):not([type=file]), form > label > select,
  .settings-grid > label, .settings-grid > label > select,
  .settings-grid > label > input[type=number], .settings-grid > label > input[type=datetime-local] { max-width: 100%; }
  .recurring-timing-row { grid-template-columns: 1fr; }
  .ts-wrapper { max-width: 100%; }
}
.form-validation-summary { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 10px; background: #fff1f2; color: #9f1239; font-size: 13px; font-weight: 650; }
[aria-invalid="true"] { border-color: #e11d48 !important; box-shadow: 0 0 0 3px rgb(225 29 72 / 10%) !important; }
.execution-pending[hidden] { display: none; }
.execution-pending {
  display: flex;
  max-width: 620px;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  background: #f5f9ff;
  color: #1e3a8a;
}
.execution-pending strong, .execution-pending small { display: block; }
.execution-pending strong { font-size: 13px; }
.execution-pending small { margin-top: 3px; color: #52647f; line-height: 1.45; }
.execution-feedback:empty { display: none; }
.execution-feedback { margin-top: 14px; }
.execution-feedback .alert { margin: 0; }
.execution-spinner, .execution-button-spinner {
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid rgb(50 109 245 / 22%);
  border-top-color: #326df5;
  border-radius: 50%;
  animation: cvh-execution-spin .7s linear infinite;
}
.execution-spinner { width: 22px; height: 22px; }
.execution-button-spinner { width: 15px; height: 15px; border-color: rgb(255 255 255 / 35%); border-top-color: #fff; }
[data-execution-form].is-submitting > button[type="submit"] { cursor: wait; opacity: .88; transform: none; }
@keyframes cvh-execution-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .execution-spinner, .execution-button-spinner { animation-duration: 1.4s; }
}
.cvh-confirm[hidden] { display: none; }
.cvh-confirm { position: fixed; z-index: 1100; inset: 0; display: grid; place-items: center; padding: 20px; }
.cvh-confirm-backdrop { position: absolute; inset: 0; background: rgb(15 23 42 / 55%); backdrop-filter: blur(3px); }
.cvh-confirm > section { position: relative; width: min(440px, 100%); padding: 24px; border: 1px solid var(--cvh-border); border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgb(15 23 42 / 24%); }
.cvh-confirm h2 { margin: 0 0 10px; font-size: 20px; }
.cvh-confirm p { margin: 0 0 22px; color: var(--cvh-muted); line-height: 1.6; }
