/* Shared layout for CSS generator / design tools */
/* Tokens: @own-agent/tokens/css/brand.css — ver tools/docs/UIUX-MIGRATION.md */

.design-tool-page h1,
.design-tool-page .design-tool-intro {
    text-align: center;
}

.design-tool-intro {
    margin: 0 0 8px;
}

.design-tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 16px;
    min-width: 0;
    width: 100%;
}

@media (min-width: 992px) {
    .design-tool-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        align-items: start;
        gap: 24px;
    }
}

.wrapper.design-tool-page {
    overflow-x: visible;
}

.design-tool-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.design-tool-output {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

@media (min-width: 992px) {
    .design-tool-output {
        position: sticky;
        top: 16px;
    }
}

.design-tool-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary, #663399);
    margin: 0 0 10px;
    text-align: center;
}

@media (min-width: 992px) {
    .design-tool-controls .design-tool-section-title {
        text-align: left;
    }
}

.design-tool-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.design-tool-panel {
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.design-tool-panel-title {
    font-weight: 600;
    color: var(--color-primary, #663399);
    margin-bottom: 12px;
    text-align: center;
}

.design-tool-form-label {
    display: block;
    margin-bottom: 5px;
}

.design-tool-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.design-tool-slider-row input[type="range"] {
    flex: 1;
    accent-color: var(--color-primary, #663399);
}

.design-tool-slider-row input[type="number"] {
    width: 72px;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid var(--gray-light, #ccc);
    border-radius: 4px;
}

.design-tool-form-control {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-bottom: 0;
}

.design-tool-form-group {
    margin-bottom: 0;
}

.design-tool-layer {
    border: 2px solid var(--color-primary, #663399);
    border-radius: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
}

.design-tool-controls > #shadowLayers {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.design-tool-layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.design-tool-layer-title {
    font-weight: 600;
    color: var(--color-primary, #663399);
}

.design-tool-remove-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
}

.design-tool-remove-btn:hover {
    background-color: #d32f2f;
}

.design-tool-remove-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.design-tool-color-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.design-tool-color-row .design-tool-form-group--grow {
    flex: 1;
    min-width: 180px;
}

.design-tool-panel-spaced {
    margin-top: 12px;
}

.design-tool-color-row input[type="color"] {
    width: 64px;
    height: 44px;
    padding: 2px;
    border: 2px solid var(--color-primary, #663399);
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.design-tool-color-stops {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.design-tool-color-stop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.design-tool-color-stop input[type="color"] {
    width: 64px;
    height: 64px;
    padding: 2px;
    border: 2px solid var(--color-primary, #663399);
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.design-tool-color-stop-label {
    font-size: 0.85rem;
    color: #555;
}

.design-tool-add-action {
    text-align: center;
    margin: 0;
}

.design-tool-preview-box {
    width: 100%;
    max-width: 400px;
    height: 200px;
    border: 2px solid var(--color-primary, #663399);
    margin: 0 auto;
    border-radius: 4px;
    background: #ffffff;
}

@media (min-width: 992px) {
    .design-tool-preview-box {
        max-width: 100%;
        margin: 0;
    }
}

.design-tool-preview-box--flex {
    display: flex;
    background-color: rgba(102, 51, 153, 0.06);
    overflow: hidden;
}

.design-tool-preview-content {
    box-sizing: border-box;
    width: 50px;
    min-height: 40px;
    border: 1px solid var(--color-secondary, #00b4d8);
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.design-tool-preview-content:nth-child(odd) {
    font-size: 14px;
}

.design-tool-preview-content:nth-child(even) {
    font-size: 22px;
}

.design-tool-hint {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
}

.design-tool-hint.is-visible {
    display: block;
}

.design-tool-hint:not(.is-visible) {
    display: none;
}

.design-tool-preview-section {
    min-width: 0;
}

.design-tool-code-section {
    min-width: 0;
}

.design-tool-output pre {
    background-color: white;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: black;
    border: 2px solid var(--color-primary, #663399);
    margin: 0;
    min-height: 120px;
}

.design-tool-output pre code {
    display: block;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word;
}

.design-tool-output .css-actions {
    text-align: center;
    margin-top: 0;
}

.design-tool-value-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.design-tool-value-row input[type="text"],
.design-tool-value-row input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid var(--gray-light, #ccc);
    border-radius: 4px;
    box-sizing: border-box;
}

.design-tool-preview-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 16px;
    box-sizing: border-box;
}

.design-tool-palette-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 0;
}

.design-tool-palette-table,
.design-tool-palette-table th,
.design-tool-palette-table td {
    border: 1px solid var(--gray-light, #ccc);
}

.design-tool-palette-table th,
.design-tool-palette-table td {
    padding: 10px;
    text-align: center;
    vertical-align: middle;
    min-width: 0;
    overflow: hidden;
    word-break: break-word;
}

.design-tool-palette-table th:nth-child(1),
.design-tool-palette-table td:nth-child(1) {
    width: 80px;
}

.design-tool-palette-table th:nth-child(3),
.design-tool-palette-table td:nth-child(3) {
    width: 96px;
}

.design-tool-palette-table th {
    background-color: rgba(102, 51, 153, 0.08);
    color: var(--color-primary, #663399);
    font-weight: 600;
}

.design-tool-swatch-cell {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 4px;
    border: 2px solid var(--color-primary, #663399);
}

.design-tool-palette-codes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    text-align: left;
}

.design-tool-color-value {
    cursor: pointer;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: normal;
    word-break: break-all;
    line-height: 1.35;
}

.design-tool-color-value:hover {
    color: var(--color-primary, #663399);
    text-decoration: underline;
}

.design-tool-palette-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    align-items: stretch;
}

.design-tool-palette-actions .button-green,
.design-tool-palette-actions .design-tool-remove-btn {
    font-size: 0.85rem;
    padding: 4px 10px;
    margin: 0;
    line-height: 1.4;
    min-height: 28px;
    box-sizing: border-box;
}

.design-tool-copy-btn {
    white-space: nowrap;
    min-width: 120px;
}

.design-tool-palette-empty {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    padding: 12px 0;
}
