:root {
    --background: #ffffff;
    --card: #fafafa;
    --text: #1d1d1f;
    --subtext: #86868b;
    --line: #e8e8e8;
    --empty: #c7c7cc;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    padding: 6px;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    overflow: hidden;
    background: var(--background);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        Pretendard,
        sans-serif;
}

button,
textarea {
    color: inherit;
    font: inherit;
}

button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.quote-widget {
    width: min(100%, 430px);
    height: 260px;
    padding: 18px 20px 16px;

    overflow: hidden;
    background: rgba(250, 250, 250, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.018);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.quote-view {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.quote-header,
.quote-footer,
.editor-header,
.editor-header > div,
.personal-item {
    display: flex;
    align-items: center;
}

.quote-header,
.quote-footer,
.editor-header {
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 11px;
}

.brand strong,
.editor-header strong {
    font-size: 16px;
    font-weight: 650;
}

.brand span {
    color: var(--subtext);
    font-size: 12px;
}

.quiet-button {
    padding: 3px 0;
    color: var(--subtext);
    font-size: 12px;
    transition: color 0.2s ease;
}

.quiet-button:hover {
    color: var(--text);
}

.quote-area {
    min-height: 0;
    padding: 18px 7px 15px;

    display: flex;
    align-items: center;
}

#quote {
    max-width: 350px;
    margin: 0;

    font-size: clamp(22px, 6vw, 27px);
    font-weight: 580;
    line-height: 1.28;
    letter-spacing: -0.6px;

    word-break: keep-all;
    overflow-wrap: anywhere;

    animation: quoteIn 0.32s ease;
}

.quote-footer {
    padding-top: 11px;
    border-top: 1px solid var(--line);
    color: var(--subtext);
    font-size: 12px;
}

.next-quote {
    padding: 0;
    color: var(--text);
    font-size: 19px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.next-quote:hover {
    transform: scale(1.12);
}

.quote-editor {
    height: 100%;
    display: grid;
    grid-template-rows: auto auto 1fr;
}

.editor-header > div {
    gap: 10px;
}

.editor-header span {
    color: var(--subtext);
    font-size: 11px;
}

/* Compact Personal Quotes editor */

.quote-editor {
    padding: 1px 3px 0;
}


.editor-header > div {
    gap: 7px;
}


.editor-header strong {
    font-size: 13px;
    white-space: nowrap;
}


.editor-header span {
    font-size: 9px;
    white-space: nowrap;
}


.quote-editor .quiet-button {
    font-size: 10px;
}


.quote-form {
    margin-top: 9px;

    grid-template-columns:
        minmax(0, 1fr) 92px;

    gap: 7px;
}


#quoteInput {
    height: 44px;
    padding: 7px 9px;

    font-size: 11px;
    line-height: 1.3;
}


.add-quote {
    width: 92px;
    padding: 0 8px;

    border-radius: 8px;

    font-size: 10px;
    white-space: nowrap;
}


.personal-list {
    margin-top: 7px;
}


.personal-item {
    min-height: 29px;
    padding: 5px 2px;
}


.personal-item span {
    font-size: 10px;
}


.delete-quote {
    font-size: 14px;
}


.empty-state {
    font-size: 10px;
}


@media (max-width: 360px) {
    .quote-editor {
        padding-inline: 0;
    }

    .editor-header strong {
        font-size: 12px;
    }

    .quote-form {
        grid-template-columns:
            minmax(0, 1fr) 78px;

        gap: 5px;
    }

    .add-quote {
        width: 78px;
        padding-inline: 5px;

        font-size: 9px;
    }
}

.quote-form {
    margin-top: 13px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
}

#quoteInput {
    width: 100%;
    height: 57px;
    padding: 10px 12px;
    resize: none;

    border: 1px solid var(--line);
    border-radius: 9px;
    outline: none;
    background: #ffffff;
    color: var(--text);

    font-size: 13px;
    line-height: 1.35;
}

#quoteInput:focus {
    border-color: #c8c8cc;
}

#quoteInput::placeholder {
    color: #b5b5ba;
}

.add-quote {
    align-self: stretch;
    padding: 0 13px;
    border-radius: 9px;
    background: #1d1d1f;
    color: #ffffff;
    font-size: 12px;
}

.add-quote:disabled {
    opacity: 0.35;
    cursor: default;
}

.personal-list {
    min-height: 0;
    margin-top: 10px;
    overflow-y: auto;
    scrollbar-width: none;
}

.personal-list::-webkit-scrollbar {
    display: none;
}

.personal-item {
    min-height: 36px;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 2px;
    border-bottom: 1px solid var(--line);
}

.personal-item span {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-quote {
    flex: 0 0 auto;
    padding: 2px;
    color: var(--subtext);
    font-size: 17px;
    line-height: 1;
}

.empty-state {
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--subtext);
    font-size: 12px;
    text-align: center;
}

@keyframes quoteIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 360px) {
    .quote-widget {
        padding-inline: 16px;
    }

    .brand span {
        display: none;
    }

    #quote {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
