/* The Forms, Look and Publish pages of the website builder (Pages/Websites/WebsiteForms.razor, WebsiteLook.razor,
   WebsitePublish.razor). Each page wraps its content in .ws-tool, and every rule here starts with .ws-tool, so no other
   page takes these styles.
   The second part styles the shared field components (Shared/Components/Websites: the field editor, the link editor,
   the asset field) and the lists that SortableRows draws. Pages/Websites/WebsiteEditor.razor.css holds the same rules
   as scoped ::deep rules under .ws-editor for the page editor. */

.ws-tool {
    padding: 0 1em 2em 85px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1320px;
}

@media (max-width: 767.98px) {
    .ws-tool {
        padding-left: 1em;
    }
}

.ws-tool .ws-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--oc-text-muted);
}

.ws-tool .ws-tool-title {
    margin: 0;
    font-size: 1.75rem;
}

.ws-tool .ws-lead {
    margin: 0;
}

.ws-tool .ws-card {
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
}

.ws-tool .ws-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eeeeee;
}

.ws-tool .ws-card-head h2,
.ws-tool .ws-card-head h3 {
    margin: 0;
    font-size: 1.125rem;
}

.ws-tool .ws-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

.ws-tool .ws-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875rem;
}

.ws-tool .ws-badge-live {
    background: #e6f4ea;
    color: #1e6b2f;
}

.ws-tool .ws-at-once {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0;
    font-size: 0.875rem;
    color: var(--oc-text-muted);
}

.ws-tool .ws-done {
    padding: 0.75rem 1rem;
    border: 1px solid #b7dfc2;
    border-radius: 8px;
    background: #e6f4ea;
    color: #1e4620;
}

.ws-tool .ws-done-title {
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.ws-tool .ws-rule {
    margin: 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid #c74416;
    border-radius: 0 8px 8px 0;
    background: #f8fafc;
}

.ws-tool .ws-confirm {
    flex-basis: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #f3d9b5;
    border-radius: 8px;
    background: #fff4e5;
}

.ws-tool .ws-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--oc-text-muted);
}

/* ------------------------------------------------------------------ tabs and columns */

.ws-tool .ws-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid #dddddd;
}

.ws-tool .ws-tab {
    min-height: 44px;
    padding: 0 1rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #333333;
    font-weight: 600;
}

.ws-tool .ws-tab[aria-selected="true"] {
    border-bottom-color: #c74416;
    color: #222222;
}

.ws-tool .ws-tab:focus-visible,
.ws-tool .ws-preset:focus-visible,
.ws-tool .ws-chip:focus-visible {
    outline: 3px solid #fb9965;
    outline-offset: 1px;
}

.ws-tool .ws-two {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
}

.ws-tool .ws-col-main {
    flex: 3 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ws-tool .ws-col-side {
    flex: 2 1 360px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ws-tool .ws-frame {
    display: block;
    width: 100%;
    height: 680px;
    border: 1px solid #c9c9c9;
    border-radius: 8px;
    background: #ffffff;
}

/* ------------------------------------------------------------------ lists with a drag and Move up and Move down */

.ws-tool .ws-sort-list,
.ws-tool .ws-pub-list,
.ws-tool .ws-history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ws-tool .ws-sort-row,
.ws-tool .ws-pub-row,
.ws-tool .ws-history-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-height: 52px;
    padding: 0.25rem 0.75rem;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
}

.ws-tool .ws-sort-main,
.ws-tool .ws-pub-main,
.ws-tool .ws-history-main {
    flex: 1 1 220px;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
}

.ws-tool .ws-sort-name,
.ws-tool .ws-pub-name {
    margin: 0;
    color: #222222;
    font-weight: 600;
}

.ws-tool .ws-sort-sub,
.ws-tool .ws-pub-sub {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.875rem;
    color: var(--oc-text-muted);
}

.ws-tool .ws-pub-box {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
}

.ws-tool .ws-sort-edit {
    flex-basis: 100%;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px solid #eeeeee;
}

/* ------------------------------------------------------------------ theme presets, colors and chips */

.ws-tool .ws-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .ws-tool .ws-presets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ws-tool .ws-preset {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    min-height: 76px;
    padding: 10px 12px;
    border: 1px solid #c9c9c9;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-weight: 600;
    text-align: left;
}

.ws-tool .ws-preset[aria-pressed="true"] {
    padding: 9px 11px;
    border: 2px solid #c74416;
    background: #fff8f3;
}

.ws-tool .ws-dots {
    display: flex;
    gap: 6px;
}

.ws-tool .ws-dot {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 999px;
}

.ws-tool .ws-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ws-tool .ws-chip {
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid #c9c9c9;
    border-radius: 999px;
    background: #f8fafc;
    color: #333333;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875rem;
}

.ws-tool .ws-accent {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
}

.ws-tool .ws-accent .form-control-color {
    width: 60px;
    height: 44px;
}

/* ------------------------------------------------------------------ the shared field components */

.ws-tool .ws-muted {
    color: var(--oc-text-muted);
}

.ws-tool .ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 44px;
    padding: 0 1rem;
    border-radius: 6px;
    border: 1px solid #c9c9c9;
    background: #ffffff;
    color: #333333;
    font-weight: 600;
    text-decoration: none;
}

