/* ===== Right Panel ===== */
.right-panel {
    width: 900px;
    min-width: 280px;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
}

.right-resize-handle {
    width: 14px;
    min-width: 14px;
    cursor: ew-resize;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    user-select: none;
    flex-shrink: 0;
    align-self: stretch;
    margin: 0 4px;
}

.right-resize-handle::after {
    content: '';
    width: 3px;
    height: 40px;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
    transition: background 0.2s, height 0.2s;
}

.right-resize-handle:hover {
    background: rgba(255,255,255,0.05);
}

.right-resize-handle:hover::after {
    background: rgba(255,255,255,0.35);
    height: 56px;
}

/* Info Panel */
.info-panel {
    flex: 1;
    padding: 14px;
    border-bottom: 1px solid #2e2e2e;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.info-time {
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: 1px;
}

.info-line {
    font-size: 0.95em;
    color: #d8d8d8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-poem {
    font-size: 1.3em;
    color: #e8e1c8;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
}

/* Expander Buttons */
.expander-row {
    display: flex;
    gap: 4px;
    margin-top: auto;
    flex-wrap: wrap;
}

.expander-btn {
    flex: 1;
    background: none;
    color: #aaa;
    border: none;
    padding: 6px 0;
    font-size: 0.9em;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
    text-align: center;
}

.expander-btn:hover {
    color: #fff;
}

.expander-btn.active {
    color: #81b8ff;
}

/* Feature Panel */
.feature-panel {
    flex: 4;
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0 0 14px 14px;
}

.feature-content {
    display: none;
    height: 100%;
    overflow: hidden;
    flex-direction: column;
    gap: 10px;
}

.feature-content.active {
    display: flex;
}

.feature-title {
    margin: 0;
    font-size: 1.1em;
}

.feature-input-row {
    display: flex;
    gap: 8px;
}

.feature-input-row input {
    flex: 1;
    min-width: 0;
}

.feature-input-row textarea {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid #454545;
    background-color: #212121;
    color: #dedede;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9em;
}

/* Chat */
.chat-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    background: #171717;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    --chat-bubble-width: 85%;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 8px;
    max-width: var(--chat-bubble-width, 85%);
    word-break: break-word;
    font-size: 0.95em;
    line-height: 1.4;
    position: relative;
}

.chat-message.system {
    color: #888;
    align-self: center;
    font-size: 0.85em;
    background: none;
}

.chat-message.user {
    background: #2b5d3a;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-message.ai {
    background: #2a2a2a;
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-message.ai .copy-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.25;
    font-size: 0.8em;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: opacity 0.2s, background 0.2s;
}

.chat-message.ai:hover .copy-btn {
    opacity: 0.7;
}

.chat-message.ai .copy-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

/* Item Lists */
.item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    background: #171717;
}

.item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #2f2f2f;
    cursor: grab;
}

.item:last-child {
    border-bottom: none;
}

.item.drag-over {
    border-top: 2px solid #81b8ff;
}

.item-text {
    flex: 1;
    word-break: break-word;
    color: #e8e8e8;
}

.item-empty {
    padding: 18px 10px;
    color: #999;
    text-align: center;
}

.item-btn {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    border: 1px solid #5d5d5d;
    background: #252525;
    color: #fff;
}

.item-btn.delete {
    border-color: #a04848;
    background: #532323;
}