.ws-tool .ws-btn:hover {
    background: var(--oc-card-header-bg);
    color: #222222;
}

.ws-tool .ws-btn-small {
    padding: 0 0.75rem;
    font-size: 0.875rem;
}

.ws-tool .ws-btn-primary {
    background: #c74416;
    border-color: #c74416;
    color: #ffffff;
}

.ws-tool .ws-btn-primary:hover {
    background: #a8410d;
    border-color: #a8410d;
    color: #ffffff;
}

.ws-tool .ws-btn-danger {
    border-color: #a4262c;
    color: #a4262c;
}

.ws-tool .ws-btn-danger:hover {
    background: #fdecee;
    color: #8a1f24;
}

.ws-tool .ws-btn-ghost {
    border-color: transparent;
    background: transparent;
}

.ws-tool .ws-btn:disabled,
.ws-tool .ws-icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ws-tool .ws-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #333333;
}

.ws-tool .ws-icon-btn:not(:disabled):hover {
    background: #eceff3;
}

.ws-tool .ws-link-btn {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8a3510;
    text-decoration: underline;
    text-align: left;
}

.ws-tool .ws-btn:focus-visible,
.ws-tool .ws-icon-btn:focus-visible,
.ws-tool .ws-link-btn:focus-visible,
.ws-tool .ws-list-toggle:focus-visible,
.ws-tool .ws-asset-pick:focus-visible {
    outline: 3px solid #fb9965;
    outline-offset: 1px;
}

.ws-tool .ws-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.ws-tool .ws-badge-draft {
    background: #fff4e5;
    color: #8a4b00;
}

.ws-tool .ws-badge-muted {
    background: #eceff3;
    color: #4a4f57;
}

.ws-tool .ws-badge-warn {
    background: #fdecee;
    color: #8a1f24;
}

.ws-tool .ws-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    min-height: 44px;
    color: #616161;
    cursor: move;
}

.ws-tool .ws-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.125rem;
}

.ws-tool .ws-field {
    margin-bottom: 1rem;
}

.ws-tool .ws-field .form-control,
.ws-tool .ws-field .form-select,
.ws-tool .ws-link .form-control,
.ws-tool .ws-link .form-select {
    min-height: 44px;
}

.ws-tool .ws-field-invalid .form-control,
.ws-tool .ws-field-invalid .form-select,
.ws-tool [aria-invalid="true"] {
    border-color: #a4262c;
}

.ws-tool .ws-field-error,
.ws-tool .ws-field-warning,
.ws-tool .ws-field-note {
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.ws-tool .ws-field-error {
    color: #a4262c;
}

.ws-tool .ws-field-warning {
    color: #8a4b00;
}

.ws-tool .ws-field-note {
    color: #4a4f57;
}

.ws-tool .ws-required {
    color: #a4262c;
}

.ws-tool .ws-group,
.ws-tool .ws-list {
    margin: 0 0 1rem;
    padding: 0.75rem;
    border: 1px solid #dddddd;
    border-radius: 6px;
}

.ws-tool .ws-legend {
    float: none;
    width: auto;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.ws-tool .ws-count {
    color: var(--oc-text-muted);
    font-size: 0.8125rem;
    font-weight: 400;
}

.ws-tool .ws-list-items,
.ws-tool .ws-column-summary {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ws-tool .ws-list-item {
    border: 1px solid #dddddd;
    border-radius: 6px;
    background: #ffffff;
}

.ws-tool .ws-list-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.25rem;
}

.ws-tool .ws-list-grow {
    flex: 1 1 auto;
    min-width: 0;
}

.ws-tool .ws-map-row .form-control {
    min-width: 0;
}

.ws-tool .ws-list-toggle {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 0 0.375rem;
    border: 0;
    background: transparent;
    color: #222222;
    font-weight: 600;
    text-align: left;
}

.ws-tool .ws-list-body {
    padding: 0.75rem;
    border-top: 1px solid #eceff3;
}

.ws-tool .ws-code {
    font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.875rem;
}

.ws-tool .ws-number,
.ws-tool .ws-date {
    max-width: 14rem;
}

.ws-tool .ws-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ws-tool .ws-color input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 2px;
}

.ws-tool .ws-check,
.ws-tool .ws-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
}

.ws-tool .ws-check .form-check-input,
.ws-tool .ws-switch .form-check-input {
    margin-top: 0;
    border-color: #767676;
}

.ws-tool .ws-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
}

.ws-tool .ws-asset {
    margin-bottom: 0.25rem;
}

.ws-tool .ws-asset-current {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.ws-tool .ws-asset-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 3rem;
    border-radius: 4px;
    border: 1px solid #dddddd;
    object-fit: cover;
    background: #f1f5f9;
    color: #616161;
}

.ws-tool .ws-asset-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-tool .ws-asset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ws-tool .ws-asset-picker {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #dddddd;
    border-radius: 6px;
    background: #f8fafc;
}

.ws-tool .ws-asset-heading {
    margin: 0 0 0.375rem;
    font-weight: 600;
}

.ws-tool .ws-asset-grid {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: 0.5rem;
}

.ws-tool .ws-asset-files {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ws-tool .ws-asset-pick {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    width: 100%;
    min-height: 44px;
    padding: 0.25rem;
    border: 1px solid #dddddd;
    border-radius: 6px;
    background: #ffffff;
    color: #333333;
    font-size: 0.8125rem;
    text-align: left;
}

.ws-tool .ws-asset-pick img {
    width: 100%;
    height: 4.5rem;
    object-fit: cover;
    border-radius: 4px;
}

.ws-tool .ws-asset-pick span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-tool .ws-asset-file {
    flex-direction: row;
    align-items: center;
}

.ws-tool .ws-asset-pick[aria-pressed="true"] {
    border-color: #c74416;
    box-shadow: 0 0 0 1px #c74416;
}

.ws-tool .ws-asset-upload {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #dddddd;
}


/* ------------------------------------------------------------------ the Forms page */

.ws-tool .ws-form-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ws-tool .ws-form-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem 0.75rem;
    width: 100%;
    min-height: 52px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
    color: #222222;
    text-align: left;
}

.ws-tool .ws-form-pick:hover {
    border-color: #999999;
}

.ws-tool .ws-form-pick:focus-visible {
    outline: 3px solid #fb9965;
    outline-offset: 1px;
}

.ws-tool .ws-form-current,
.ws-tool .ws-form-current:hover {
    border-color: #c74416;
    box-shadow: 0 0 0 1px #c74416;
    background: #fff7f2;
}

.ws-tool .ws-new-form {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #dddddd;
}

.ws-tool .ws-tab-panel {
    padding-top: 1rem;
}

.ws-tool .ws-two-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 1rem;
}

/* A question row holds the line with the buttons, then the delete question and the edit fields below it. */
.ws-tool .ws-sort-line {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-height: 44px;
}

.ws-tool .ws-question-edit {
    flex-basis: 100%;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px solid #eeeeee;
}

.ws-tool .ws-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ws-tool .ws-add-row .form-label {
    flex-basis: 100%;
    margin-bottom: 0;
}

.ws-tool .ws-add-row .form-control,
.ws-tool .ws-add-row .form-select {
    flex: 1 1 200px;
    width: auto;
    min-height: 44px;
}

.ws-tool .ws-field .ws-add-row {
    margin-top: 0;
}

.ws-tool .ws-email-frame {
    display: block;
    width: 100%;
    height: 640px;
    border: 1px solid #c9c9c9;
    border-radius: 8px;
    background: #ffffff;
}

.ws-tool .ws-test-result {
    margin: 0.5rem 0 0;
    color: #222222;
    font-weight: 600;
}

/* ------------------------------------------------------------------ the Look page */

.ws-tool .ws-look-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.ws-tool .ws-look-bar .ws-tabs {
    flex: 1 1 520px;
}

.ws-tool .ws-look-frame {
    height: 720px;
}

.ws-tool .ws-contrast[data-low="true"] {
    color: #9a3412;
    font-weight: 600;
}

.ws-tool .ws-primary-note {
    flex-basis: 100%;
    margin: 0;
}

.ws-tool .ws-site-address dt {
    color: #222222;
    font-weight: 600;
}

.ws-tool .ws-site-address dd {
    margin-left: 0;
}

.ws-tool .ws-new-redirect {
    margin-top: 0.75rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid #dddddd;
    border-radius: 8px;
}

.ws-tool .ws-location-edit .ws-btn,
.ws-tool .ws-redirect-edit .ws-btn {
    margin-top: 0.5rem;
}
